SIGLENT
144 SSG5000X Programming Guide
%Create a VISA-USB object connected to a USB instrument
vu = visa(
'ni'
,
'USB0::0xF4EC::0x1501::0123456789::INSTR'
);
%Open the VISA object created
fopen(vu);
%Send the string "*IDN?",asking for the device's identification.
fprintf(vu,
'*IDN?'
);
%Request the data
outputbuffer = fscanf(vu);
disp(outputbuffer);
%Close the VISA object
fclose(vu);
delete(vu);
clear
vu
;
end
The run result
:
(2)
TCP/IP access code.
Write a function
TCP_IP_Test:
function
TCP_IP_test()
% This code demonstrates sending synchronous read & write commands
% to an TCP/IP instrument using NI-VISA
%Create a VISA-TCPIP object connected to an instrument
%configured with IP address.
vt = visa(
'ni'
,[
'TCPIP0::'
,
'10.11.11.215'
,
'::INSTR'
]);
%Open the VISA object created
fopen(vt);