User Manual 52
EAR99 technology subject to restrictions on copyrights page.
(USBTMC) instrument.
Create a VISA-USB object to connect to the USB instrument
vu = visa ('ni', 'USB0 :: 0xF4EC :: 0x1300 :: 0123456789 :: INSTR');
fopen(vu);
fprintf(vu,'*IDN?'); outputbuffer = fscanf(vu); disp(outputbuffer);
fclose(vu); delete(vu); clear vu;
end
•
Based on the LAN port code:
Write to the TCP_IP_Test function.
function TCP_IP_test( IPstr )
% This code demonstrates using NI-VISA to send synchronous read
and write commands to a TCP / IP instrument.
% Create a VISA-TCPIP object to connect to an instrument with an IP
address configured
vt = visa('ni',['TCPIP0::',IPstr,'::INSTR']);
% Open the created VISA object
fopen(vt);
% Send the string "* IDN?" To query device information
fprintf(vt,'*IDN?');
% Request data
outputbuffer = fscanf(vt); disp(outputbuffer);
% Close the VISA object fclose(vt);
delete(vt);
clear vt;
end