User manual

Table Of Contents
Part 2: Automation Programming Reference
Automation Programming Conventions
Follow these guidelines when writing Automation programs for remote control. See Control Variables and
Result Interfaces for more information about the types and supported methods.
Variables are indicated by italicized placeholder text in the examples below.
Values
Enum, String, and Color type values must have double quotes around them, for example:
app.Display.GridMode = "Quad"
Integer, Double, DoubleLockstep, and Bool values do not require quotes:
app.Display.Persisted = false
app.Acquisition.Horizontal.NumSegments = 10
Where objects take multiple arguments, values are given in comma-delimited lists:
app.Acquisition.Acquire(5,true)
app.Acquisition.C1.LabelsText = "Hello,World"
The first Acquisition object above is a Method with both Integer and Bool type arguments; the second is a
CVAR with a multi-value String argument.
To see the correct format and syntax, query the object's current setting. This command can be sent very
easily using the WaveStudio Terminal with a remote connection to the oscilloscope:
VBS? 'return = object'
Units
Generally, units are optional when giving Automation commands, as units are already determined by the
input trace and type of any math functions applied to the trace. An exception is the Rescale math
function, which creates a second trace that explicitly changes the vertical units in which the source trace
is calculated, and therefore requires that a unit be specified:
app.Math.Fn.Equation = rescale(trace)
app.Math.Fn.Operator1Setup.Unit = "menemonic"
See the list of acceptable mnemonics in Units.
The vertical unit of analog and sensor input channels (Cn and SEn) can be changed by setting the CVAR
Unit to "Other":
app.Acquisition.Cn.Unit = "OTHER"
app.AcquisitionPMU.SEn.Unit = "OTHER"
Then, follow with the unit Type (category) and displayed Units. For example:
app.Acquisition.Cn.Type = "MASS"
app.Acquisition.Cn.Units = "SLUG"
2-43