错误使用 icinterface/fopen (line 83)
Unsuccessful open: The specified configuration: TCPIP0::169.254.0.1::inst0::INSTR is not available.
Use INSTRHWINFO for a list of available configurations. Use INSTRFIND to
determine if other instrument objects are connected to the requested instrument.
出错 S_Parameter_2 (line 20)
fopen(instrObj);
程序已经在命令最后关闭端口了,但是有时多次运行会报错。打开MATLAB有时把程序运行几次不出问题,有时运行第二次就会一直报错。尝试关掉MATLAB是可以的,但是如果我循环调用这个命令段的话,就还是要面对来解决这个问题。会的麻烦告诉一声。
顺便告知,这个是连接仪器的代码,不连仪器肯定报错。
% Define instrument VISA address. The VISA address of the instrument
% may be obtained from the instrument's user interface or your VISA
% configuration utility
clear all
clc
instrumentVISAAddress = 'TCPIP0::169.254.0.1::inst0::INSTR';
% Define frequency range of 2.3GHz to 2.6GHz
frequencyRange = [2.3e9 2.6e9];
% Number of points in measurement
numPoints = 401;
% Create a VISA connection to interface with instrument
instrObj = visa('agilent',instrumentVISAAddress);
% Set up connection parameters for transfer of measurement data from the
% instrument
instrObj.InputBufferSize = 10e6;
instrObj.ByteOrder = 'littleEndian';
% Open connection to the instrument and clear hardware buffer of instrument
fopen(instrObj);
clrdevice(instrObj);
% Display information about instrument</