Sets all relays of the specified group to a specified state.
Gx6338SetGroupChannels (nHandle, nGroup, lHighChStates, lLowChState, 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. |
lHighChStates |
LONG |
State of relays 33-38 of the given group. |
lLowChStates |
LONG |
State of relays 1-32 of the relays group. |
pnStatus |
LPSHORT |
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 lLowChStates is used for channel 1 and bit 31 (hi order) for channel 32, e.g. a value of 3 means channel 1 and 2 are closed and the rest of the channels (1 to 32) of the group are open. Bit 0 (low order bit) of lHighChStates is used for channel 33 and bit 5 for channel 38, e.g. value of 5 means channel 33 and 35 are closed and the rest of channels (33 to 38) of the group are open.
Note: Channels that change state from close to open are first being opened and only then closes any channel that needs to be closed.
Use Gx6338GetChannel 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:
lLowChOpenClose=0x5; lHighChOpenClose=0;
Gx6338SetGroupChannels(nHandle, 0, lHighChOpenClose, lLowChOpenClose, &nStatus);
Gx6338Initialize, Gx6338GetChannel, GxSWGetErrorString, Gx6338GetGroupChannels, Gx6338Close, Gx6338Open