Gx6115SetChannels

Purpose

Sets all relays to a specified state according to the specified parameter.

Syntax

Gx6115SetChannels (nHandle, lStates, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6115 board.
lStates
LONG
Each bit represents a relay state:
0 = Open
1 = Closed. See Comments.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure.

Comments

The lStates parameter sets the state of all channels. The low order bits 0-14 are for relays 1-15 and bits 16-18 are for relay drivers 1-3 respectively. For each bit, a value of 0 indicates that the channel is open while a value of 1 indicates that the channel is closed.

Warning

Caution - When closing a relay, verify that all other relays on the same circuit that may cause a short are disconnected (a delay may be required between switching commands). Low Impedance sources such as power supplies may cause irreversible damage to this product when shorted to other signals.

 

Example

The following example sets relays 1 and 3 to a closed state:

 

SHORT nStatus;

Gx6115SetChannels(nHandle, 0x5, &nStatus);

 

See Also

Gx6115Initialize, Gx6115GetChannel, GxSWGetErrorString