Loading And Saving Vbscripts - LeCroy WaveRunner Xi series Operator's Manual

Oscilloscopes
Hide thumbs Also See for WaveRunner Xi series:
Table of Contents

Advertisement

Loading and Saving VBScripts

From the editing panel you can save your script and you can load a previous one. Should you forget to save a
script, please note that when you save your setup, it has your current scripts embedded in it. Therefore it is a
good idea to save your setup frequently. It is worth saving the script separately as well, because it is saved in a
suitable format for printing or off-line editing with Notepad. Note that in both these examples the input data are
referred to as InResult.DataArray. You can also write InResult1.DataArray and InResult2.DataArray, which refer
to the two input traces. InResult.DataArray always refers to input trace 1. These remarks hold for any script that
you write.
E
W
F
XAMPLE
AVEFORM
UNCTION
' Example script to produce a waveform
This example calculates the square of
the input waveform.
OutResult.Samples = InResult.Samples ' Visible trace length + 1
' Note that a trace of nominal length 1000 comprises data numbered from
' 0 to 1001. The 1001st point is not visible, so you
' normally use points 0 to 1000,
' giving 1001 points and 1000 intervals between points.
startData = 0
endData = OutResult.Samples
LastPoint = endData - 1 ' because the last point is invisible.
ReDim newArray(OutResult.Samples) ' to store the results
unscal
edData = InResult.DataArray(False)
' InResult.DataArray(False) provides
' integer data from -32768 to 32767.
' InResult.DataArray(True) provides real data
' in the same physical unit as the vertical scale of the input trace.
ScaleFactor = 1.0 / 32768 ' to make the trace fill the screen.
For i = 0 To LastPoint
newArray(i) = ScaleFactor * (unscaledData(i)) ^ 2
Next
OutResult.DataArray(False) = newArray ' signed long integer data output
E
P
F
XAMPLE
ARAMETER
UNCTION
' Example script to produce a parameter.
' This script calculates the root mean square
' of the input waveform.
' Note that a trace of nominal length 1000 has data from
' 0 to 1001. The 1001st point is not visible, so you
' normally use points 0 to 1000,
' giving 1001 points and 1000 intervals between points.
startData = 0
WRXi-OM-E Rev C
S
: S
CRIPT
QUARE OF A WAVEFORM
S
: RMS
CRIPT
OF A WAVEFORM
O
'
M
PERATOR
S
ANUAL
187

Advertisement

Table of Contents
loading

Table of Contents