Programming Guide
62
4.3 Example of MATLAB
Environment: Win7 32bit system, MATLAB R2010b
The function of this example: Use the NI-VISA, to control the device with USBTMC or
TCP/IP access to do a write and read.
Follow the steps to complete the example:
Open MATLAB, modify the current directory. In this demo, the current directory is
modified to D:\USBTMC_TCPIP_Demo.
Click File>>New>>Script in the Matlab interface to create an empty M file
Add codes:
1.1 Write a function Usbtmc_test.
function USBTMC_test()
% This code demonstrates sending synchronous read & write commands
% to an USB Test & Measurement Class (USBTMC) instrument using
% NI-VISA
%Create a VISA-USB object connected to a USB instrument
vu = visa('ni','USB0::0xF4EC::0xEE38::0123456789::INSTR');
%Open the VISA object created
fopen(vu);
%Send the string "*IDN?",asking for the device's identification.
fprintf(vu,'*IDN?');
Summary of Contents for SDG5000 series
Page 38: ...SDG5000 User Manual 27 Figure 2 5 Setting the Offset ...
Page 109: ...SDG5000 User Manual 98 Figure 3 1 Sine Waveform ...
Page 111: ...SDG5000 User Manual 100 Figure 3 2 Square Waveform ...
Page 129: ...SDG5000 User Manual 118 3 12 Figure 3 12 FSK Waveform ...
Page 135: ...SDG5000 User Manual 124 Figure 3 15 DSB AM Waveform ...