Sets all relays of the specified group to a specified state according to the specified parameter.
Gx6315SetGroupChannels (nHandle, nGroup, lStates, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6315 board. |
nGroup |
SHORT |
Group on the GX6315 board 0-2: 0 for group A, 1 for group B and 2 for group C. |
lStates |
LONG |
Each bit represents a relay state:0 = Open1 = Closed. See Comments. |
pnStatus |
LPSHORT |
Returned status: 0 on success, negative number on failure. |
The lStates parameter sets the state of all relays of the specified group. The function returns the status of all the channels (relays) in a single 32-bit long pointer plStates. The low order bits 0-14 are for relays 1-15 and bits 16-18 are for relay drivers 1-3 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.
|
Caution - When closing a relay, verify that all other relays on the same circuit that may cause a short are disconnected (a delay may be required between switching commands). Low Impedance sources such as power supplies may cause irreversible damage to this product when shorted to other signals. |
The following example sets relays 1 and 3 of group C to a closed state:
Gx6315SetGroupChannels(nHandle, 2, 0x5, &nStatus);