GtDio6xChannelSetSenseLevels

Applies To

GX5296, GX5961, GX5964, File

Purpose

Programs the channel sense levels.

Syntax

GtDio6xChannelSetSenseLevels (nHandle, lChannelListArraySize, palChannelListArray, dVih, dVil, 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.
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.
dVih
DOUBLE
Sets the channel’s high comparator level.
GX5961/ GX5964:Input high voltage comparator, value can be -16.0V to +16.0V and higher then Input low voltage comparator.
GX5296: Input high voltage comparator, value can be -2.0V to +7.0V and higher or equal to the then Input low voltage comparator.
dVil
DOUBLE
Sets the channel’s low comparator level.
GX5961/ GX5964:Input low voltage comparator, value can be -16.0V to +16.0V and lower then Input high voltage comparator.
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 comparator, 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 comparator, 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 comparator 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 comparator 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

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

GtDio6xChannelSetPmuForcedCurrentCommutatingVoltage, GtDio6xChannelSetPmuForcedCurrent, GtDio6xChannelGetPmuForcedCurrent,  GtDio6xChannelSetMode, GtDio6xChannelGetMode, GtDio6xChannelSetPmuForcedVoltage, GtDio6xChannelGetPmuForcedVoltage, GtDio6xGetErrorString