GX5296, GX5961, GX5964, File
Sets the channel sense load state.
GtDio6xChannelSetSenseLoadState (nHandle, lChannelListArraySize, palChannelListArray, nLoadState, 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. |
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.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. |
nLoadState |
PSHORT |
Used to set the channel sense load state:0. GTDIO6X_DISABLED: Disable channel load state. 1. GTDIO6X_ENABLED: Enable channel load state. |
pnStatus |
PSHORT |
Returned status: 0 on success, negative value on failure. |
The function enables all the loads to be applied to the specified input channels (constant source and the resistive load). When the load is enabled there is a ~40Ohm resistor in between the input and the loads.
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.
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.
The following example sets channels 0 and 2 load state to ON, and returns channel 0 load state:
SHORT nLoadState;
SHORT nStatus;
LONG alChannelList[2];
// Fill channel array
alChannelList[0] = 0;
alChannelList[1] = 2;
GtDio6xSetChannelLoadState(nHandle, 2, alChannelList, GTDIO6X_ENABLED, &nStatus);
GtDio6xGetChannelLoadState(nHandle, 5, &nLoadState, &nStatus);