GtDio6xChannelGetSenseLevels

Applies To

GX5296, GX5961, GX5964, File

Purpose

Returns the channel pin electronic sense levels, VIH and VIL.

Syntax

GtDio6xChannelGetSenseLevels (nHandle, nChannel, pdVih, pdVil, 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.

nChannel
SHORT
Used to specify the channel to Get. This parameter is 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.
pdVih
PDOUBLE
Used to return a channel’s high comparator level.
GX5961/ GX5964:Input high voltage threshold, value can be -16.0V to +16.0V and higher then Input low voltage threshold.
GX5296: Input high voltage comparator, value can be -2.0V to +7.0V and higher or equal to the then Input low voltage comparator.
pdVil
PDOUBLE
Used to return a channel’s low comparator level.
GX5961/ GX5964:Input low voltage threshold, value can be -16.0V to +16.0V and lower then Input high voltage threshold.
GX5296: Input low voltage comparator, value can be -2.0V to +7.0V and lower or equal to the then Input high voltage comparator.
pnStatus
PSHORT
Returned status: 0 on success, negative value on failure.

Comments

The input voltage can be inside one of the following ranges:

     Input voltage is higher than high voltage threshold, input is logic high. Data will be logged as logic high to the input memory and 0 to the invalid logic level input memory.

     Input voltage is lower than low voltage threshold, input is logic low. Data will be logged as logic low to the input memory and 0 to the invalid logic level input memory.

     Input voltage is higher than low voltage threshold and lower then high voltage threshold, input is invalid. Data will be logged as logic low to the input memory and 1 to the invalid logic level input memory.

Channels input low and high threshold voltages can be read back and set dynamically at any time even while the DIO is running mode.

NOTE: dVil can only be equal or smaller than dVih (dVil<=dVih), otherwise returns an error.

Example

The following example sets channels 0 and 2 sense levels to 2.0V and -2.0v, and returns channel 0 sense levels settings:

 

DOUBLE dVih, dVil;

SHORT nStatus;

LONG alChannelList[2];

 

// Fill channel array

alChannelList[0] = 0;

alChannelList[1] = 2;

GtDio6xChannelSetSenseLevels(nHandle, 2, alChannelList, 2.0, -2.0, &nStatus);

 

GtDio6xChannelGetSenseLevels(nHandle, 0, &dVih, dVil, &nStatus);

 

See Also

GtDio6xChannelSetSenseLevels, GtDio6xChannelSetSenseLoadCommutatingVoltage, GtDio6xChannelSetSenseLoadCurrent, GtDio6xChannelSetSenseLoadResistance, GtDio6xChannelSetSenseLoadState, GtDio6xGetErrorString