Waveform interface, Overview – Teledyne LeCroy WaveExpert series Automation Manual User Manual

Page 45

Advertising
background image

C

HAPTER

T

WO

Overview

Dim HorizontalPerStep As Double
Dim HorizontalOffset As Double
Dim ScaleArray As Boolean
Dim nSamples As Long
Dim startIndex As Long
Dim sparseFactor As Long
Dim XYwform

ScaleArray = Cells(9, 5)
nSamples = Cells(10, 5)
startIndex = Cells(11, 5)
sparseFactor = Cells(12, 5)
XYwform = app.Math.XY.Out.Result.DataArray '(ScaleArray, nSamples,
startIndex, sparseFactor)
HorizontalPerStep = app.Math.XY.Out.Result.HorizontalPerStep
HorizontalOffset = app.Math.XY.Out.Result.HorizontalOffset

For i = 0 To UBound(XYwform)
For j = 0 To 1
Cells(i + ROWOFFSET, COLOFFSET) = i
‘Calculate sample time
Cells(i + ROWOFFSET, COLOFFSET + 1) = HorizontalPerStep * i +
HorizontalOffset ‘Sample
Cells(i + ROWOFFSET, COLOFFSET + 2) = XYwform(i, 0) ‘X coordinate
Cells(i + ROWOFFSET, COLOFFSET + 3) = XYwform(i, 1) ‘Y coordinate
Next j
Next i

Waveform Interface:

Arguments (optional):

arrayValuesScaled as Boolean

Default value:TRUE, data is scaled
Determines whether returned values are scaled or raw. Passing TRUE indicates scaled data;

FALSE indicates raw data. Scaled values are double precision; raw values are 16-bit signed

integers. (See the properties VerticalPerStep, VerticalResolution and VerticalOffset properties for

more information)

numSamples as Long

Default value: -1, retrieve all data
Number of samples to retreived

startIndex as Long

Default value: 0, first sample
Index of the first sample to be retreived.

sparsingFactor as Long

Default value: 1, no sparsing
Determines the sparsing factor to use. For example, a sparsing factor of 5 means to retreive

every 5

th

point. (Note: Use the math function called Sparse in order to configure sparsing offset)

Example:

‘Reads values to use for DataArray arguments from a spreadsheet, and then
loops through
‘the retrieved array, saving the data to the spreadsheet along with sample
index and sample time.

916435 RevA

2-9

Advertising