Sets all relays to a specified state.
Gx6125SetChannels (nHandle, lChannelsState, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6125 board. |
lChannelsState |
LONG |
State of relays 1-25. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The lxxxStates parameters holds the relays state. 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) are open.
Use Gx6125GetChannel 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 to a closed state:
lChannelsOpenClose=0x5;
Gx6125SetChannels(nHandle, lChannelsOpenClose, &nStatus);
Gx6125Intialize, Gx6125GetChannel, Gx6125GetChannels, Gx6125Close, Gx6125Open, GxSWGetErrorString