Returns the status of all relays in the specified group.
Gx6338GetGroupChannels (nHandle, nGroup, plHighChStates, plLowChState,pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6338 board. |
nGroup |
SHORT |
Group on the GX6338 board. 0-2: 0 for group A, 1 for group B and 2 for group C. |
plHighChStates |
LPLONG |
Returned state of relays 33-38 of the given group. |
plLowChStates |
LPLONG |
Returned state of relays 1-32 of the given group. |
pnStatus |
LPSHORT |
Returned status: 0 on success, negative number on failure. |
The function returns the state of all the channels (relays) of a specified group in two 32-bit long variables, plHighChStates and plLowChStates. Every bit in plxxxStates represents a channel. The bits 0-31 of lLowChStates are for relays 1-32 and bits 0-5 of lHighChStates are for relays 33-38 respectively. For each bit, a value of 0 indicates that the channel is open while a value of 1 indicates that the channel is closed.
Use Gx6338GetChannel function to retrieve the status of a single channel.
The following example checks whether relays 1 and 3 of group A are closed:
Gx6338GetGroupChannels(nHandle, 0, &lHighChStates,
&lLowChStates, &nStatus);
if ((plLowChStates & 0x5) == 0x5) // binary ..0000101
printf("Relay 1 and 3 are closed");
Gx6338Initialize, GxSWGetErrorString, Gx6338GetChannel, Gx6338SetGroupChannels