![Rigol DSG5000 Series Скачать руководство пользователя страница 131](http://html.mh-extra.com/html/rigol/dsg5000-series/dsg5000-series_programming-manual_1460929131.webp)
3. Add the following codes to the M file:
DSG5000=visa('ni','USB0::0x1AB1::0x0993::DSG5D242600001::INSTR');
%Creates the Visa object.
fopen( DSG5000 ); %Opens the visa object created.
fprintf(DSG5000,':FREQ?'); %Sends request to query the
frequency.
meas_RF_FREQ = fscanf(DSG5000); %Reads the frequency data.
fprintf(DSG5000,':LEV?' ); %Sends request to query the
amplitude.
meas_RF_LEV = fscanf(DSG5000); %Reads the amplitude data.
fclose(DSG5000); %Closes the visa object.
display(meas_RF_FREQ) %Displays the frequency read.
display(meas_RF_LEV) %Display the amplitude read.
4. Save the M file to the current path. In this example, the M file is named as
"DSG5000_Demo_MATLAB.m".
5. Run the M file and the running results are displayed as follows:
meas_RF_FREQ =
1.500 000 000 00
meas_RF_LEV =
-20.00
The results above denote that the current frequency of the microwave signal
generator is 1.5 GHz and the amplitide is -20 dBm.
5.4
LabVIEW Programming Example
Program used in this example: LabVIEW 2009
Function realized in this example:search for the instrument address, connect to the
instrument, send commands, and read return values.
1. Run LabVIEW 2009, and then create a VI file named DSG5000_Demo_LABVIEW.
2. Add controls to the front panel interface, including the Address field, Command
field, and Return field, the Connect button, the Write button, the Read button, and
the Exit button.
Programming Examples
Copyright ©RIGOL TECHNOLOGIES CO., LTD. All rights reserved.
123
Содержание DSG5000 Series
Страница 1: ......
Страница 8: ...VI Copyright RIGOL TECHNOLOGIES CO LTD All rights reserved ...
Страница 122: ...Example N A Command System 114 Copyright RIGOL TECHNOLOGIES CO LTD All rights reserved ...
Страница 144: ......