Teledyne LeCroy USB Analyzer Automation Manual User Manual

Page 22

Advertising
background image

Teledyne LeCroy Automation API Reference Manual for USBTracer, USB Advisor, and Voyager USB Protocol
Suite

22

Example


WSH:

' Extract the script name.
ScriptName = Right(WScript.ScriptFullName, Len(WScript.ScriptFullName) -
InstrRev(WScript.ScriptFullName, "\") )

Set Analyzer = WScript.CreateObject( "CATC.UsbTracer" )

CurrentDir = Left(WScript.ScriptFullName, InstrRev(WScript.ScriptFullName, "\"))

' In the code below, we perform four sequential recordings and
' save the traces recorded in the current folder.

For I = 1 To 4

'Tell the CATC UWB analyzer to start recording.
Analyzer.StartRecording ( CurrentDir & "Input\test_ro.rec" )

' Imitation of some activity - just sleep for 3 seconds.
' Some real traffic generation code might be put here.
WScript.Sleep 3000

' Tell the analyzer to stop recording and give the trace acquired.
Set Trace = Analyzer.StopRecordingAndWaitForTrace

' Save the trace in the current folder.
Trace.Save CurrentDir & "Output\usb_seqrec_data" & CStr(I) & ".usb"
Next

Set Trace = Nothing

'Release the analyzer.
Set Analyzer = Nothing

MsgBox "Sequential recordings are completed." & String(2, 13) & "Look for recorded traces in the
folder : " & CurrentDir & "Output", 64, ScriptName

Advertising