Overview of results, Variable types, Use of variants – Teledyne LeCroy WaveExpert series Automation Manual User Manual
Page 40
A
BOUT
R
ESULTS
OVERVIEW OF RESULTS
Variable Types
The examples in this section use the following standards:
•
Integer is 16 bit signed integer
•
Long is 32 bit signed integer
•
Double is 8byte floating point type
•
String is an array of characters
•
Object is a object with its own interface.
Where a variable is dimensioned without indicating a variable type, the variable is a variant.
Use of Variants
Several properties, most significantly the DataArray object, is a variant containing either a one or two dimensional
array. Dimension the target variable as a variant type, and assign the DataArray property to it. See the DataArray
property for examples of its use within each of the Result interfaces.
Using Variables to Reference Objects within the XStream Hierarchy
One way to increase the readability and simplicity of your source code is to use variables to reference objects that
are at each level of the XStream Hierarchy. For example, here is the code to readout the Sweeps property for
channel 1:
Dim numSweeps as Long
numSweeps = app.Acquisition.C1.Out.Result.Sweeps
If you are reading out more than just the Sweeps property, you might find it easier to read the following :
Dim C1Res as Object
Dim C1 as Object
Dim numSweeps as Long
Dim HorizontalOffset As Double
Dim HorizontalPerStep As Double
Dim VerticalOffset As Double
Dim VerticalPerStep As Double
Dim wform
C1 = app.Acquisition.C1
C1.AverageSweeps = 200
numSweeps = C1Res.Sweeps
HorizontalOffset = C1Res.HorizontalOffset
HorizontalPerStep = C1Res.HorizontalPerStep
VerticalOffset = C1Res.VerticalOffset
VerticalPerStep = C1Res. VerticalPerStep
2-4
916435 RevA