Gx6325GetGroupChannels

Purpose

Returns the status of all relays in the specified group.

Syntax

Gx6325GetGroupChannels (nHandle, nGroup, plChannelsState, pnStatus)

Parameters

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.
plChannelsStates
PLONG
Returned state of relays 1-25 of the given group.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

The function returns the state of all the channels (relays) of a specified group in one 32-bit long variables,  plChannelsState. Every bit in plChannelsState represents a channel. The bits 0-24 of for relays 1-25. 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 Gx6325GetChannel function to retrieve the status of a single channel.

Example

The following example checks whether relays 1 and 3 of group A are closed:

 

Gx6325GetGroupChannels(nHandle, 0, &lChannelsState,

&nStatus);

if ((lChannelsState & 0x5) == 0x5) // binary ..0000101

printf(“Relay 1 and 3 are closed”);

 

See Also

Gx6325Initialize, GxSWGetErrorString, Gx6325GetChanel, Gx6325SetGroupChannels