Gx6377RelaySetGroupChannels (nHandle, nRelayType, nStates, pnStatus)
Name |
Type |
Comments |
nHandle |
SHORT |
Handle to a GX6377 board. |
nRelayType |
SHORT |
Specifies the type of relay:GX6377_RELAY_TYPE_HIGH_CURRENTGX6377_RELAY_TYPE_FORM_AGX6377_RELAY_TYPE_FORM_C |
nStates |
SHORT |
States of all the relays. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative number on failure. |
The function sets the states of all the channels (relays) of the specified relay type. Every bit in nStates represents a channel as follows.
GX6377_RELAY_TYPE_HIGH_CURRENT: bits 0-4 of nStates are for relays 1-5
GX6377_RELAY_TYPE_FORM_A: bits 0-3 of nStates are for relays 1-4
GX6377_RELAY_TYPE_FORM_C: bits 0-3 of nStates are for relays 1-4
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 Gx6377RelayGetChannel function to retrieve the status of a single channel.
The following example close relays 1 and 3 of the high current relays:
Gx6377RelaySetChannels(nHandle, GX6377_RELAY_TYPE_HIGH_CURRENT, 0x5, &nStatus);
Gx6377RelayGetChannels, Gx6377RelayGetChannel, GxSWGetErrorString