Gx6377RelaySetChannels

Purpose

Sets the states of all relays for the specified relay type.

Syntax

Gx6377RelaySetGroupChannels (nHandle, nRelayType, nStates, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6377 board.
nRelayType
SHORT
Specifies the type of relay:
GX6377_RELAY_TYPE_HIGH_CURRENT
GX6377_RELAY_TYPE_FORM_A
GX6377_RELAY_TYPE_FORM_C
nStates
SHORT
States of all the relays.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

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.

Example

The following example close relays 1 and 3 of the high current relays:

 

Gx6377RelaySetChannels(nHandle, GX6377_RELAY_TYPE_HIGH_CURRENT, 0x5, &nStatus);

 

See Also

Gx6377RelayGetChannels, Gx6377RelayGetChannel, GxSWGetErrorString