IviScope_FetchMinMaxWaveform
IviScopeMinMaxWaveform Capability Group
C Function Prototype
error = IviScope_FetchMinMaxWaveform (ViSession vi, ViConstString channel, ViInt32 waveformSize, ViReal64 minWaveform[], ViReal64 maxWaveform[], ViInt32 *actualPoints, ViReal64 *initialX, ViReal64 *xIncrement);
Purpose
This function fetches minimum and maximum waveforms from a previously initiated waveform acquisition. This function is used when IVISCOPE_ATTR_ACQUISITION_TYPE is IVISCOPE_VAL_PEAK_DETECT or IVISCOPE_VAL_ENVELOPE.
Use the IviScope_InitiateAcquisition function to start an acquisition on the enabled channels. The oscilloscope acquires the min/max 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 min/max waveforms.
You can call the IviScope_ReadMinMaxWaveform function instead of the IviScope_InitiateAcquisition function. The IviScope_ReadMinMaxWaveform function starts an acquisition on all enabled channels, waits for the acquisition to complete, and returns the min/max waveforms for the specified channel. You call this function to obtain the min/max 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. 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 | The name of the channel from which to read a waveform. |
waveformSize | ViInt32 | Specifies the number of elements in the minWaveform and maxWaveform arrays. |
Outputs | Type | Description |
minWaveform | ViReal64[] | A user-allocated buffer into which the min waveform is stored. |
maxWaveform | ViReal64[] | A user-allocated buffer into which the max waveform is stored. |
actualPoints | ViInt32 | Number of points actually acquired in each waveform. |
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 | The effective time between points in the acquired waveform in seconds. |