IviScope_FetchWaveform
IviScopeBase Capability Group
C Function Prototype
ViStatus IviScope_ (ViSession vi, ViConstString channel, ViInt32 waveformSize, ViReal64 waveform[], ViInt32 *actualPoints, ViReal64 *initialX, ViReal64 *xIncrement);
Purpose
This function returns the waveform the oscilloscope acquires for the specified channel. The waveform is from a previously initiated acquisition.
Use the IviScope_InitiateAcquisition function to start an acquisition on the channels that you enable with the IviScope_ConfigureChannel function. The oscilloscope acquires waveforms for the enabled channels concurrently. Use the IviScope_AcquisitionStatus function to determine when the acquisition is complete. You must call this function separately for each enabled channel to obtain the waveforms.
You can call the IviScope_ReadWaveform function instead of the IviScope_InitiateAcquisition function. The IviScope_ReadWaveform function starts an acquisition on all enabled channels, waits for the acquisition to complete, and returns the waveform for the specified channel. You call this function to obtain the waveforms for each of the remaining channels.
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.
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. Call the IviScope_error_query function at the conclusion of the sequence to check the instrument status.
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 fetch a waveform. |
waveformSize | ViInt32 | Specifies the number of elements in the waveform array. |
Outputs | Type | Description |
waveform | ViReal64[] | A user-allocated buffer into which the acquired waveform is stored. Units for the individual array elements are in volts. |
actualPoints | ViInt32 | Number of points actually placed in the waveform array. |
initialX | ViReal64 | The time in relation to the Trigger Event of the first point in the waveform in seconds. Negative values mean that the first point in the waveform array was acquired before the Trigger Event. |
xIncrement | ViReal64 | The time between points in the acquired waveform in seconds. |