User manual

Table Of Contents
Part 2: Automation Programming Reference
Approach 2: Program in VBS
Setup (or Panel) files, which are used to save and recall the state of the instrument between sessions, are
traditionally binary files with an internal structure that is neither documented nor obvious to the user. In
MAUI oscilloscopes, however, this is not the case. Setups are ASCII text files that contain a complete
Visual Basic Script “program”. In effect, each time a panel is saved, the instrument writes a program that,
when executed, returns the instrument to the saved state.
VBS programs function like Setup files that are written and executed remotely.
Note: Customization and setup files stored by the instrument have file extension .lss
(LeCroy Setup Script). These files are syntactically identical to Microsoft VBS files, which have a
.vbs extension.
In this exercise, we'll create and execute a simple VBS program on the PC that:
l Connects to a networked oscilloscope
l Performs an AutoSetup
l Changes the oscilloscope grid mode
l Reads back the Grid Mode and Vertical Scale
l Disconnects
Preliminary Setup
1. As with Exercise 1, it is assumed there is a DCOM connection between the PC and an oscilloscope
on the same network, and that XStreamBrowser is installed on the PC.
2. On the oscilloscope, go to Utilities > Utilities Setup > Remote and confirm that the TCP/IP (VICP)
setting is selected. Note the oscilloscope's IP address.
3. Open XStreamBrowser and NotePad or another text editor on the PC.
Program
Note: Characters in angle brackets are placeholders. Omit the brackets from your code.
Connect
CreateObject is the Visual Basic function that creates an instance of a COM Server. The argument
LeCroy.XStreamDSO” refers to the oscilloscope application. Once it has instantiated (connected to) the
oscilloscope application, it requires some kind of ‘handle’ (pointer) so that it can later be used to
communicate with the instrument. CreateObject returns a handle, which is stored in the app variable.
In the text editor, write the VBS connect string:
Set app = CreateObject("LeCroy.XStreamDSO")
2-13