⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basic control using instr driver.m

📁 Agilent 仪器与MATLAB互联
💻 M
字号:
% MATLAB/MXA example 2
% Using the MXA Instrument Driver 
 
% Version: 1.0
% Date: Sep 11, 2006  
% 2006 Agilent Technologies, Inc.

% Initial setup
mxa_ip = '141.121.92.157';
mxa_port = 5025;

fprintf('\nConnecting to MXA ...\n');

% MXA Interface creation and connection opening
mxa_if = tcpip(mxa_ip,mxa_port);
mxa = icdevice('agilent_mxa.mdd', mxa_if);
connect(mxa,'object')

% Intrument identification
idn = mxa.InstrumentModel;
fprintf('Hello from %s\n', idn);

% Set the center frequency to 1 GHz
mxa.CenterFreq = 1e9;
% optionally, the center frequency parameter can be
% changed using set(): set(mxa, 'CenterFreq', 1e9);

% Set the span to 20 MHz
mxa.Span = 20e6;

% Set the reference level to +10 dBm using set()
set(mxa, 'RefLevel', 10);

% Query the resolution bandwidth
rbw = mxa.ResBW;
fprintf('Resolution bandwidth: %d kHz\n', rbw/1e3);

% Query the sweep time using get()
swp = get(mxa, 'SweepTime');
fprintf('Sweep time: %d ms\n', round(swp*1000));

% Close the MXA connection and clean up
fprintf('Disconnecting from MXA ...\n');
disconnect(mxa);
delete(mxa);
clear mxa;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -