IviDmm_Fetch

CVI/LabWindows IVI Class Driver

IviDmm_Fetch

IviDmmBase Capability Group

C Function Prototype

ViStatus IviDmm_Fetch (ViSession vi, ViInt32 maxTime, ViReal64 *reading);

Purpose

This function returns the measured value from a measurement that the IviDmm_Initiate function initiates. After this function executes, the reading parameter contains an actual reading or a value indicating that an overrange condition occurred.

If an overrange condition occurs, the reading parameter contains an IEEE-defined NaN (Not a Number) value and the function returns IVIDMM_WARN_OVER_RANGE. Test the measurement value for overrange with the IviDmm_IsOverRange function.

This function does not check the instrument status. Typically, you call this function only in a sequence of calls to other low-level driver functions. The sequence performs one operation. Use the low-level functions to optimize one or more aspects of interaction with the instrument. To check the instrument status, call the IviDmm_error_query function at the conclusion of the sequence.

In most instrument classes, there is a programmatic way to determine when a measurement has completed and data is available. Therefore, a maxTime parameter is not needed in the Fetch function for these classes. This is not true for the majority of DMMs. The maxTime parameter specifies how long to wait in theIviDmm_Fetch operation because it is possible that no data is available or the trigger event did not occur.

The measurement value has the same units as the measurement type. The value of the IVIDMM_ATTR_FUNCTION attribute determines the units for the reading parameter.

Parameters

Inputs Type Description
vi ViSession The instrument handle that you obtain from the IviDmm_init or IviDmm_InitWithOptions functions. The handle identifies a particular IVI session.
maxTime ViInt32 Pass the maximum length of time in milliseconds to allow the fetch operation to complete. If the operation does not complete within this time interval, the function returns the IVIDMM_ERROR_MAX_TIME_EXCEEDED error. When this occurs, you can call IviDmm_Abort to cancel the fetch operation and return the instrument to the Idle state.

Defined Values:

IVIDMM_VAL_MAX_TIME_INFINITE—Wait indefinitely for a timeout.

IVIDMM_VAL_MAX_TIME_IMMEDIATE—Do not wait for a timeout.

     
Outputs Type Description
reading ViReal64 Returns the measured value. The value you specify for the function parameter of the IviDmm_ConfigureMeasurement function determines the units of this parameter.

Possible Units

Return Values