Gx6377RelayGetChannel

Purpose

Returns the state of the specified channel for the specified relays type.

Syntax

Gx6377RelayGetChannel (nHandle, nRelayType, nChannel, pnState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle to a GX6377 board.
nRelayType
SHORT
Specifies the type of relay:
  • GX6377_RELAY_TYPE_HIGH_CURRENT
  • GX6377_RELAY_TYPE_FORM_A
  • GX6377_RELAY_TYPE_FORM_C
nChannel
SHORT
Specifies the relay number according to the specified the type of relay as follow:
  • GX6377_RELAY_TYPE_HIGH_CURRENT: Channels 1-5
  • GX6377_RELAY_TYPE_FORM_A: Channels 1-4
  • GX6377_RELAY_TYPE_FORM_C: Channels 1-4
pnState
LPSHORT
Returned relay state. Closed = 1, Open = 0.
pnStatus
LPSHORT
Returned status: 0 on success, negative number on failure.

 

Comments

Use the Gx6377RelayGetGroupChannels to retrieve the status of all channels of the specified relays type.

Example

The following example returns the state of channel 2 for the high current relays type:

 

SHORT nState;

Gx6377RelayGetChannel (nHandle, GX6377_RELAY_TYPE_HIGH_CURRENT, 2, &nState, &nStatus);

 

See Also

Gx6377RelayOpen, Gx6377RelayClose, Gx6377RelaySetChannels, GxSWGetErrorString