Introduction to activedso, Program examples – Teledyne LeCroy X-STREAM OSCILLOSCOPES Remote Control User Manual
Page 278

A
P P E N D I X
I :
Program Examples
272
ISSUED: February 2005
WM-RCM-E Rev D
INTRODUCTION TO ACTIVEDSO
This
ActiveX
TM
control enables LeCroy oscilloscopes to be controlled by, and to exchange data with, a variety
of Windows applications that support the ActiveX standard. MS Office programs, Internet Explorer, Visual
Basic, Visual C++, Visual Java, and MATLAB (v5.3) are a few of the many applications that support ActiveX
controls. ActiveDSO is available on the internet at
With ActiveDSO you can develop your test program using standard GPIB commands. For easy integration of
your scope data with your Windows Application (through GPIB or Ethernet 10BaseT/100BaseT), ActiveDSO,
helps you:
• Generate a report by importing scope data right into Excel or Word.
• 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:
• 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.
• 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 X-Stream DSO 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