IviPwrMeter_FetchChannel

CVI/LabWindows IVI Class Driver

IviPwrMeter_FetchChannel

IviPwrMeterChannelAcquisition Capability Group

C Function Prototype

ViStatus IviPwrMeter_FetchChannel (ViSession vi, ViConstString channelName, ViReal64* reading);

Purpose

This function returns the result from a previously initiated measurement on a specified channel. Call the IviPwrMeter_Initiate function to initiate a measurement before calling this function.

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 result is in the same unit as the value of the Units attribute.

Notes:

(1) 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. You use the low-level functions to optimize one or more aspects of interaction with the instrument. If you want to check the instrument status, call the IviPwrMeter_error_query function at the conclusion of the sequence.

(2) If an out of range condition occurs, the result 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

channelName ViConstString The name of the channel from which to fetch 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.

reading ViReal64 The data read from the power meter.

Return Values