DioPmuGetComparatorsValues

Applies To

GX5295

Purpose

Returns the specified channel’s comparators’ high and low voltage levels settings.

Syntax

DioPmuGetComparatorsValues (nHandle, nChannel, pdHighVal, pdLowVal, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
DIO Master or Slave board handle.
nChannel
SHORT
If Board Handle was passed:
Channel number in the DIO board, each board has 32 I/O channels. I/O channels number range is 0-31.
Each DIO board has 4 Auxiliary channels. Auxiliary channels number range is 0-3.
If Master Board Handle was passed:
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).
Each DIO board adds 4 Auxiliary channels, Auxiliary channels number range is 0-123 (1 master and 30 slaves)

pdHighVal

PDOUBLE

Returned Comparators high voltage level settings.
  • If the comparators’ source was set to DIO_PMU_COMPARATORS_SOURCE_IO_VOLTAGE: I/O (0) the value is in voltages and can be between -2.V to and +7.0V and should to be less than pdHighVal.
  • If the comparators ‘source was set to DIO_PMU_COMPARATORS_SOURCE_FORCED_CURRENT: I/O (1) the value is in mA and should to be less than pdHighVal. The value should be inside the current range limits as was set by the PMU Forced Current range settings, see the DioPmuSetupForcedCurrent API for value limits.

pdLowVal

PDOUBLE
Returned Comparators low voltage level settings.
  • If the comparators’ source was set to DIO_PMU_COMPARATORS_SOURCE_IO_VOLTAGE: I/O (0) the value is in voltages and can be between -2.V to and +7.0V and should to be less than pdHighVal.
  • If the comparators ‘source was set to DIO_PMU_COMPARATORS_SOURCE_FORCED_CURRENT: I/O (1) the value is in mA and should to be less than pdHighVal. The value should be inside the current range limits as was set by the PMU Forced Current range settings, see the DioPmuSetupForcedCurrent API for value limits.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure.

Comments

Each channel’s PMU (parametric measurement unit) supports two high-speed window comparators. The PMU on-chip window comparator supports a 2-bit “go / no-go” test with a low and high threshold settings. The thresholds are set using the DioPmuSetupComparatorsValues function call.

The PMU comparator window translates the forced voltage or the forced current being sensed into an output voltage that can be compared against an upper and lower limit.

The PMU window comparator low and high outputs can be read back directly providing direct access to the actual comparator status at any time.

Example

The following example returns channel 0 comparators’ high and low voltage levels settings:

 

DUOBLE dHiVal, dLoLevel;

DioPmuGetComparatorsValues (nHandle, 0, &dHiVal, &dLoLevel, &nStatus);

 

See Also

DioPmuGetComparisonResult, DioPmuSetupComparatorsValues, DioPmuSetupComparatorsSource, DioPmuSetupForcedCurrent, DioPmuSetupForcedVoltage, DioGetErrorString