Accessing waveform/measurement results, Waveforms, Measurements – Teledyne LeCroy WaveExpert series Automation Manual User Manual
Page 26
A
BOUT
A
UTOMATION
ACCESSING WAVEFORM/MEASUREMENT RESULTS
Waveforms
Waveform data is exposed by a ‘Result’ object, which appears at various places in the object hierarchy depending
upon which waveform is to be accessed. Some examples follow:
app.Acquisition.C1.Out.Result
app.Math.F1.Out.Result
app.Memory.M1.Out.Result
Waveform data is exposed as a simple array, no deciphering of proprietary binary formats is performed, as was
necessary in the past. An example of how it is used follows.
The example is coded as an Excel macro, and should be assigned to a button as described earlier. The macro
reads the number of samples in the waveform and places it in cell B1 of the Excel spreadsheet. It then reads all
available sample data values and copies them into cells in the first column of the spreadsheet (A1...Axx).
Sub
Button1_Click()
' Connect to the DSO
Set
app = CreateObject("LeCroy.XStreamDSO")
' Query the number of samples in C1 and store in cell "B1"
numSamples = app.Acquisition.C1.Out.Result.Samples
Cells(1, 2).Value = numSamples
' Access the waveform data array, and fill the first column
' of the spreadsheet with it
wave = app.Acquisition.C1.Out.Result.DataArray
For
i = 0
To
numSamples - 1
Cells(i + 1, 1).Value = wave(i)
Next
i
End
Sub
1-14
916435 RevA
N
N
O
O
T
T
E
E
:
: Ensure that the record length is < 64kSamples, since
Excel has a limit on the number of rows in a spreadsheet.
Ideally, you should start experimenting with short (500 point)
records.
Measurements
Measurement results are read in the same way as Waveforms. The following example, when copied into an Excel
macro, will enable Standard Vertical parameters. It will then transfer the eight parameter values into the
spreadsheet (cells C1…C8):
Sub
Button1_Click()
' Connect to the DSO
Set
app = CreateObject("LeCroy.XStreamDSO")
' Enable Standard Vertical Parameters
app.Measure.MeasureMode = "StdVertical"