Gx6616GetRow

Purpose

Returns the state of all relays of the specified group and row.

Syntax

Gx6616GetRow (nHandle, nGroup, nRow, pnStates, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6616 board.
nGroup
SHORT
Group number 0-5. Corresponds to groups A-F.
nRow
SHORT
Row number 0 or 1.
pnStates
LPSHORT
Returned state of the 16 relays in the row. Each bit corresponds to a relay in the selected row where a '1' corresponds to a closed relay and '0' to an open relay. The low order bit represents column 0 and the high order bit represents column 15.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx6616GetChannel function to retrieve the state of a specific relay.

Example

The following example checks whether relay at group C, row 0, column 3 and 4 are closed:

 

Gx6616GetRow(nHandle, 2, 0, &nStates, &nStatus);

if (nStates & 0xC)

    printf("C0-3/4 relays are closed");

 

See Also

Gx6616Initialize, Gx6616GetErrorString, Gx6616GetChannel, Gx6616SetRow, Gx6616Close, Gx6616Open