GX5296, File.
Returns the specified channel Tri-State termination mode.
GtDio6xChannelGetTriStateTerminationMode (nHandle, nChannel, pnMode, pnStatus)
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. |
nChannel |
SHORT |
Used to specify the channel to Get. This parameter is 0-based and refers to any channel in the Domain.Not supported by auxiliary channels. |
pnMode |
PSHORT |
Returned 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. |
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’ |
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);
GtDio6xChannelSetTriStateTerminationMode, GtDio6xChannelSetTriStateTerminationVoltage, GtDio6xGetErrorString