IviPwrMeter_Read

CVI/LabWindows IVI Class Driver

IviPwrMeter_Read

IviPwrMeterBase Capability Group

C Function Prototype

ViStatus IviPwrMeter_Read (ViSession vi, ViInt32 maximumTime_ms, ViReal64* reading);

Purpose

This function initiates a measurement, waits until the power meter has returned to the Idle state, and returns the result of the measurement.

After this function executes, the value of the Reading parameter depends on the math operation specified in the IviPwrMeter_ConfigureMeasurement function.

If an out of range condition occurs on one or more enabled channels, the reading is a value indicating that an out of range condition occurred. In such a case, the Reading parameter contains an IEEE defined -Inf (Negative Infinity) or +Inf (Positive Infinity) value and the function returns the Under Range (0x3FFA2001) or Over Range (0x3FFA2002) warning. Test if the measurement value is out of range with the IviPwrMeter_QueryResultRangeType function.

Parameters

Name Type Description
vi ViSession The ViSession handle that you obtain from the IviPwrMeter_init or IviPwrMeter_InitWithOptions function. The handle identifies a particular instrument session.

Default Value: None

maximumTime_ms ViInt32 Pass the maximum length of time in which to allow the read operation to complete. Express this value in milliseconds.

If the operation does not complete within this time interval, the function returns the IVIPWRMETER_ERROR_MAX_TIME_EXCEEDED (0xBFFA2020) error code. When this occurs, you can call IviPwrMeter_Abort to cancel the read operation and return the instrument to the Idle state.

Defined Values:
IVIPWRMETER_VAL_MAX_TIME_INFINITE (-1) - Wait indefinitely for a timeout.
IVIPWRMETER_VAL_MAX_TIME_IMMEDIATE (0) - Do not wait for a timeout.

Default Value: 5000

Notes:

(1) The Maximum Time parameter affects only this function. It has no effect on other timeout parameters or attributes.

(2) Some specific instrument drivers do not support the Immediate Timeout or the Infinite Timeout defined values.

reading ViReal64 Returns the measured value.

For single channel measurements, the Reading parameter contains an actual reading on the channel specified by the IviPwrMeter_ConfigureMeasurement function. The unit of the result is the same as the value of the Units attribute.

For dual channel measurements, the Reading parameter contains the result of the math operation applied to the channels specified in the IviPwrMeter_ConfigureMeasurement function. The unit of the result depends on the value of the IVIPWRMETER_ATTR_UNITS attribute and the specified operator.

For Difference and Sum operations, the resulting units is the same as the Units attribute.

For Quotient operations, the resulting units are in dB, except when Units are set to Watts. When set to Watts, the resulting measurement is without units.

Return Values