Gx6616SetRow

Purpose

Opens or closes the 16 relays that belong to the specified group and row.

Syntax

Gx6616SetRow (nHandle, nGroup, nRow, nStates, 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.
nStates
LONG
The state of all 16 column relays in the row. Each bit corresponds to a relay in the selected row where 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

The function perform break before make when switching the relays, opening all relays that were closed than it closes the relays that were specified to be closed. The function ensures that a proper delay (one millisecond) is used between switching a relay. This prevents a relay being closed before a previous switching open command is complete.  

Warning

Caution - The flexibility provided by the switch matrix means that any point could be connected to any other point. Extreme care should be observed when developing the control software to prevent shorts between low-impedance sources (such as power supplies). A typical method to prevent such shorts is to use a resistor in series between the power supplies and the switch matrix if these signals are for measurement purposes only. Before closing a relay, verify that no other low-impedance source is connected to the same Row/Column.

Example

The following example checks closes relay at group C, row 0, relay 3 and 4 and opens all other relays in the same row.

 

Gx6616SetRow(nHandle, 2, 0, 0xC, &nStatus);

 

See Also

Gx6616Initialize, Gx6616GetErrorString, Gx6616GetChannel, Gx6616GetRow, Gx6616Close, Gx6616Open