No BSD License  

Highlights from
Agilent's USB Modular Scope U2701A and U2702A MATLAB Programming Example

Agilent's USB Modular Scope U2701A and U2702A MATLAB Programming Example

by

 

Shows how instrument connection is made, fetching of captured data and displaying of data

U2701xSampleProgram(Manual).m
%This sample program demostrates a simple connect, fetch and display data
%in Matlab M-code. Please ensure that AgilentU2701A.mdd file in located
%inside Matlab install directory\toolbox\instrument\instrument\drivers and
%AgilentU2701A IVI driver is installed.

% Create a device object. 
% Please put in the VISA Address of connected device 
deviceObj = icdevice('AgilentU2701A.mdd', 'USB0::2391::10520::MY000000A6::0::INSTR');

% Connect device object to hardware.
connect(deviceObj);

% Set the Channel's range
set(deviceObj.Channels(1), 'Range', 8);

% Enable Channel
set(deviceObj.Channels(1), 'Enabled', 'on');

% Read data from device and plot data.
groupObj = get(deviceObj, 'Measurements');
groupObj = groupObj(1);
[waveformarray, initialx, xincrement] = invoke(groupObj, 'ReadWaveform', 10000);
data = waveformarray';
plot(data)

% Disconnect device object from hardware.
disconnect(deviceObj);

% Delete object.
delete(deviceObj);


Contact us