IviScope_ReadMinMaxWaveform

CVI/LabWindows IVI Class Driver

IviScope_ReadMinMaxWaveform

IviScopeMinMaxWaveform Capability Group

C Function Prototype

ViStatus IviScope_ReadMinMaxWaveform (ViSession vi, ViConstString channel, ViInt32 waveformSize, ViInt32 maxTime, ViReal64 minWaveform[], ViReal64 maxWaveform[], ViInt32 *actualPoints, ViReal64 *initialX, ViReal64 *xIncrement);

Purpose

This function initiates a new waveform acquisition and returns minimum and maximum waveforms from a specific channel. This function is used when IVISCOPE_ATTR_ACQUISITION_TYPE is IVISCOPE_VAL_PEAK_DETECT or IVISCOPE_VAL_ENVELOPE.

The function then waits for the acquisition to complete, and returns the min/max waveforms for the specified channel. Call the IviScope_FetchMinMaxWaveform function to obtain the min/max waveforms for each of the remaining enabled channels without initiating another acquisition.

Use this function to read waveforms when the acquisition type is set to IVISCOPE_VAL_PEAK_DETECT or IVISCOPE_VAL_ENVELOPE.

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 minWaveform and maxWaveform arrays.
maxTime ViInt32 Specifies the maximum time allowed for this function to complete in milliseconds.

Defined values:
IVISCOPE_VAL_MAX_TIME_IMMEDIATE

IVISCOPE_VAL_MAX_TIME_INFINITE
     
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.

Return Values