IviPwrMeter_ReadChannel

CVI/LabWindows IVI Class Driver

IviPwrMeter_ReadChannel

IviPwrMeterChannelAcquisition Capability Group

C Function Prototype

ViStatus IviPwrMeter_ReadChannel (ViSession vi, ViConstString channelName, 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 on the specified channel.

After this function executes, the Reading parameter contains an actual reading on the channel specified by the Channel parameter. If the specified channel is not enabled for measurement, this function returns the Channel Not Enabled (0xBFFA2001) error. The Reading result is in the same unit as the value of the Units attribute.

After this function executes, the Reading parameter may contain a value indicating that an out-of-range condition occurred. If an out-of-range condition occurs, the Result 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

channelName ViConstString The name of the channel from which to read the measurement.

Pass the virtual channel name that you assign to the instrument in the Action Utility.

Virtual channel names are aliases for instrument-specific channel strings. The instrument-specific channel strings can differ from one instrument to another. Virtual channel names allow you to use and swap instruments without having to change the channel names in your source code. You assign a virtual channel name to an instrument-specific channel through the Configuration Utility. This control accepts virtual channel names you have assigned to the specific instrument you are using. It also accepts the instrument-specific channel names.

Default Value: ""

Notes: You can specify the channel name as a string variable or as a literal enclosed in double quotes.

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.

reading ViReal64 The data read from the power meter.

Return Values