GtDio6xChannelSetSenseLoadCurrent

Applies To

GX5296, GX5961, GX5964, File

Purpose

Sets the specified channel input source and sink load currents.

Syntax

GtDio6xChannelSetSenseLoadCurrent (nHandle, lChannelListArraySize, palChannelListArray, dISink, dISource, 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.
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.
GX5296: Each GX5296 board has 4 auxiliary channels that support all the Pin Electronics API functions.
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.
dISink
DOUBLE
Input channel constant current sink value in mA. Input channel constant current sink value can be set from 0mA to 24mA with 0.3662 μA resolution.
The input channel current sink forces the specified constant current to be active when the input voltage is below the low commutating voltage value.
dISource
DOUBLE
Input channel constant current source value in mA.
Input channel constant current source value can be set from 0mA to 24mA with 0.3662 μA resolution.
The input channel current source forces the specified constant current to be active when the input voltage is above the high commutating voltage value.
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

Each channel has a constant current source and sink load currents and a corresponding voltage clamp that can be set and enabled programmatically. The constant current source and sink load currents are enabled only when the specified channel’s driver state is Off. The following Opcodes will activate the active load (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’

Each channel has an independent load with the following capabilities:

Channels’ Input constant source and sink currents up to 24 mA – GtDio6xSetSenseLoadCurrent function.

Maintain high impedance over a wide voltage.

Separate high and low commutating voltages – GtDio6xSetSenseLoadCommutatingVoltage function.

Channels’ Input Resistive load options - GtDio6xSetSenseLoadResistance function.

GX5961/GX5964:

Each channel has a split Load, with independent high and low commutating voltages, the source and sink currents each have their own threshold voltage.

If the voltage on the input when the load is activated is between the two commutating voltages, the load will remain in a high impedance state.

If the voltage on the input when the load is activated is below dVComLo, the load will source the previously programmed source current.

If the voltage on the input when the load is activated is above dVComHi, the load will sink the previously programmed source current.

GX5926:

Each channel current load will provide a constant current sink when the input voltage is above the specified commutating voltage (dVComHi), and will provide a constant current source when the input voltage is below the specified commutating voltage (dVComHi). The constant current source and sink values can be set from 0mA to 24mA with 0.3662 μA of resolution.

The active load and the termination voltage mode are mutually exclusive, if the termination voltage mode was enabled (GtDio6xChannelSetTriStateTerminationVoltage API), 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.

Example

The following example sets channels 0 and 2 sense sink current to 10mA and source current to 5mA, and returns channel 0 sense load current:

 

DOUBLE dISink, dISource;

SHORT nStatus;

LONG alChannelList[2];

 

// Fill channel array

alChannelList[0] = 0;

alChannelList[1] = 2;

GtDio6xChannelSetSenseLoadCurrent(nHandle, 2, alChannelList, -10.0, 5.0, &nStatus);

 

GtDio6xChannelGetSenseLoadCurrent(nHandle, 0, &dISink, &dISource, &nStatus);

 

See Also

GtDio6xChannelSetSenseLevels, GtDio6xChannelSetSenseLoadCommutatingVoltage, GtDio6xChannelSetSenseLoadCurrent,  GtDio6xChannelSetSenseLoadResistance, GtDio6xChannelSetSenseLoadState, GtDio6xGetErrorString