Gx6338GetChannel

Purpose

Returns the state of the specified relay.

Syntax

Gx6338GetChannel (nHandle, nChannel, pnState, pnStatus)

Parameters

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

  

Comments

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

Example

The following example return the status of relay 1:

 

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

if (nState==1)

printf("Relay 1 is Closed");

else

printf("Relay 1 is Open");

 

See Also

Gx6338Initialize, GxSWGetErrorString, Gx6338Close, Gx6338Open, Gx6338GetGroupChannels