1
完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨!
我写了一个matlab程序来远程从VNA获取S参数。 是否可以从网络分析仪获取数据为。* S2P格式? 是否有任何命令列表进行此类编程? 谢谢。 以上来自于谷歌翻译 以下为原文 Hi! I wrote a matlab Programm to remotely get the S-Parameter from the VNA. is it possible to get the Data as .*S2P format from the network analyzer? is there any command List to make such programming? Thank you. |
|
相关推荐
9个回答
|
|
> {quote:title = hfler写道:} {quote}>嗨!
>>我写了一个matlab程序来远程从VNA获取S参数。 是否可以从网络分析仪获取数据为。* S2P格式? 没有。是否有任何命令列表进行这样的编程? 有一个8722D的编程手册,您可以从安捷伦网站下载该手册。 没有命令直接从8722D获取touchstone文件。 由于您已经拥有了获取S参数的代码,因此将其转换为touchstone文件非常简单。 如果你看一下.s2p文件的Touchstone规范http://www.eda.org/pub/ibis/connector/touchstone_spec11.pdf,它非常简单。 我向你指出1.1草案规范。 有一个2.0已经达成一致,但我认为草案格式比更新格式更多。 看看下面这个。 这是我为8720D(2022版本的8722D)编写的Touchstone文件的开头。 以感叹号开头的每一行都是注释,因此不需要。 我把它们放在一起,因为我觉得它们对我有用 - 不是因为它们是必要的。 您需要的唯一线路是以****开头的线路。 #MHz S DB R 50和9列数据,由空格隔开。 事实上,从****开始的行可以简化。 默认情况下假定为“R 50”。 (这个论坛似乎不支持****字符,除非它被转义,所以我已经这样做了。为了避免任何混淆,我附上了我创建的文件。如果你想要* C *代码我曾经 得到这些数据我可以给你。但我写的从8720D获取数据的整个代码都是为Unix系统编写的,并假设是National Instruments GPIB板。我没有使用MATLAB,Labview或类似的但只是写了 在阅读编程手册的基础上编写自己的C代码。如果你只看一下HP编程手册,你就不会感到困惑了。我用粗体添加了我用来获得前9行的GPIB命令,但正如我所说, 这不是实际需要的。!这是一个试金石格式文件。!它应该以.s2p扩展名保存!HEWLETT PACKARD,8720D,0,7.74 * IDN?*!日期= 2013年1月22日* READDATE *!时间= 20 :43:52 * READTIME *!启动频率= 0.050000000 GHz * START?*!停止频率= 6.000000000 GHz * STOP?*!IF带宽= 300 Hz * IFBW?*!Averaging = ON * AVER 哦?*! 平均因子= 4 * AVERFACT?*! 端口扩展= OFF * PORE?*! 端口扩展1 = 0.000000 ps! 端口扩展2 = 0.000000 ps! 积分= 1601! 校准套件=用户自定义! 校准=全2端口! freq magS11 angS11 magS21 angS21 magS12 angS12 magS22 angS22! 记录形式的大小! 角度为度#MHz S DB R 50 50 -54.7578 -38.0391 -19.9482 -3.05701 -19.9355 -3.04468 -54.0156 -11.9438 53.7188 -53.9004 -27.2373 -19.9219 -3.19849 -19.9219 -3.2959 -52.7207 -12.2417 57.4375 -52.9434 -29.2256 -19.9248 -3.34265 -19.9209 -3.46069 -52.6055 -12.7515 61.1562 -52.5938 -27.0869 -19.9209 -3.71887 -19.9199 -3.7533 -52.2812 -8.5625 64.875 -52.5664 -22.415 -19.9346 -3.80676 -19.9375 -3.90979 -52.709 -7.354 68.5938 -51.9395 - 21.7559 -19.9287 -4.06787 -19.9463 -4.23804 -52.3848 -5.18701 DaveEdited:drkirkby on February 6,2013 12:04 AM 以上来自于谷歌翻译 以下为原文 > {quote:title=hfler wrote:}{quote} > Hi! > > I wrote a matlab Programm to remotely get the S-Parameter from the VNA. is it possible to get the Data as .*S2P format from the network analyzer? No. > is there any command List to make such programming? There is a programming manual for the 8722D, which you should be able to download from the Agilent web site. There is no command to get a touchstone file directly from an 8722D. Since you already have the code to get the S-parameters, it is trivial to convert that into a touchstone file. If you look at the Touchstone specification for .s2p files http://www.eda.org/pub/ibis/connector/touchstone_spec11.pdf it is *very* simple. I pointed you to the 1.1 draft specification. There is a 2.0 which has been agreed, but I think there is more support for the draft format than the updated one. Take a look at this below. This is the start of a Touchstone file I wrote for my 8720D (the 20 GHz version of the 8722D). Every line starting with an exclamation mark is a comment, so is not needed. I put them since I thought they were useful to me - not because they are necessary. The only lines you need are one starting with a ****. # MHz S DB R 50 and 9 columns of data which are sepparated by a space. In fact, that the line starting with the **** could be simplified. The "R 50" is assumed by default. (This forum does not appear to support the **** character unless it is escaped, so I've done that. To avoid any confusion, I have attached the file I created. If you want the *C* code I used to get this data I can give it to you. But the whole code I wrote to get data from my 8720D is written for a Unix system, and assumes the National Instruments GPIB board. I did not use MATLAB, Labview or similar but just wrote the code myself in C based on reading the programming manual. It will be less confusing for you if you just look at the HP programming manual. I have added in bold the GPIB commands I used to get the first 9 lines, but as I say, none of this is actually required. ! This is a touchstone format file. ! It should be saved with .s2p extension ! HEWLETT PACKARD,8720D,0,7.74 *IDN?* ! Date = 22 Jan 2013 *READDATE* ! Time = 20:43:52 *READTIME* ! Start frequency = 0.050000000 GHz *START?* ! Stop frequency = 6.000000000 GHz *STOP?* ! IF bandwidth = 300 Hz *IFBW?* ! Averaging = ON *AVERO?* ! Averaging factor = 4 *AVERFACT?* ! Port extensions = OFF *PORE?* ! Port extension 1 = 0.000000 ps ! Port extension 2 = 0.000000 ps ! Points = 1601 ! Calibration kit = User-defined ! Calibration = Full 2-port ! freq magS11 angS11 magS21 angS21 magS12 angS12 magS22 angS22 ! Magnitudes are in log form ! Angles are in degrees # MHz S DB R 50 50 -54.7578 -38.0391 -19.9482 -3.05701 -19.9355 -3.04468 -54.0156 -11.9438 53.7188 -53.9004 -27.2373 -19.9219 -3.19849 -19.9219 -3.2959 -52.7207 -12.2417 57.4375 -52.9434 -29.2256 -19.9248 -3.34265 -19.9209 -3.46069 -52.6055 -12.7515 61.1562 -52.5938 -27.0869 -19.9209 -3.71887 -19.9199 -3.7533 -52.2812 -8.5625 64.875 -52.5664 -22.415 -19.9346 -3.80676 -19.9375 -3.90979 -52.709 -7.354 68.5938 -51.9395 -21.7559 -19.9287 -4.06787 -19.9463 -4.23804 -52.3848 -5.18701 Dave Edited by: drkirkby on Feb 6, 2013 12:04 AM 附件
|
|
|
|
60user7 发表于 2019-4-24 20:05 这非常有帮助。 谢谢。 我还有一个问题。 我想在运动下测量某些产品的S参数。 有没有办法测量多个扫描(3到4GHz,201点)。 我的意思是VNA应该测量一段时间(例如1分钟)。 你有没有想过VNA需要多少时间进行一次扫描(3GHz到4GHz 201点)? 如果你需要,我可以给你发送matlab代码。 我想在代码中构建一个循环。 但我不确定是否真的谢谢你的帮助 以上来自于谷歌翻译 以下为原文 it is very helpful . thank you. i have one more question. I want to measure the S- parameter of some product under movment. is there any way to measure more than one sweep(3 to 4GHz, 201points). I mean the VNA should measure for a period of time (1 min for exemple). do you have ny idea how much time does VNA need to make one sweep (3GHz to 4GHz 201 points)? I could send you the matlab code if you need it. i thout about buildin a loop in the code. but i am not sure if is it true thank you for your help |
|
|
|
您好我写了这个matlab函数来获取网络分析仪的测量数据。 %function [varargout] = HP8722(varargin)g = instrfind('Type','gpib','BoardIndex',32,'PrimaryAddress',26,'Tag',''); if isempty(g)g = gpib('AGILENT',32,26); 否则fclose(g); g = g(1); 结束g.inputbuffersize = 500000; g.timeout = 300; %连接到仪器对象obj1。 的fopen(克); fprintf中的(g, 'STAR?'); sfreq = str2num(的fscanf(克)); fprintf中的(g, '停止?'); stfreq = str2num(的fscanf(克)); fprintf中的(g, 'POIN?'); NOF = str2num(的fscanf(克)); fprintf(g,'S21')fprintf(g,'chan1,smic')fprintf(g,'REST')fprintf(g,'OUTPFORM'); 数据=的fread(克,2 * NOF + 1, '浮动'); data = [] data = [data(1:2:2 * nof-1)+ j * data(2:2:2 * nof)]。'; FREQ = sfreq:(stfreq-sfreq)/(NOF-1):stfreq; fprintf(g,'OPC?,WAIT')varargout {1} = data; varargout {2} =频率; 谢谢 以上来自于谷歌翻译 以下为原文 Hi i wrote this matlab function to get the measurement data fro the network analyzer. % function [varargout]=HP8722(varargin) g = instrfind('Type', 'gpib', 'BoardIndex', 32, 'PrimaryAddress', 26, 'Tag', ''); if isempty(g) g = gpib('AGILENT', 32, 26); else fclose(g); g = g(1); end g.inputbuffersize=500000; g.timeout=300; % Connect to instrument object, obj1. fopen(g); fprintf(g,'STAR?'); sfreq=str2num(fscanf(g)); fprintf(g,'STOP?'); stfreq=str2num(fscanf(g)); fprintf(g,'POIN?'); nof=str2num(fscanf(g)); fprintf(g,'S21') fprintf(g,'chan1,smic') fprintf(g,'REST') fprintf(g,'OUTPFORM'); data=fread(g,2*nof+1,'float'); data=[] data=[data(1:2:2*nof-1)+j*data(2:2:2*nof)].'; freq=sfreq:(stfreq-sfreq)/(nof-1):stfreq; fprintf(g,'OPC?,WAIT') varargout{1}=data; varargout{2}=freq; thank you |
|
|
|
nnmnnm 发表于 2019-4-24 20:35 在我打电话给你发布的最后一个Matlab函数的时候,我觉得你有8722继续扫描。 在这种情况下,您收集的数据可能是一次扫描的一部分,也可能是另一次扫描的一部分,因为当您的函数执行时,分析器可能处于扫描中。 我建议你更换这一行:fprintf(g,'REST'); 有了这个(如果我正确地解释了Matlab语法,我通常不用Matlab编程):fprintf(g,'OPC ?; SING'); 的fscanf(克); 这将确保分析仪在为您输出数据时进行单次扫描并保持扫描状态。 如果你希望你的功能让分析仪连续扫描,我想你会在你的功能结束时添加这一行:fprintf(g,'CONT'); 以上来自于谷歌翻译 以下为原文 It looks to me like you have your 8722 continuing to sweep while you call that last Matlab function you posted. In that case, the data you are gathering could be part from one sweep and part from another because the analyzer may be in mid-sweep when your function executes. I would recommend you replace this line: fprintf(g,'REST'); with this (if I am interpreting the Matlab syntax correctly, I don't normally program in Matlab): fprintf(g,'OPC?;SING'); fscanf(g); That will ensure the analyzer takes a single sweep and holds from sweeping while it outputs the data for you. If you want your function to leave the analyzer continuous sweeping, I think you'd add this line at the end of your function: fprintf(g,'CONT'); |
|
|
|
uwyywefwd 发表于 2019-4-24 20:51 谢谢你的回答和评论。 我读到VNA能够进行多次扫描,当扫描具有不同的点数时也是如此。 这没有触发。 你有什么想法吗? 谢谢 以上来自于谷歌翻译 以下为原文 tthank you for the answer and remark. I read that the VNA able to make more than one sweep, also when the sweep have different number of point. And this without triggering. do you have any idea abou this? thank you |
|
|
|
|
|
|
|
Bokkhan,谢谢你的回复。
我还想到了构建循环的可能性。 但我不知道我应该在代码中启动循环。 mybe你对我有个想法。 谢谢,我非常感谢这个论坛 以上来自于谷歌翻译 以下为原文 Bokkhan,Thank your reply. I thought also about the possibilty of building a loop. But i dont know where i should start the loop in the code. mybe you have an idea for me. Thank you, and i big thank for this forum |
|
|
|
> {quote:title = hfler写道:} {quote}>这是非常有帮助的。 谢谢。 没问题。 这通常是一个非常有用的论坛 - 很多人帮助了我。 >我还有一个问题。 我想在运动下测量某些产品的S参数。 有没有办法测量多个扫描(3到4GHz,201点)。 我的意思是VNA应该测量一段时间(例如1分钟)。 您是否打算在连接电缆的情况下移动DUT,或者移除电缆,移动DUT,然后重新连接电缆? 如果是前者,我会非常关心移动它们对电缆的影响。 我总是尽量减少校准和测量之间的电缆移动。 在连接电缆的情况下移动DUT的想法让我充满了热情。 我认为8722D的2.4毫米测试端口电缆与我的8720D的3.5毫米测试端口电缆一样昂贵,甚至可能更昂贵,因此使用它们并不是很好,除非你的预算几乎无限。 >你知道VNA需要花多少时间进行一次扫描(3GHz到4GHz 201点)? 它肯定取决于IF带宽和任何平均值。 它可能取决于仪器所具有的CPU速度,就像8720D一样,至少使用了两种不同的CPU,其中一种比另一种快。 >如果你需要,我可以给你发送matlab代码。 我认为不需要它。 >我想在代码中构建一个循环。 但我不确定是否真的这取决于你是否打算拆除电缆。 我相信8720D,我认为8722D,能够通过脚踏开关或类似设备进行外部触发。 这可能比带有dely的循环更好。 我宁愿怀疑你的VNA和DUT之间的电缆在S-paramterms上会比你的DUT有更多的变化。 >谢谢你的帮助没问题,戴夫 以上来自于谷歌翻译 以下为原文 > {quote:title=hfler wrote:}{quote} > it is very helpful . thank you. No problem. This is generally a very helpful forum - lots of people have helped me. > i have one more question. I want to measure the S- parameter of some product under movment. is there any way to measure more than one sweep(3 to 4GHz, 201points). I mean the VNA should measure for a period of time (1 min for exemple). Do you intend moving the DUT with the cables connected, or removing cables, moving the DUT, then reconnecting the cables? If the former, I'd be very concerned about the effect on the cables of moving them. I always try to minimise the cable movement between calibration and measurement. The idea of moving a DUT with the cables connected fills me with horor. I assume the 2.4 mm test port cables for the 8722D are as expensive, or probably even more expensive than the 3.5 mm test port cables for my 8720D, so using them would not be very good unless you have an almost infinite budget. > do you have ny idea how much time does VNA need to make one sweep (3GHz to 4GHz 201 points)? It would certainly depend on the IF bandwidth and any averaging. It might depend on the speed of the CPU the instrument has too, as perhaps like the 8720D, there at least two different CPUs used, with one being faster than the other. > I could send you the matlab code if you need it. I pesonally do not need it. > i thout about buildin a loop in the code. but i am not sure if is it true It depends on whether you intend removing the cables. I believe the 8720D, and I assume 8722D, has the ability to do an external trigger from a foot switch or similar. That might be better than a loop with a dely. I rather suspect the cables between your VNA and the DUT will exhibit more change in S-paramterms than your DUT. > thank you for your help No problem, Dave |
|
|
|
嗨! 我想测量由微带天线辐射的产品(在mouvement中)的S11参数。 天线和电缆是静态的。 只是产品会移动,这个大约需要1分钟。 产品的组合也是changig,这就是为什么我要测量S11(变化!)再次谢谢你! 以上来自于谷歌翻译 以下为原文 hi ! i want to measure the S11 parameter of a product (in mouvement) radiated by a microstrip antenna. the antenna and cable are static . just the product will move, and this mouvement take about 1 minute. the compositon of the Product is also changig, that is why i want to measure the S11 (variation!) thank you again! |
|
|
|
只有小组成员才能发言,加入小组>>
1285 浏览 0 评论
2373 浏览 1 评论
2192 浏览 1 评论
2064 浏览 5 评论
2948 浏览 3 评论
1105浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
752浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
923浏览 0评论
1285浏览 0评论
小黑屋| 手机版| Archiver| 德赢Vwin官网 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-23 06:52 , Processed in 1.407035 second(s), Total 62, Slave 56 queries .
Powered by 德赢Vwin官网 网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
德赢Vwin官网 观察
版权所有 © 湖南华秋数字科技有限公司
德赢Vwin官网 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号