EasyManuals Logo
Home>Rigol>Test Equipment>DS2000E Series

Rigol DS2000E Series Programming Guide

Rigol DS2000E Series
365 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #357 background imageLoading...
Page #357 background image
3 Programming Demos RIGOL
DS2000E Programming Guide
3-11
MATLAB Programming Demo
The program used in this demo: MATLAB R2009a
The function realized in this demo: make FFT operation on the waveform data and draw the
waveform.
1. Run the MATLAB software and modify the current directory (namely modify the Current Directory
at the top of the software). In this demo, the current directory is modified to
D:\DS2000E_Demo\MATLAB.
2. Click File  New  Blank M-File in the MATLAB interface to create an empty M file. Add the
following codes in the M file:
% Create VISA object . 'ni' is the saler Parameter and can be agilent, NI or tek.
'USB0::0x1AB1::0x04B0::DS2A0000000000::INSTR' is the device resource descriptor. You need to
set the device property. In this demo, set the length of the input buffer to 2048
DS2000E = visa( 'ni','USB0::0x1AB1::0x04B0::DS2A0000000000::INSTR' );
DS2000E.InputBufferSize = 2048;
% Open the VISA object created
fopen(DS2000E);
% Read waveform
fprintf(DS2000E, ':wav:data?' );
% Request data
[data,len]= fread(DS2000E,2048);
% Turn off the device
fclose(DS2000E);
delete(DS2000E);
clear DS2000E;
% Data processing. The waveform data read contains the TMC header. The length of the header is 11
bytes; wherein, the first 2 bytes are the TMC header denoter (#) and the width descriptor (9)
respectively, the 9 bytes following are the length of the data which is followed by the waveform data
and the last byte is the terminator (0x0A). Therefore, the effective waveform points read is from the
12nd to the next to last.
wave = data(12:len-1);

Table of Contents

Other manuals for Rigol DS2000E Series

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Rigol DS2000E Series and is the answer not in the manual?

Rigol DS2000E Series Specifications

General IconGeneral
BrandRigol
ModelDS2000E Series
CategoryTest Equipment
LanguageEnglish

Related product manuals