IviScope_ReadWaveform

CVI/LabWindows IVI Class Driver

IviScope_ReadWaveform

IviScopeBase Capability Group

C Function Prototype

ViStatus IviScope_ReadWaveform (ViSession vi, ViConstString channel, ViInt32 waveformSize, ViInt32 maxTime, ViReal64 waveform[], ViInt32 *actualPoints, ViReal64 *initialX, ViReal64 *xIncrement);

Purpose

This function initiates an acquisition on the channels that you enable with the IviScope_ConfigureChannel function. It then waits for the acquisition to complete, and returns the waveform for the channel you specify. You call the IviScope_FetchWaveform function to obtain the waveforms for each of the remaining enabled channels without initiating another acquisition.

After this function executes, each element in the waveformArray parameter is either a voltage or a value indicating that the oscilloscope could not sample a voltage.

You configure the interpolation method the oscilloscope uses with the IviScope_ConfigureInterpolation function. If interpolation is disabled, the oscilloscope does not interpolate points in the waveform. If the oscilloscope cannot sample a value for a point in the waveform, the driver sets the corresponding element in the waveformArray to an IEEE-defined NaN (Not a Number) value and the function returns IVISCOPE_WARN_INVALID_WFM_ELEMENT.

Use the IviScope_IsInvalidWfmElement function to test each element in the waveformArray parameter for an invalid waveform element.

Parameters

Inputs Type Description
vi ViSession The instrument handle that you obtain from the IviScope_init or IviScope_InitWithOptions functions. The handle identifies a particular IVI session.
channel ViConstString Name of the channel from which to read a waveform.
waveformSize ViInt32 Specifies the number of elements in the waveform array.
maxTime ViInt32 Specifies the maximum time you allow for this function to complete in milliseconds.

Defined values:
IVISCOPE_VAL_MAX_TIME_IMMEDIATE

IVISCOPE_VAL_MAX_TIME_INFINITE
     
Outputs Type Description
waveform ViReal64[] A user-allocated buffer into which the driver stores the waveform it reads. The units for the individual array elements are volts.
actualPoints ViInt32 Contains the number of points the driver actually places in the waveform array.
initialX ViReal64 Contains the time of the first point in the waveform. The value is with respect to the trigger and is in seconds. Negative values mean that the first point in the waveform array was acquired before the trigger.
xIncrement ViReal64 Contains the length of time between points in the waveform. The units are seconds.

Return Values