安捷伦数据采集, 回波损耗和驻波比比的频段和衰减值。请教下,红色框数据如何通过c#采集到?

安捷伦数据采集, 驻波比的频段和衰减值。请教下,红色框数据如何通过c#采集到?_百度知道
安捷伦数据采集, 驻波比的频段和衰减值。请教下,红色框数据如何通过c#采集到?
com/zhidao/wh%3D450%2C600/sign=2c0f9a05dcbdab5bc315cc.hiphotos://h.baidu://h.hiphotos://h.com/zhidao/pic/item/34a8d9c
你是说不通过任何文件或者底层接口直接从界面获取?
有的, 这个安装完驱动有自带的一个内库, 这个需要引用到程序中的, 现在就这几个数据没有取到,后面的那个取到了
那就要仔细看文档了。
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁1.功率2W,频率DC-18GHz,驻波比在1.40左右,衰减值为20dB,SMA接头的同轴衰减器,如何选择?_百度知道
1.功率2W,频率DC-18GHz,驻波比在1.40左右,衰减值为20dB,SMA接头的同轴衰减器,如何选择?
我有更好的答案
在指定的频率范围内,一种用以引入一预定衰减的电路。一般以所引入衰减的分贝数及其特性阻抗的欧姆数来标明。 在有线电视系统里广泛使用衰减器以便满足多端口对电平的要求。如放大器的输入端、输出端电平的控制、分支衰减量的控制。衰减器有无源衰减器和有源衰减器两种。有源衰减器与其他热敏元件相配合组成可变衰减器,装置在放大器内用于自动增益或斜率控制电路中。无源衰减器有固定衰减器和可调衰减器。固定衰减器由电阻组成,不影响频率特性,常用T型或π型网络组成;(有关常用75Ω阻抗T型、π型不同衰减量的电阻数据可参阅共用天线电视系统一书);可调衰减器由电位器组成在调试中及电平调整中使用。要求衰减器的输入、输出阻抗应和接口端匹配,有线电视系统里都应为75欧。衰减器的频率特性要满足系统的频...
其他类似问题
为您推荐:
您可能关注的推广
驻波比的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁安捷伦型号是N5224A
网络分析仪上接天线 电脑和仪器用网线相连 在电脑上用用哪种语言控制仪器呢 请大神赐教。
通过PC控制矢网去做测量和数据采集有SCPI和DCOM两种方式,最常用的是SCPI命令的方式。基于SCPI命令的方式,物理连接可以是GPIB电缆、USB-GPIB转接线(Agilent 82357)、USB电缆或网线,或者还可以直接把程序运行在矢网上面。基于DCOM的控制方式,物理连接只能是网线,或者把程序运行在矢网上。例如PNA Macro里面的Adaptor Characterization宏程序,就是运行在PNA上的一个基于DCOM控制的程序。下面我们探讨最常用的SCPI控制方式。第一步需要建立PC和仪器的物理连接,以及编程用的逻辑连接(从而获得仪器的逻辑地址,VISA Address)。PC上需要安装Keysight的免费程序IO Libraries Suite(),通过它可以建立程序和仪器的逻辑连接,并且它包含了程序需要引用的VISA COM组件。安装成功后,在PC桌面右下角的小三角图标展开后会看到一个IO图标。如果是用GPIB电缆、USB-GPIB转接线或USB电缆直接连接PC和矢网,仪器能够自动被搜索到,则不需要手动在IO Libraries里建立矢网的逻辑连接。这时双击PC桌面右下角包含的IO图标,打开Connection Expert程序,会看到已经建立好的仪器连接。如果是通过局域网或网线建立物理连接,仪器无法自动找到,则需要手动创建仪器的逻辑连接。先把PC和矢网连到同一局域网下或用网线直连设置近似的IP,保证可以从PC ping通矢网。然后双击PC上桌面右下角的IO图标打开Connection Expert程序,选择Add LAN Instrument,输入仪器的IP地址或机器名,测试连接,然后点OK。通过以上方式自动或手动创建了仪器的逻辑连接后,在Connection Expert程序里点击创建好的连接,就能看到该仪器获得的一个逻辑地址-VISA Address。我们在程序中需要通过这个地址和矢网通信。如果是GPIB线的连接,这个地址可能是这样:GPIB0:16:INSTR 如果是基于网线的连接,地址可能是这样:TCPIP0::a-n::inst0::INSTR下面直接上干货。注意以下都采用了二进制的读数据方法而不是ASCII码的读数方式,速度会更快。但是需要对二进制数据进行解析。Matlab中有直接的函数做解析,但是在其它程序语言里则需要自己去解析了。PNA帮助文档里有详细的二进制数据的格式说明,大家可以参考我下面的C#实例:1. 通过Matlab程序读取矢网上的s2p数据:%Set VISA Address String for InstrumentvisaString = 'GPIB1::16::0::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);elsefclose(vi);vi = vi(1);end% Configure instrument object, vi.set(vi, 'InputBufferSize', 20000);set(vi, 'Timeout', 30);% Connect to instrument object, vi.fopen(vi);% Communicating with instrument object, vi.opc_comp = query(vi, 'SYST:PRES; *OPC?', '%s\n' ,'%s');fprintf(vi, 'CALC:PAR:SEL "CH1_S11_1"');% Query selected measurement namemeas = query(vi, 'CALC:PAR:SEL?', '%s\n' ,'%s');% Set byte order to swapped (little-endian) format fprintf(vi, 'FORM:BORD SWAP');% Set data type to real 64 bit binary blockfprintf(vi, 'FORM REAL,64');% Read S2P data back from PNA. A S2P file will return number of points * 9% data points back.fprintf(vi, 'CALC:DATA:SNP? 2');[data, count, msg] = binblockread(vi, 'double');% Flush the bufferclrdevice(vi);% Disconnect gpib object.fclose(vi);% Reshape data so it is split into columnsdata_r=reshape(data, [(length(data)/9),9]);data_r=data_r';% Read frequency data back from returned datafreqs=data_r(1,:);% This assumes that the return format is in log mag, angle pairs in the S2P% fileS11mag=data_r(2,:);plot(freqs,S11mag);title('S11 mag');xlabel('Frequency');ylabel('dB');% Clean up all objects.delete(vi);2. 在C# Console Application中读取单条曲线数据(创建好工程后需要添加Visa Com Type library的引用):using Susing System.Collections.Gusing System.Lusing System.Tusing Ivi.Visa.Inamespace ReadTraceData{
class Program
static void Main(string[] args)
const int MAXPOINTS = 32001;
//read S21 data from PNA
FormattedIO488 ioDmm = new FormattedIO488Class();
ResourceManager grm = new ResourceManager();
string visaAddress = "TCPIP0::a-n::5025::SOCKET";
= (IMessage)grm.Open(visaAddress, AccessMode.NO_LOCK, 0, "");
ioDmm.WriteString("*idn?");
string result = ioDmm.ReadString();
ioDmm.WriteString("CALC:PAR:EXT 'CH1_S21_1', 'S21'");
ioDmm.WriteString("CALC:PAR:SEL 'CH1_S21_1'");
ioDmm.WriteString("CALC:PAR:SEL?");
result = ioDmm.ReadString();
ioDmm.WriteString("CALC:FORM MLOGarithmic");
//set transfer mode to binary
ioDmm.WriteString("FORMAT:DATA REAL,32", true);
ioDmm.WriteString("FORMAT:BORDER SWAPPED", true);
//set timeout to 10 seconds
ioDmm.IO.Timeout = 10000;
//=== Read the trace data into the buffer.
ioDmm.WriteString("CALC1:DATA? FDATA", true);
byte[] pound = ioDmm.IO.Read(1);
byte[] count = ioDmm.IO.Read(1);
int numToRead = int.Parse(((char)count[0]).ToString());
byte[] rawcount = ioDmm.IO.Read(numToRead);
List&char& al = new List&char&(rawcount.Length);
foreach (byte b in rawcount)
al.Add((char)b);
char[] chByteCount = (char[])al.ToArray();
int numBytes = int.Parse(new string(chByteCount));
byte[] rawTraceData = ioDmm.IO.Read(numBytes);
byte[] trailingNL = ioDmm.IO.Read(1);
int numPoints = numBytes / 4;
float[] tracedata = new float[numPoints];
int indx = 0;
int x = 0;
for (int i = 0; i & numP ++i)
tracedata[i] = BitConverter.ToSingle(rawTraceData, indx);
if (i & MAXPOINTS)
indx += 4;
ioDmm.IO.Close();
}}3. 在C# Console Application中读取s2p数据(创建好工程后需要添加Visa Com Type library的引用):using Susing System.Collections.Gusing System.Lusing System.Tusing Ivi.Visa.Iusing System.Dnamespace ReadSnp{
public class FmtIoBinaryReader
// Read binary format data from IO.
// PNA return a binary stream in order: [#][byte count of count][count][data...data...data...][end]
protected FormattedIO488 _ioD
protected ulong _lenOfDataInB
protected ulong _currentP
public ulong LenOfDataInByte
get { return _lenOfDataInB }
protected set { _lenOfDataInByte = }
public FmtIoBinaryReader(FormattedIO488 io)
_currentPos = 0;
public ulong BeginRead()
byte[] pound = _ioDmm.IO.Read(1);
byte[] count = _ioDmm.IO.Read(1);
int numToRead = int.Parse(((char)count[0]).ToString());
byte[] rawcount = _ioDmm.IO.Read(numToRead);
List&char& al = new List&char&(rawcount.Length);
foreach (byte b in rawcount)
al.Add((char)b);
char[] chByteCount = al.ToArray();
LenOfDataInByte = ulong.Parse(new string(chByteCount));
return LenOfDataInB
public bool Read(ulong len, out byte[] buff)
if (_currentPos == _lenOfDataInByte)
else if (_currentPos + len & _lenOfDataInByte)
len = _lenOfDataInByte - _currentP
buff = _ioDmm.IO.Read(Convert.ToInt32(len));
_currentPos +=
public void EndRead()
if (_currentPos &= _lenOfDataInByte)
_ioDmm.IO.Read(1);
class Program
static void Main(string[] args)
//从PNA上读取snp文件的数据。如对一个2端口测试来说,一次性读回频率、S11、S21、S12和S22的数据。
//需要注意的是,如果当前测试没有经过校准,需要把所有的测试参数都显示在PNA上,读回的数据才有值;但是如果当前测试时校准后的,即使屏幕上只显示S11曲线,通过calculate:data:snp:ports?命令也能正确读回所有S参数的数据
FormattedIO488 ioDmm = new FormattedIO488Class();
ResourceManager grm = new ResourceManager();
string visaAddress = "GPIB0::16::INSTR";
= (IMessage)grm.Open(visaAddress, AccessMode.NO_LOCK, 0, "");
//将超时的时间设为20秒
ioDmm.IO.Timeout = 20000;
ioDmm.WriteString("trigger:sequence:source immediate");
//设置为单次扫描,然后进入Hold状态
ioDmm.WriteString("sense:sweep:mode single");
ioDmm.WriteString("*OPC", true);
//读扫描点数
ioDmm.WriteString("sense:sweep:points?");
string s = ioDmm.ReadString().TrimEnd('\n').Trim('\"');
int sweepPoints = Convert.ToInt32(s);
//设置二进制读取方式
ioDmm.WriteString("format:data real,64");
ioDmm.WriteString("format:border swapped");
//将读回的snp数据格式设为LogMag和Phase
ioDmm.WriteString("mmemory:store:trace:format:snp DB");
//获取当前测量
ioDmm.WriteString("calculate:parameter:catalog?");
s = ioDmm.ReadString().TrimEnd('\n').Trim('\"');
string[] meas = s.Split(',');
string command = string.Format("calculate:parameter:select '{0}'", meas[0]);
ioDmm.WriteString(command);
//开始读取snp数据,"1,2"参数表示读取s2p数据
ioDmm.WriteString("calculate:data:snp:ports? \"1,2\"");
FmtIoBinaryReader reader = new FmtIoBinaryReader(ioDmm);
ulong numBytes = reader.BeginRead();
int sizeOfDouble = sizeof(double);
Debug.Assert(numBytes == Convert.ToUInt64((1 + 2 * 2 * 2) * sweepPoints * sizeOfDouble));
// 读取频率数据
ulong len = Convert.ToUInt64(sweepPoints * sizeOfDouble);
byte[] byteFreq =
reader.Read(len, out byteFreq);
double[] freq = new double[sweepPoints];
int startIndex = 0;
for (int i = 0; i & sweepP ++i)
freq[i] = BitConverter.ToDouble(byteFreq, startIndex);
startIndex += sizeOfD
//此处保存频率数据
// 读取S参数数据,对2端口数据而言,参数顺序为S11, S21, S12, S22
for (int i = 0; i & 2 * 2; ++i)
ulong len = Convert.ToUInt64(sweepPoints * sizeOfDouble * 2);
byte[] byteSparameter =
reader.Read(len, out byteSparameter);
int points = sweepPoints * 2;
double[] sparam = new double[points];
int startIndex = 0;
for (int j = 0; j & ++j)
sparam[j] = BitConverter.ToDouble(byteSparameter, startIndex);
startIndex += sizeOfD
//此处保存读到的S参数数据。注意对每个S参数数组来说,前半部分是LogMag数据,后半部分是相位的数据
reader.EndRead();
ioDmm.IO.Close();
先安装一个叫NI-VISA的软件。这个软件是National Instrument的,完全免费。&br&用编程语言操作仪表的方式类似读写文件,下面以Matlab为例来说。&br&连接仪器的方式有通过GPIB口,LAN口等多种可能,一般Keysight或RS提供的测量方案代码中都会把所有的情况一一考虑进去,不过自己做实验用的话一种方式就够了。通过LAN口连接仪表的方式为(IP地址请自己设置):&br&&div class=&highlight&&&pre&&code class=&language-text&&pna = visa('ni', 'TCPIP::192.168.100.11::INSTR');
fopen(pna);
&/code&&/pre&&/div&常用的函数有两个,一个是fwrite,一个是query。我的理解,query相当于write and read,给仪器写入指令并且给出一个返回值,例如:&br&&div class=&highlight&&&pre&&code class=&language-text&&cal_set_name_list = query(pna, 'CSET:CAT?');
&/code&&/pre&&/div&这个会返回仪器上当前的校准文件列表。&br&我觉得相对比较复杂的命令式保存数据文件,下面的代码把当前网络的S值保存在一个CSV文件中:&br&&div class=&highlight&&&pre&&code class=&language-text&&data_file_name = sprintf('%s_%s.csv', path, scene);
data_file_type = 'CSV Formatted Data';
data_file_scope = 'Displayed';
data_file_format = 'DB';
save_file_command = sprintf('MMEMory:STORe:DATA &%s&, &%s&, &%s&, &%s&, 1', data_file_name, data_file_type, data_file_scope, data_file_format);
fwrite(pna, save_file_command);
&/code&&/pre&&/div&关闭连接&br&&div class=&highlight&&&pre&&code class=&language-text&&fclose(pna);
&/code&&/pre&&/div&其余的指令请参考帮助手册&br&&img src=&/52a50c712ee2ce75bfe13_b.jpg& data-rawwidth=&1177& data-rawheight=&661& class=&origin_image zh-lightbox-thumb& width=&1177& data-original=&/52a50c712ee2ce75bfe13_r.jpg&&手册上说的不清楚的,自己试试就明白了。&br&&br&另外:安装NI-VISA之后,再安装一个python的库py-visa就可以实现用python控制仪表了,详见地址&a href=&///?target=http%3A//pyvisa-py.readthedocs.io/en/latest/& class=& wrap external& target=&_blank& rel=&nofollow noreferrer&&PyVISA-py: Pure Python backend for PyVISA&i class=&icon-external&&&/i&&/a&,用法和Matlab类似,不赘述。
先安装一个叫NI-VISA的软件。这个软件是National Instrument的,完全免费。用编程语言操作仪表的方式类似读写文件,下面以Matlab为例来说。连接仪器的方式有通过GPIB口,LAN口等多种可能,一般Keysight或RS提供的测量方案代码中都会把所有的情况一一考虑进…
已有帐号?
无法登录?
社交帐号登录

我要回帖

更多关于 安捷伦衰减器 的文章

 

随机推荐