Gx6325GetChanel

Purpose

Returns the state of the specified relay.

Syntax

Gx6325GetChannel (nHandle, nChannel, , pnState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6325 board.
nChannel
SHORT
Specifies the relay number. Can be 1 to 75.
pnState
PSHORT
Returned relay state. Closed = 1 and Open = 0.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Use the Gx6325GetGroupChannels to retrieve the status of all channels of the specified group.

Example

The following example returns the status of relay 1:

 

Gx6325GetChannel(nHandle, 1, &nStateClose, &nStatus);

if (nState==1)

printf(“Relay 1 is Closed”);

else

printf(“Relay 1 is Open”);

 

See Also

Gx6325Initialize, GxSWGetErrorString, Gx6325Close, Gx6325Open, Gx6325GetGroupChannels