GtDio6xChannelSetTriStateTerminationMode

Applies To

GX5296, File.

Purpose

Sets the specified channel Tri-State termination mode.

Syntax

GtDio6xChannelSetTriStateTerminationMode (nHandle, lChannelListArraySize, palChannelListArray, nMode, 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.

     File handle is used when communicating with a file. The File handle session identifier is  returned by calling GtDio6xFileOpen.

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.
palChannelListArray
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.
GX5296: Each GX5296 board has 4 auxiliary channels that support all the Pin Electronics API functions.
nMode
SHORT
Specified Tri-State termination mode:

0.    GTDIO6X_TRI_STATE_TERMINATION_MODE_DEFAULT: Default termination mode, in this mode the channel will be set to Hi-Z whenever the channel direction is set to input.

1.   GTDIO6X_TRI_STATE_TERMINATION_MODE_LEVEL: in this mode the channel will be set to the voltage as specified in DioSetupTriStateTerminationVoltage API whenever the channel direction is set to input.

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

Comments

GX5296:

The channel Tri-State termination mode, is used to generate a third voltage level whenever the channel’s driver state is Off (see table below).

The active load and the termination voltage mode are mutually exclusive, if the termination voltage mode was enabled then regardless of the active load state (enabled or disabled) when the driver goes into HiZ the source and sink are automatically programmed to zero mA.

If the termination voltage mode was disabled and the active load state was enabled, then when the driver goes into HiZ the source and sink are active as a function of the input voltage.

NOTE: The specified termination voltage is the same voltage that is used by the input active load commutating voltage.

Channels termination voltage can be read back and set dynamically at any time even while the DIO is running mode.

The termination voltage enabled only when the specified channel’s driver state is Off. The following Opcodes will activate the termination voltage (if it was enabled through the driver prior to running):

Opcode
Description
Driver State
Drive Level
Comparator Expect
Invert Code
H
Expect High, Don’t Drive
Off
X
>ViH
Expect Valid Low ‘L’
L
Expect Low, Don’t Drive
Off
X
<ViL
Expect Valid High ‘H’
Z
Tristate (Disabled)
Off
N/A
None
Disable Channel ‘Z’
V
Expect Valid Level
Off
X
>ViH OR <ViL
Expect Invalid ‘B’
B
Expect Invalid Level
Off
X
<ViH AND >ViL
Expect Valid ‘V’
C
Collect CRC
Off
X
None
Collect CRC ‘C’

Example

The following example set channels 0 and 2 termination mode to level, and returns channel 0 settings:

 

SHORT nMode;

LONG alChannelList[2];

 

// Fill channel array

alChannelList[0] = 0;

alChannelList[1] = 2;

GtDio6xChannelSetTriStateTerminationMode (nHandle, 2, alChannelList, &nStatus);

 

GtDio6xChannelGetTriStateTerminationMode (nHandle, 0, &nMode, &nStatus);

 

See Also

GtDio6xChannelGetTriStateTerminationMode, GtDio6xChannelSetTriStateTerminationVoltage, GtDio6xGetErrorString