beautypg.com

Overview – Teledyne LeCroy WaveExpert series Automation Manual User Manual

Page 33

background image

C

HAPTER

O

NE

Overview

916435 RevA

1-21

Example 3: Script to Measure the Rise Time of the Signal on C1 and Display It in a
Popup Window

This example configures the DSO to measure the rise time of the signal on C2, take a single acquisition, and

present the results in a popup dialog. The example requires no additional software to be installed on the

instrument, since it relies on the built-in Visual Basic Script interpreter.


' VBScript example
' Configure the DSO to measure the rise time of the signal
' on Channel 1 and display it in a popup message box.

' Connect to the DSO

Set

app = CreateObject("LeCroy.XStreamDSO")

' Restore the instrument to its default state

app.SetToDefaultSetup

' Stop acquisitions during setup

app.Acquisition.TriggerMode = "Stopped"

' Turn C2 off (default state leaves C1 and C2 On)

app.Acquisition.C2.View =

False

' Configure P1=rise(C1)

app.Measure.MeasureMode = "MyMeasure"
app.Measure.P1.View =

True

app.Measure.P1.ParamEngine = "rise"

' Take a single acquisition, force after 2 seconds if it doesn't trigger

app.Acquisition.Acquire 2,

True

' Present the rise time in a popup message box

MsgBox app.Measure.P1.Out.Result.Value & "s", vbOKOnly, "Rise time of C1"

' Clean up

Set

app =

Nothing