Manual

C
HAPTER
T
HREE
:
Control by LAN
WM-RCM-E Rev D ISSUED: February 2005
47
Archive measurement results on the fly in a Microsoft Access Database.
Automate tests using Visual Basic, Java, C++, Excel (VBA).
The ActiveDSO control hides the intricacies of programming and provides a simple and consistent
interface to the controlling application. With less than 10 lines of VBA (Visual Basic for Applications)
code in an Excel macro the spreadsheet can recover pre-scaled waveform data from a remote instrument.
The ActiveDSO control can also be embedded visually in any OLE automation compatible client, and can
be used manually without any need for programming. It will run on any PC running Windows 95,
Windows 98, or Windows NT.
There are two fundamental ways to use the control:
o As a visible object embedded in an OLE Automation compatible Client (PowerPoint for example)
showing a captured display image. See Embedded Control Example for more details.
o As an invisible object accessed via a scripting language (Visual Basic for Applications, for example) to
remotely control an instrument. See Accessing from VBA for more details.
VBA (Visual Basic for Applications) is the programming language built into many of the more recent
Windows applications. It is a subset of Visual Basic that makes it very simple to utilize the services of
OLE Automation Servers and ActiveX Controls.
The following VBA subroutine demonstrates how easy it is to connect to an instrument and send remote
commands to it.
Sub LeCroyDSOTest()
Dim o As Object
Set o = CreateObject("LeCroy.ActiveDSOCtrl.1")
Call o.AboutBox ' Present the control's About box
Call o.MakeConnection("IP: 172.28.11.26) 'Connect to device on LAN
Call o.WriteString("BUZZ BEEP", True) ' Make the DSO beep
End Sub
Example Syntax:
Boolean controlName.WriteString
The WriteString method has the following arguments.
Argument Description
controlname The name of the ActiveDSO control object.
textString String, Text string to send to the device.
EOI Boolean, TRUE = terminate with EOI