GtDio6xChannelSetConnect

Applies To

GX5961, GX5964

Purpose

Sets the channel connection state.

Syntax

GtDio6xChannelSetConnect (nHandle, lChannelListArraySize, palChannelListArray, bChannelConnectState, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Session identifier:

     Board handle is used when communicating with the hardware. The Board handle session identifier is returned by calling GtDio6xInitialize or GtDio6xSetupInitialization.

lChannelListArraySize
LONG
Used to specify the number of channels to set. This parameter should not be greater than the size of palChannelListArray. If GTDIO6X_ALL_DOMAIN is passed in, then the palChannelListArray parameter can be set to NULL and the settings will be applied to all channels in the Domain.
palChannelListArrary
PLONG
Array containing channels numbers that will be set by this function,  channels numbers are 0-based and refers to any channel in the Domain. Auxiliary channel numbers begin with 1000.
GX5961: Each GX5961 board has 4 fully programmable auxiliary channels, and 8 TTL I/O channels. First 4 auxiliary channels may use all the Pin Electronics API.
GX5964: Does not have Auxiliary channels.
bChannelConnectState
BOOL
Used to return the channel connection state:

0.    GTDIO6X_CONNECT_OFF: Disable the channel to the Front Panel I/O Connector (J8).

1.    GTDIO6X_CONNECT_ON: Enable the channel to the Front Panel I/O Connector (J8).

pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

This function sets the state of the isolation relay for each channel. The channel connection can either be enabled or disabled per channel. This function addresses any channel in the domain. This function is used to control the isolation relay for each I/O channel. When the isolation relay is closed the Saturn pin electronic pin is connected to the J8 I/O connector.

Example

The following example connect channels 0 and 6 to the Front Panel I/O Connector, and gets channel 0 connection state:

 

SHORT nStatus;

LONG alChannelList[2];

BOOL bConnectState;

 

// Fill the channels array

alChannelList[0]=0;

alChannelList[1]=6;

 

GtDio6xChannelSetConnect (nHandle, 2, alChanneList GTDIO6X_CONNECT_ON, &nStatus);

GtDio6xChannelGetConnect (nHandle, 0, &bConnectState, &nStatus);

if(bConnectState)

   printf(“Channel 0 is connected”);

 

See Also

GtDio6xChannelGetConnect, GtDio6xChannelSetAnalogConnection, GtDio6xGetErrorString