EasyManuals Logo
Home>Rigol>Test Equipment>MSO2000A Series

Rigol MSO2000A Series Programming Guide

Rigol MSO2000A Series
376 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 #369 background imageLoading...
Page #369 background image
3 Programming Demos RIGOL
MSO2000A/DS2000A 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:\MSO2000A_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
MSO2000A = visa( 'ni','USB0::0x1AB1::0x04B0::DS2A0000000000::INSTR' );
MSO2000A.InputBufferSize = 2048;
% Open the VISA object created
fopen(MSO2000A);
% Request data
[data,len]= fread(MSO2000A,2048);
% Turn off the device
fclose(MSO2000A);
delete(MSO2000A);
clear MSO2000A;
% 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);
wave = wave';
subplot(211);
plot(wave);
fftSpec = fft(wave',2048);

Table of Contents

Other manuals for Rigol MSO2000A Series

Questions and Answers:

Question and Answer IconNeed help?

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

Rigol MSO2000A Series Specifications

General IconGeneral
BrandRigol
ModelMSO2000A Series
CategoryTest Equipment
LanguageEnglish

Related product manuals