%% MATLAB ICT Socket Control 1 % Date: 10-5-2009 % ================== % This example demonstrates how to establish a raw socket connection. Raw % socket support within MATLAB still requires the Instrument Control % Toolbox. % % TESTED & DEVELOPED % ================== % Microsoft Windows XP SP3 % MATLAB Version 7.9.0.529 (R2009b) % Instrument Control Toolbox Version 2.9 % Ethernet: DHCP % AWG5012B v3.3 % ================== % % COMPATIBILITY % ================== % All Windows based instruments with TekVISA v3.2 or later % AWG400, 500, 600, 700 % ================== % % Tektronix provides the following example "AS IS" without any guarantees % or support. This example is for instructional guidance only. %% variables ip_address = '128.181.148.46'; port = 4000; %% instrument communication % create visa interface object awg = tcpip(ip_address,port); % open the connection fopen(awg); % query instrument id % query() will automatically append a line feed character query(awg,'*idn?;') % reset instrument % fwrite() requires the addition of a line feed character fwrite(awg,['*rst;' 10]); % gracefully exit fclose(awg); %close the connection delete(awg); %delete instrument object clear awg; %clear variable