%% AWG MATLAB ICT Sequencing 1 % Date: 10-10-2008 % ================== % Demonstration of how to create a simple sequence for an Arbitrary % Waveform Generator using predefined waveforms. % % PREREQUISITE EXAMPLES % ================== % MATLAB ICT Control 1 (Hello World) % ================== % % COMPATIBILITY % ================== % AWG5000, AWG5000B, AWG7000, AWG7000B % ================== % % TESTED & DEVELOPED % ================== % Microsoft Windows XP SP2 % TekVISA 3.3.0.14 % MATLAB Version 7.6.0.324 (R2008a) % Instrument Control Toolbox Version 2.6 % Ethernet: Static IPs % AWG5012 FW 2.1 w/ TekVISA 3.3.0.14 % ================== % % Tektronix provides the following example "AS IS" without any guarantees % or support. This example is for instructional guidance only. %% variables visa_vendor = 'tek'; visa_address = 'TCPIP::192.168.0.6::INSTR'; %% instrument communication awg = visa(visa_vendor, visa_address); fopen(awg); fwrite(awg,'*rst;'); fwrite(awg,'*cls;'); % create a 4 element 1 channel sequence using predefined waveforms fwrite(awg, ':sequence:length 4;'); fwrite(awg, ':sequence:element1:waveform "*Sine960";'); fwrite(awg, ':sequence:element2:waveform "*Ramp960";'); fwrite(awg, ':sequence:element3:waveform "*Square960";'); fwrite(awg, ':sequence:element4:waveform "*Triangle960";'); % have sequence goto index 1 after playback of index 4 % without this the AWG will stop running after playback of index 4 fwrite(awg, ':sequence:element4:goto:state on;'); % set Run Mode to Sequence fwrite(awg, ':awgcontrol:rmode sequence;'); % turn on channel 1 fwrite(awg, ':output on;'); % have AWG begin playback fwrite(awg, ':awgcontrol:run;'); % gracefully disconnect fclose(awg); delete(awg); clear awg;