是德科技
直播中

徐铭潞

7年用户 276经验值
私信 关注
[问答]

如何从ENA到计算机获取S参数?

亲爱的先生们,拜托,您能帮助我使用SCPI命令从ENA读取S参数吗?
我尝试了很多次,但我没有成功。
我想使用matlab从ENA读取S11参数并将此数据放在工作空间(Matlab)上。
我会感激任何帮助。

以上来自于谷歌翻译


     以下为原文

  Dear Gentlemen,

Please, could you help me to read S parameters from ENA to PC using SCPI commands ? I've tried many times, but I haven't success.

I would like read S11 parameter from ENA using a Matlab and put this data on workspace (Matlab).


I'll be grateful for any help.  

回帖(11)

h1654155275.5950

2018-12-3 10:31:20
您是否看过这个示例:http://www.mathworks.com/help/instrument/examples/characterizing-a-low-noise-amplifier-by-measuring-its-s-parameters.html该示例已经过测试
PNA,但您应该能够修改它以使用ENA。
请参阅您的SCPI手册,了解仪器的确切命令。

以上来自于谷歌翻译


     以下为原文

  Have you looked at this example: http://www.mathworks.com/help/instrument/examples/characterizing-a-low-noise-amplifier-by-measuring-its-s-parameters.html

The example was tested with a PNA, but you should be able to modify it to work with the ENA. Refere to your SCPI manual for the exact commands for your instrument.
举报

郑静东

2018-12-3 10:42:34
干得好。
您可能需要使用CALC1:DATA:FDAT?
如果要读取ENA上的格式化数据。
下面是阅读复杂的数据。
%设置仪器的VISA地址字符串visaString ='GPIB0 :: 17 :: INSTR';
%创建VISA-GPIB对象。
vi = instrfind('Type','visa-gpib','RsrcName',visaString,'Tag','');
%如果不存在,则创建VISA-GPIB对象%否则使用找到的对象。
if isempty(vi)vi = visa('AGILENT',visaString);
否则fclose(vi);
vi = vi(1);
end%配置仪器对象,vi。
set(vi,'InputBufferSize',20000);
set(vi,'Timeout',100);
%连接仪器对象,vi。
的fopen(VI);
fprintf(vi,'CALC1:PAR1:DEF S11');
%将字节顺序设置为交换(little-endian)格式fprintf(vi,'FORM:BORD SWAP');
%将数据类型设置为实际的64位二进制块fprintf(vi,'FORM:DATA REAL');
%从PNA读取S2P数据。
S2P文件将返回点数* 9%数据点。
fprintf(vi,'CALC1:DATA:SDAT?');
[[data,count,msg]] = binblockread(vi,'double');
同相=数据(1:2:结束);
正交=数据(2:2:结束);
IQData =同相+ 1I *正交;
%刷新缓冲区clrdevice(vi);
%断开gpib对象。
FCLOSE(VI);
%清理所有对象。
删除(VI);

以上来自于谷歌翻译


     以下为原文

  Here you go. You may need to use CALC1:DATA:FDAT? if you want to read formatted data on the ENA. Below is reading complex data.

%Set VISA Address String for Instrument
visaString = 'GPIB0::17::INSTR';

% Create a VISA-GPIB object.
vi = instrfind('Type', 'visa-gpib', 'RsrcName', visaString, 'Tag', '');

% Create the VISA-GPIB object if it does not exist
% otherwise use the object that was found.
if isempty(vi)
vi = visa('AGILENT', visaString);
else
fclose(vi);
vi = vi(1);
end

% Configure instrument object, vi.
set(vi, 'InputBufferSize', 20000);
set(vi, 'Timeout', 100);

% Connect to instrument object, vi.
fopen(vi);

fprintf(vi,'CALC1:PAR1:DEF S11'); 

% Set byte order to swapped (little-endian) format 
fprintf(vi, 'FORM:BORD SWAP');

% Set data type to real 64 bit binary block
fprintf(vi, 'FORM:DATA REAL');

% Read S2P data back from PNA. A S2P file will return number of points * 9
% data points back.
fprintf(vi, 'CALC1:DATA:SDAT?');
[[data, count, msg]] = binblockread(vi, 'double');
inphase=data(1:2:end);
quadrature=data(2:2:end);
IQData=inphase+1i*quadrature;

% Flush the buffer
clrdevice(vi);

% Disconnect gpib object.
fclose(vi);

% Clean up all objects.
delete(vi);
举报

郑静东

2018-12-3 10:53:36
干得好。
您可能需要使用CALC1:DATA:FDAT?
如果要读取ENA上的格式化数据。
下面是阅读复杂的数据。
%设置仪器的VISA地址字符串visaString ='GPIB0 :: 17 :: INSTR';
%创建VISA-GPIB对象。
vi = instrfind('Type','visa-gpib','RsrcName',visaString,'Tag','');
%如果不存在,则创建VISA-GPIB对象%否则使用找到的对象。
if isempty(vi)vi = visa('AGILENT',visaString);
否则fclose(vi);
vi = vi(1);
end%配置仪器对象,vi。
set(vi,'InputBufferSize',20000);
set(vi,'Timeout',100);
%连接仪器对象,vi。
的fopen(VI);
fprintf(vi,'CALC1:PAR1:DEF S11');
%将字节顺序设置为交换(little-endian)格式fprintf(vi,'FORM:BORD SWAP');
%将数据类型设置为实际的64位二进制块fprintf(vi,'FORM:DATA REAL');
%从PNA读取S2P数据。
S2P文件将返回点数* 9%数据点。
fprintf(vi,'CALC1:DATA:SDAT?');
[[data,count,msg]] = binblockread(vi,'double');
同相=数据(1:2:结束);
正交=数据(2:2:结束);
IQData =同相+ 1I *正交;
%刷新缓冲区clrdevice(vi);
%断开gpib对象。
FCLOSE(VI);
%清理所有对象。
删除(VI);

以上来自于谷歌翻译


     以下为原文

  Here you go. You may need to use CALC1:DATA:FDAT? if you want to read formatted data on the ENA. Below is reading complex data.

%Set VISA Address String for Instrument
visaString = 'GPIB0::17::INSTR';

% Create a VISA-GPIB object.
vi = instrfind('Type', 'visa-gpib', 'RsrcName', visaString, 'Tag', '');

% Create the VISA-GPIB object if it does not exist
% otherwise use the object that was found.
if isempty(vi)
vi = visa('AGILENT', visaString);
else
fclose(vi);
vi = vi(1);
end

% Configure instrument object, vi.
set(vi, 'InputBufferSize', 20000);
set(vi, 'Timeout', 100);

% Connect to instrument object, vi.
fopen(vi);

fprintf(vi,'CALC1:PAR1:DEF S11'); 

% Set byte order to swapped (little-endian) format 
fprintf(vi, 'FORM:BORD SWAP');

% Set data type to real 64 bit binary block
fprintf(vi, 'FORM:DATA REAL');

% Read S2P data back from PNA. A S2P file will return number of points * 9
% data points back.
fprintf(vi, 'CALC1:DATA:SDAT?');
[[data, count, msg]] = binblockread(vi, 'double');
inphase=data(1:2:end);
quadrature=data(2:2:end);
IQData=inphase+1i*quadrature;

% Flush the buffer
clrdevice(vi);

% Disconnect gpib object.
fclose(vi);

% Clean up all objects.
delete(vi);
举报

徐铭潞

2018-12-3 11:06:19
引用: 平凡的世界12 发表于 2018-12-3 16:19
干得好。
您可能需要使用CALC1:DATA:FDAT?
如果要读取ENA上的格式化数据。

非常感谢ningchen!
您的帮助对我的硕士学位项目的发展非常重要。
当我完成这项工作后,我将在这里提出一个主题,逐步展示所做的工作。
我也会尝试在Visual C#或C ++中创建一个版本。
谢谢你的支持。

以上来自于谷歌翻译


     以下为原文

  Thank very much ningchen !

Your help  will be very important to development of my masters degree project. When I  finish the work, I will put here an topic showing step-by-step what was made.

I also will try make a version in Visual C#  or C++. Thank you by support.
举报

更多回帖

发帖
×
20
完善资料,
赚取积分