RIGOL
Chapter 4 Programming Examples
4-6
DG900 Programming Guide
Matlab Programming Example
Program used in this example: MATLAB R2009a
Function realized in this example: query the current waveform type as well as the waveform frequency,
amplitude, offset, and phase of CH1.
1.
Run the Matlab software and modify the current path (Current Directory). In this example, modify the
current path to E:\DG900_Demo_Matlab.
2.
Click File
New
Blank M-File in the Matlab interface to create an empty M file.
3.
Add the following codes to the M file:
DG900= visa( 'ni','USB0::0x1AB1::0x0642::DG80000000001::INSTR');
%create VISAobject
fopen(DG900 );
%open a created VISA object
fprintf(DG900, ':SOURce1:APPLy?' );
%%Send a request
query_CH1 = fscanf(DG900);
%Query data
fclose(DG900);
%close the VISA object
display(query_CH1)
%display the device information already read
4.
Save the M file to the current path. In this example, the M file is named as
"DG900_Demo_MATLAB.m".
5.
Run the M file. The running results are displayed as follows:
Summary of Contents for DG952
Page 2: ......
Page 168: ......
Page 181: ...Chapter 4 Programming Examples RIGOL DG900 Programming Guide 4 7 ...
Page 185: ...Chapter 4 Programming Examples RIGOL DG900 Programming Guide 4 11 ...
Page 187: ...Chapter 4 Programming Examples RIGOL DG900 Programming Guide 4 13 ...
Page 199: ...Chapter 4 Programming Examples RIGOL DG900 Programming Guide 4 25 ...
Page 200: ......