%% MATLAB ICT Control 1 (Hello World) % Date: 10-9-2008 % ================== % Basic program that connects to the instrument, identifies the instrument, % resets to default settings, then properly closes the connection. % % COMPATIBILITY % ================== % This example uses two standard commands, "*IDN?" and "*RST", which should % function for the majority of Tektronix instruments. Please consult the % documentation for details on available instrument commands. % ================== % % 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 % create visa interface object % use command "help visa" for details awg = visa(visa_vendor, visa_address); % open the connection fopen(awg); % query instrument id instrument = query(awg,'*idn?;') % reset instrument to default settings fwrite(awg,'*rst;'); % gracefully disconnect fclose(awg); %close the connection delete(awg); %delete instrument object clear awg; %clear MATLAB variable