Sets all relays of the specified group to a specified state.
Gx6325SetGroupChannels (nHandle, nGroup, lChannelsState, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6325 board. |
nGroup |
SHORT |
Group on the GX6325 board. 0-2: 0 for group A, 1 for group B and 2 for group C. |
lChannelsState |
LONG |
State of relays 1-25 of the given group. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The lxxxStates parameters holds the state of group relays. Every bit represents a channel. A value of 0 indicates that the channel is open while a value of 1 indicates that the channel is closed. Bit 0 (low order bit) of lChannelsState is used for channel 1 and bit 24 for channel 25, e.g. a value of 3 means channel 1 and 2 are closed and the rest of the channels (1 to 25) of the group are open.
Use Gx6325GetChannel function instead to retrieve the status of a single channel.
|
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 A to a closed state:
lChannelsOpenClose=0x5;
Gx6325SetGroupChannels(nHandle, 0, lChannelsOpenClose,
&nStatus);
Gx6325Initialize,Gx6325GetChannel, GxSWGetErrorString, Gx6325GetGroupChannels, Gx6325Close, Gx6325Open