DioSetupInputThresholdVoltages

Applies To

GX5055, GX5295, File.

Purpose

Sets the channels range input low and high threshold voltages.

Syntax

DioSetupInputThresholdVoltages (nHandle, nChannelListMode, nCountOrFirstChannel, panChannelList, nLastChannel, dHiLevel, dLoLevel, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
DIO Master handle, Slave handle or File board handle.
nChannelListMode
SHORT
Channel list mode dictates how nCountOrFirstChannel and panChannelList parameters are used. Channel list mode options are as follows:
0  DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS: The user specifies an array of channels where nCountOrFirstChannel is the number of elements in the list array and panChannelList is an array contains the channels numbers. In this mode nLastChannel is ignored.
1  DIO_CH_LIST_MODE_ALL_BOARD_CHANNELS: Apply the settings to all the board’s channels associated with this board handle. In this mode nCountOrFirstChannel, panChannelList and nLastChannel variavles are ignored.
2  DIO_CH_LIST_MODE_ALL_DOMAIN_CHANNELS: Apply the settings to all the channels in the domain, e.g. if there are two boards in the domain (Master and a Slave), then all 64 channels will be set. In this mode nCountOrFirstChannel, panChannelList and nLastChannel variavles are ignored.
3  DIO_CH_LIST_MODE_RANGE_OF_CHANNELS: Apply settings to a range of channels where nCountOrFirstChannel is the first channel number and nLastChannel is the last channel number. In this mode panChannelList variavle is ignored.
nCountOrFirstChannel
SHORT
If nChannelListMode parameter is set to DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, then it is specifying the number of elements in the panChannelList array parameter.
If nChannelListMode parameter is set to DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, then it is specifying the first channel number to apply the settings to,
otherwise it is ignored and should set to zero.
Channel number in the DIO domain, each DIO board adds 32 I/O channels. I/O channels number range is 0-991 (1 master and 30 slaves).
Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves).
panChannelList
PSHORT
Array of channels numbers. Channels numbers can be from 0 to the last channel in the domain. E.g., if the domain has two boards then the last channel is 63.
This parameter is only used if nChannelListMode parameter is set to DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, otherwise is should be passed as NULL.
Channel number in the DIO domain, each DIO board adds 32 I/O channels. I/O channels number range is 0-991 (1 master and 30 slaves).
Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves).
nLastChannel
SHORT
If nChannelListMode parameter is set to DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, then it is specifying the last channel number to apply the settings to,
otherwise it is ignored and should set to zero.
Channel number in the DIO domain, each DIO board adds 32 I/O channels. I/O channels number range is 0-991 (1 master and 30 slaves).
Gx5295: Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves).
dHiLevel
DOUBLE
GX5055:
Input high voltage threshold, voltage settings and range depends on supply rail voltages see comments for details.
GX5295:
Input high voltage threshold, value can be -2.0V to +7.0V and higher then Input low voltage threshold.
dLoLevel
DOUBLE
GX5055:
Input low voltage threshold, voltage settings and range depends on supply rail voltages see comments for details.
GX5295:
Input low voltage threshold, value can be -2.0V to +7.0V and lower then Input high voltage threshold.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

GX5055:

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

0. 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.

1. 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.

2. 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.

Min/Max threshold voltages:

 
Min
Max
dHiLevel
Low Rail Supply +2V
High Rail Supply -7V
dLoLevel
Low Rail Supply +2V
High Rail Supply -7V

 

GX5295:

The board can only save the input data for all input channels of one of the two input threshold. The user can specify the desired input threshold data to be saved by calling the DioSetupInputDataSource function.

Input data source was set to the low input threshold:

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

1. Input voltage is lower than low voltage threshold, input is logic low. Data will be logged as logic low to the input memory

Input data source was set to the high input threshold:

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

1. Input voltage is lower than high voltage threshold, input is logic low. Data will be logged as logic low to the 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.

Example

The following example uses an array of channels list to set their input high thresholds to 6.25V and input low threshold to -2.25V:

 

SHORT anChannelList[]={0, 2, 5, 7, 9, 13, 14, 27};

DioSetupInputThresholdVoltages (nHandle, DIO_CH_LIST_MODE_ARRAY_OF_CHANNELS, 8, anChannelList, 0, 6.25, -2.25, &nStatus);

The following example sets all the board’s channels input high thresholds to 6.25V and input low threshold to -2.25V:

DioSetupInputThresholdVoltages (nHandle, DIO_CH_LIST_MODE_ALL_BOARD_CHANNELS, 0, NULL , 0, 6.25, -2.25, &nStatus);

The following example sets all the boards channels input high thresholds to 6.25V and input low threshold to -2.25V:

DioSetupInputThresholdVoltages (nHandle, DIO_CH_LIST_MODE_ALL_DOMAIN_CHANNELS, 0, NULL , 0, 6.25, -2.25, &nStatus);

The following example sets channels 5 to 10 input high thresholds to 6.25V and input low threshold to -2.25V:

DioSetupInputThresholdVoltages (nHandle, DIO_CH_LIST_MODE_RANGE_OF_CHANNELS, 5, NULL, 10, 6.25, -2.25, &nStatus);

 

See Also

DioSetupInputLoadState, DioSetupInputLoadCurrent, DioSetupInputLoadResistance, DioSetupInputThresholdVoltages, DioGetErrorString