Gx6021GetChannel

Purpose

Returns whether the specified channel is open or closed.

Syntax

Gx6021GetChannel (nHandle, nChannel, pnState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6021 board.
nChannel
SHORT
Channel numbers are from 1 (GX6021_CHANNEL_FIRST) to 20 (GX6021_CHANNEL_LAST).
pnState
PSHORT
Returns channel state are as follow:
  • 0 = GX6021_STATE_OPEN
  • 1 = GX6021_STATE_CLOSE
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each group has five channels with total of twelve groups. In order to correlate the channel number (nChannel) to its group use the following formula:

Group number = (nChannel-1)/5, e.g. channel 8 is channel 3 in group B.

Example

The following example returns channel 15 state:

 

SHORT nState, &nStatus

Gx6021GetChannel (nHandle, 15, &nState, &nStatus);

 

See Also

Gx6021Close, Gx6021Open, Gx6021GetGroupRelays, Gx6021SetGroupRelays, Gx6021ConnectChannels, GxSWGetErrorString