Returns whether the specified relay or relay driver at the specified board is open or closed.
Gx6115GetChannel (nHandle, nRelayType, nChannel, pnState, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6115 board. |
nrelayType |
SHORT |
Specifies the type of relay 0-1:0 for the high current relay1 for the driver relay. |
nChannel |
SHORT |
Specifies the relay number. Can be 1-15 for the high current relay, 1-3 for the driver relay. |
pnState |
LPSHORT |
Returned relay state. Closed = 1 and Open = 0. |
pnStatus |
LPSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx6115GetChannels to retrieve the status of all channels in one function call.
The following example return the status of relay 1:
Gx6115GetChannel(nHandle, 0, 1, &nClose, &nStatus);
if (nClose==1)
printf(“Relay 1 is Close”);
else
printf(“Relay 1 is Open”);
Gx6115Initialize, GxSWGetErrorString, Gx6115Close, Gx6115Open, Gx6115GetChannels