Returns the state of the specified relay.
Gx6125GetChannel (nHandle, nChannel, pnState, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6125 board. |
nChannel |
SHORT |
Specifies the relay number. Can be 1 to 25. |
pnState |
PSHORT |
Returned relay state. Closed = 1 and Open = 0. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
Use the Gx6125GetChannels to retrieve the status of all channels.
The following example return the status of relay 1:
Gx6125GetChannel(nHandle, 1, &nStateClose, &nStatus);
if (nState==1)
printf(“Relay 1 is Closed”);
else
printf(“Relay 1 is Open”);
Gx6125Intialize, GxSWGetErrorString, Gx6125Close, Gx6125Open, Gx6125GetChannels