GxDmmReadEx

Purpose

Returns a result from measurement that has already occurred, with additional information

Syntax

GxDmmReadEx (nHandle, pdMeasurement, szMeasurement, szUnits, pddwTime, pnStatus)

Parameters

Name
Type
Comments
nHandle
SHORT
Handle for a GX2065 board.
pdMeasurement
PDOUBLE
Return the measurement
pszMeausrement
PSTR
Returns a string containing the formatted and normalized result.
pszUnits
PSTR
Returns a string containing the units of the result
pddwTime
PDDWORD
Returns the timestamp of the result in terms of nanoseconds. The time is synced with the PC’s clock.
pnStatus
PSHORT
Returned status: 0 on success, negative number on failure, positive number on warning.

Comments

This function reads back the result from a measurement that has already occurred. The result is returned in two parameters, pdMeasurement, and pszMeasurement. The first parameter, pdMeasurement, returns the result without normalizing, in base units. For example, Voltage will be returned as Volts, Current will be returned as Amps, Resistance will be returned as Ohms, Temperature will be returned as degrees Celsius, and Frequency will be returned as Hertz. The second parameter, pszMeasurement, returns the measurement as a formatted string containing the normalized result. The normalized result uses units that reflect the magnitude of the result as well as the resolution of the measurement. For example, 0.0312356789 Amps, measured in 100mA Range, and using 6 and a1/2 digits of resolution, will be returned as “31.2356” Milliamps. In this case, pszUnits will return the units as “mA”.

Note that this function does not initiate a new measurement. To initiate a new single reading through software, call GxDmmMeasure, GxDmmMeasureEx, or GxDmmTrig.

The parameter pdMeasurement will be set to 0 if an error occurs.

If an overflow warning (GXDMM_WARNING_OVERFLOW) has occurred, pdMeasurement will be set to GXDMM_OVERFLOW_MEASUREMENT (1000000000000).

If any other warning occurs, pdMeasurement will be set to 0.

Example

The following reads a measurement that has already occurred, with additional information:

 

SHORT nHandle, nStatus;

DOUBLE dMeasurement;

CHAR szMeasurement[256], szUnits[10];

DDWORD ddwTime;

 

GxDmmReadEx (nHandle, &dMeasurement, szMeasurement, szUnits, &ddwTime, &nStatus);

 

See Also

GxDmmRead, GxDmmMeasure, GxDmmMeasureEx, GxDmmSetTriggerMode, GxDmmGetTriggerMode, GxDmmSetRange, GxDmmGetRange, GxDmmSetFunction, GxDmmGetFunction, GxDmmGetErrorString