User manual

Table Of Contents
MAUI Oscilloscopes Remote Control and Automation Manual
Automation in Python
The oscilloscope can be controlled by Automation from applications written in the Python language.
Python programs may be designed to execute locally using COM, or remotely using either the ActiveDSO
driver or a VISA driver. See the Python example in Remote Control Program Using VISA.
You will need the Python for Windows Extensions and Python installed wherever the program is to run. If it
runs locally, the libraries must be installed on the oscilloscope; if it connects remotely, they must be
installed on the controller. The version of Python for Windows Extensions should match your version of
Python.
For remote control, you will also need an installation of ActiveDSOor a VISA driver on the controller.
With COM
COM is the most direct way to send Automation commands to the oscilloscope in Python.
Note: Any COM program should be able to run from a remote computer that has a DCOM
connection to the oscilloscope.
Connecting
The initial connection imports the win32com.client, needed for any COM Automation, and any Python
extensions to be used. It then connects to the oscilloscope application, "LeCroy.XStreamDSO," here
aliased as "h":
import win32com.client
import matplotlib.pyplot as plt
h = win32com.client.Dispatch("LeCroy.XStreamDSO")
Accessing Control Variables
The current value of any CVARs (yellow folder objects) can be read by placing the object into a variable.
This example gets the current sample period of the variable "deltat", then prints it following the string
"Sample Period":
deltat = h.Acquisition.Horizontal.TimePerPoint
print "Sample Period = ", deltat
Shortcuts can be created to simplify references to any Automation object. This gets the vertical scale of
C1, using the shortcut c1 to refer to the full object path "h.Acquisition.C1":
c1 = h.Acquisition.C1
vdiv = c1.VerScale
print "Channel 1 Volts per Division Setting = ", vdiv
To change the setup of a CVAR, set the object (or its shortcut) equal to the new value:
c1.VerScale = .1
2-50