?? basic control using scpi.m
字號:
% MATLAB/MXA example 1
% A first MATLAB/MXA program using basic SCPI commands
% Version: 1.0
% Date: Sep 11, 2006
% 2006 Agilent Technologies, Inc.
% TCPIP parameters of the MXA box
mxa_ip = '141.121.92.157';
mxa_port = 5025;
% MXA Interface creation and connection opening
fprintf('\nConnecting to MXA ...\n');
mxa = tcpip(mxa_ip,mxa_port);
fopen(mxa);
% Intrument identification
idn = query(mxa,'*IDN?');
fprintf('Hello from %s', idn);
% Set the center frequency to 1 GHz
fprintf(mxa,':FREQ:CENT 1 GHz');
% Set the span to 20 MHz
fprintf(mxa,':FREQ:SPAN 20 MHz');
% Set the reference level to +10 dBm
fprintf(mxa,':DISP:WIND:TRAC:Y:RLEV 10');
% Query the resolution bandwidth using fprinf()/fgets()
fprintf(mxa,':BAND:RES?');
rbw = str2double(fgets(mxa));
fprintf('Resolution bandwidth: %d kHz\n', rbw/1e3);
% Query the sweep time using query()
swp = str2double(query(mxa,':SWE:TIME?'));
fprintf('Sweep time: %d ms\n', round(swp*1000));
% Close the MXA connection and clean up
fprintf('Disconnecting from MXA ...\n');
fclose(mxa);
delete(mxa); % delete the interface object
clear mxa; % clear from the workspace
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -