User manual

Table Of Contents
Part 2: Automation Programming Reference
Automation in MATLAB
On instruments equipped with the CustomDSO (XDEV) option, MATLAB applications can use Automation
to control and exchange data with the oscilloscope application. For more information, see Lab 831: X-
Stream COM Object Programming with MATLAB and Using LeCroy Digital Oscilloscopes with MATLAB.
Note: An installation of MATLAB is required on the controller for remote execution of MATLAB
scripts. An installation of MATLAB is required both on the controller and oscilloscope when
implementing custom MATLAB math and measurements in the processing of remote control
programs. If you have a site license, the oscilloscope will occupy one seat when connected. For
individual licenses, the oscilloscope can be one of the three allowed installations.
Connecting and Disconnecting
The LeCroy-MATLAB interface is based on Active X technology and is greatly assisted by using the
ActiveDSO library. MATLAB applications use the actxserver keyword to connect to the instrument over
TCP/IP, for example:
app = actxserver('LeCroy.XstreamDSO.1', '<IP address>')
Note: Use address 127.0.0.1 when the MATLAB application accessing the oscilloscope
application is running locally on the oscilloscope, rather than remotely.
To disconnect, end with:
Set app = Nothing
Creating Object Variables
Given the complexity of MATLAB's syntax for handling multi-tiered Automation objects, it is highly
recommended to create object variables ("handles") at each level of the hierarchy. For example:
% creation of object variables 1 level down from top-level
acq = app.Object.Item('Acquisition');
math = app.Object.Item('Math');
meas = app.Object.Item('Measure');
PF = app.Object.Item('PassFail');
% creation of object variables 1 level further
c1 = acq.Object.Item('C1');
f1 = math.Object.Item('F1');
p1 = meas.Object.Item('P1');
p1Operator = p1.Object.Item('Operator')
% creation of object variables to results
c1_results = c1.Out.Result;
f1_results = f1.Out.Result;
p1_results = p1.Out.Result;
2-47