User manual

Table Of Contents
MAUI Oscilloscopes Remote Control and Automation Manual
ValueArray
Applies to: Param
Description: Retrieves a 1D array of values, typically used to return measurement results for multi-value
parameters such as Period, Frequency, TIE@level, etc. ValueArray can also return the start time, stop
time, and status (edge polarity) of each measurement taken in the sweep.
Arguments
numSamples Long -1 = retrieve all data Number of results to be retrieved. Default is -1.
startIndex Long 0 = first result Index of the first result to be retrieved. Default is 0.
valueType Integer
(enum)
1 = parameter value
2 = measurement start time
4 = measurement stop time
8 = status value
Determines the value to read back. Default is 1. Use Status
(8) to determine if edge measurements are of positive or
negative polarity.
Example
To return multiple properties for a given parameter, set the valueType argument to the sum of the desired
properties. For example, to return both the parameter value (1) and the stop time (4), set valueType to 5.
Use the On Error Resume Next statement to handle situations where no measurements were taken. The
scope will show "---" when there is no result to read back.
Const ROWOFFSET = 16
Const COLOFFSET = 2
Dim numValues As Long
Dim startIndex As Long
Dim valueType As Integer
Dim valArray
numValues = Cells(9, 5) startIndex = Cells(10, 5)
valArray = app.measure.p1.out.Result.ValueArray(numSamples,startIndex,1)
startTimes = app.measure.p1.out.Result.ValueArray(numSamples,startIndex,2)
stopTimes = app.measure.p1.out.Result.ValueArray(numSamples,startIndex,4)
statusVals = app.measure.p1.out.Result.ValueArray(numSamples,startIndex,8)
Dim Value, Mean, Min, Max, Sdev, Num As Double
For i = 0 To UBound(valArray)
Cells(i + ROWOFFSET, COLOFFSET) = i
Cells(i + ROWOFFSET, COLOFFSET + 1) = valArray(i)
Cells(i + ROWOFFSET, COLOFFSET + 2) = startTimes(i)
Cells(i + ROWOFFSET, COLOFFSET + 3) = stopTimes(i)
Cells(i + ROWOFFSET, COLOFFSET + 4) = statusVals(i)
Next i
4-26