Chapter 2
45
Basic Operation
Using the Programmatic Interfaces
Basic Op
er
atio
n
MATLAB Example 2, Synchronizing Two AWG Modules
MATLAB Example 2, Synchronizing Two AWG Modules
% N6030 Matlab Interface, Version 1.12
% Copyright (C) 2005 Agilent Technologies, Inc.
%
% This example initiates dual module synchronized
% waveform playback.
%
% Use agt_awg_browse to identify the modules.
%
% Create a waveform - a sine wave with 2000 pts
% Played at 1250 MHz, this will produce a tone of
% 1.250 MHz
numberOfSamples = 2000;
samples = 1:numberOfSamples;
ch1 = sin( 2 * samples/numberOfSamples * 2*pi);
ch2 = cos( 2 * samples/numberOfSamples * 2*pi);
waveform = [ ch1; ch2 ];
% Try to open a session
disp('Opening a session to the instrument');
[instrumentHandle2, errorN, errorMsg ] =
agt_awg_open('pci','PXI1::10');
if errorN ~= 0
disp(errorN);
disp(errorMsg);
disp('program stopped');
return;
else
disp('ok');
end
Artisan Technology Group - Quality Instrumentation ... Guaranteed | (888) 88-SOURCE | www.artisantg.com