完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
您好,我正在寻找将PNA(例如:N5222A)中的s2p文件传输到连接的PC中。
我的问题是“MMEM:TRAN?使用s2p文件?如果确实如此,那么使用签证命令和GPIB传输文件的正确语法是什么。谢谢。 以上来自于谷歌翻译 以下为原文 Hello, I am looking to transfer the s2p files from a PNA (eg: N5222A) into the connected PC. My question is does "MMEM:TRAN? work with s2p files? If it does then what is the right syntax to transfer the files using visa commands and through a GPIB. Thank You. |
|
相关推荐
6个回答
|
|
从在线帮助(在线交互式手册):http://na.tm.agilent.com/pna/help/latest/help.htm导航至:programming-> scpi-> commands-> memory-> TRANsfer(或者
链接:http://na.tm.agilent.com/pna/help/latest/Programming/GP-IB_Command_Finder/Memory.htm#Transfer)在该部分中,有一个示例程序的链接,该程序将文件传入和传出文件。 PC和PNA(s2p文件)。 以下是该示例的直接链接:http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm 以上来自于谷歌翻译 以下为原文 From the online help (interactive manual online): http://na.tm.agilent.com/pna/help/latest/help.htm Navigate to: programming->scpi->commands->memory->TRANsfer (or this link: http://na.tm.agilent.com/pna/help/latest/Programming/GP-IB_Command_Finder/Memory.htm#Transfer) In that section there's a link to an example program that transfers a file to and from a PC and a PNA (a s2p file). Here's the direct link for the example: http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm |
|
|
|
btywyrww 发表于 2018-12-28 06:17 谢谢回复!! 根据(http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm)链接,我需要一些帮助来理解步骤1到4。 ! 现在通过四个步骤138读取分析仪返回的字节! (1)读取并转储第一个字符 - '#'输入@Na使用“#,A”; A $ 141! 142! (2)读取下一个字符,即文件大小中的位数150 ENTER @Na USING“#,A”;数字$ 160! 161! (3)使用位数的值来回读文件字节大小170! 使用此数字位数创建查询字符串180 Img $ =“#”,& Digit $&“A”190! 200! 字节$保存字符串格式的字节数210 ENTER @Na USING Img $; Byte $ 220! 225! (4)将文件内容读入缓冲区并将缓冲区内容存储到本地文件230中! 分配用于保存数据的缓冲区240 ALLOCATE Dat $ [VAL(Byte $)] 250! 260! 设置不同的图像以填充缓冲区270 Img $ = Byte $&“A”280! 290! 检索实际文件数据300 ENTER @Na USING Img $; Dat $ 305! 我不确定这是什么编程语言。 我只尝试过MEMM:TRAN? 命令与文件名,它不起作用。 我很困惑,即使转移,然后它将保存在PC上。 期待任何帮助。 谢谢! 以上来自于谷歌翻译 以下为原文 Thank you replying!! I would need some help in understanding steps 1 through 4 as per (http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm) link. ! Now read the bytes coming back from the analyzer in four steps 138 ! (1) Read and dump the first character - '#' 140 ENTER @Na USING "#,A";A$ 141 ! 142 ! (2) Read the next character which is the number of digits in the file size 150 ENTER @Na USING "#,A";Digit$ 160 ! 161 ! (3) Use the value of the number of digits to read back the file byte size 170 ! Create query string using this number of digits 180 Img$="#,"&Digit$&"A" 190 ! 200 ! Byte$ holds the number of bytes in string format 210 ENTER @Na USING Img$;Byte$ 220 ! 225 ! (4) Read the file contents into a buffer and store the buffer contents to a local file 230 ! Allocate a buffer for holding the data 240 ALLOCATE Dat$[VAL(Byte$)] 250 ! 260 ! Set up a different image for filling the buffer 270 Img$=Byte$&"A" 280 ! 290 ! Retrieve the actual file data 300 ENTER @Na USING Img$;Dat$ 305 ! I am not sure of what programming language this is. I did try only the MEMM:TRAN? command with the filename and it does not work. I am confused as to even if transferred then where would it save on the PC. Looking forward any help. Thanks! |
|
|
|
***z 发表于 2018-12-28 06:30 > {quote:title = nmedelec写道:} {quote}>谢谢你的回复!! >根据(http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm)链接,我需要一些帮助来理解步骤1到4。 >我不确定这是什么编程语言。 我没有PNA,但点击链接查看我自己。 我也没有重新编写语言,但它确实在顶部说“下面的人民币例子......”谷歌出现了各种各样的东西,但最有希望的看起来似乎是“落基山BASIC”http:// en。 wikipedia.org/wiki/Rocky_Mountain_BASIC任何一天给我C! 我并不是说它是Rocky Mountain BASIC,而且无用的维基百科页面没有任何示例代码,但我怀疑它是什么。 希望有一天我将需要编程PNA-X。 现在我必须使用我的8720D,我在C. Dave编程 以上来自于谷歌翻译 以下为原文 > {quote:title=nmedelec wrote:}{quote} > Thank you replying!! > I would need some help in understanding steps 1 through 4 as per (http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/Transfer_Data_using_GPIB.htm) link. > I am not sure of what programming language this is. I don't have a PNA, but clicked the link to see for myself. I did not reconsise the language either, but it does say at the top "The following RMB examples ..." A Google shows up various things, but the most promising looking seems to be "Rocky Mountain BASIC" http://en.wikipedia.org/wiki/Rocky_Mountain_BASIC Give me C any day!!! I am not saying it is Rocky Mountain BASIC, and rather unhelpfully the Wikipedia page does not have any example code, but I suspect that is what it is. Hopefully one day I will have to program a PNA-X. For now I have to make do with my 8720D, which I program in C. Dave |
|
|
|
您需要查看手册中的解释和示例。
关于GPIB:http://na.tm.agilent.com/pna/help/latest/Programming/Learning_about_GPIB/Learning_about_GPIB.htm示例程序:http://na.tm.agilent.com/pna/help/latest/Programming /GPIB_Example_Programs/SCPI_Example_Programs.htm 以上来自于谷歌翻译 以下为原文 You'll need to look into explanations and examples in the manual. About GPIB: http://na.tm.agilent.com/pna/help/latest/Programming/Learning_about_GPIB/Learning_about_GPIB.htm Example programs: http://na.tm.agilent.com/pna/help/latest/Programming/GPIB_Example_Programs/SCPI_Example_Programs.htm |
|
|
|
正如drkirkby所说,我确实看起来像是基石。
但是,该代码中的SCPI命令仍适用于其他语言(发送特定命令的方法不同)。 在阅读本文时,请参考MMEM:TRAN命令的帮助文件:http://na.tm.agilent.com/pna/help/latest/Programming/GP-IB_Command_Finder/Memory.htm#Transfer数据传输的工作方式如下 这个:你知道一个文件位于PNA的默认目录中(你知道名字),并且你想把文件送到PC上。 您需要向PNA发送请求以便为您检索文件。 所以你发送以下命令:MMEM:TRAN? “myfile.s2p”注意:引号是必需的(我刚试过),myfile应该用你的文件名替换。 在我的PNA上,默认文件位置是c: Program Files Agilent Network Analyzer Documents(这是我在PNA UI屏幕中选择File-> Save As时弹出的第一个位置)。 接下来,您将开始从PNA获取数据。 在数据流的开头有一些重要的信息,告诉你文件的大小。 洛基山的基本代码向您展示了如何解析这些信息。 然后,您需要将数据流从PNA保存回文件(该文件不会在PC上自动为您创建)。 在我读回前几个字节的PNA上,我看到了:#512007! #符号标记消息的开头5告诉您文件大小将由接下来的5个字节表示12007告诉您期望的文件大小(如果我找到文件test.s2p,右键单击并查看 属性,大小报告为12007字节)和! 告诉你,你已经到了那条信息的尽头。 之后,文件的内容接下来。 所以,这意味着你需要保存12007个字节! 符号到文件中。 由于看起来s2p文件的内容是文本,因此可以保存为文本文件(与二进制文件相反)。 以上来自于谷歌翻译 以下为原文 I does appear to be rocky mountain basic, as drkirkby says. However, the SCPI commands within that code are still applicable in other languages (the method in which you send the specific commands differs). As you read this, reference the help file for the MMEM:TRAN command: http://na.tm.agilent.com/pna/help/latest/Programming/GP-IB_Command_Finder/Memory.htm#Transfer The data transfer works like this: You know a file is located in the default directory of the PNA (and you know the name), and you want to get the file to the PC. You need to send a request to the PNA to retreive the file for you. So you send the following command: MMEM:TRAN? "myfile.s2p" notes: the quotation marks are required (I just tried), and myfile should be replaced by your filename. On my PNA, the default file location is c:Program FilesAgilentNetwork AnalyzerDocuments (which is the first place that pops up when I choose File->Save As in the PNA UI screen). Next you will start getting back data from the PNA. There is some important information at the beginning of the data stream telling you how large the file is. The rocky mountain basic code shows you how to parse this information. Then you will need to save the data streaming back from the PNA into a file (the file isn't automatically created for you on the PC). On my PNA when I read back the first few bytes, I see: #512007! The # symbol demarks the beginning of the message The 5 tells you that the file size will be represented by the next 5 bytes The 12007 tells you the file size to expect (if I find the file test.s2p, right-click and look at properties, the size is reported as 12007 bytes) and the ! tells you that you're at the end of that piece of information. After that the contents of the file come next. So, this means that you need to save 12007 bytes that follow the ! symbol into a file. Since it looks like the contents of a s2p file are text, you can save to a text file (opposed to binary). |
|
|
|
btywyrww 发表于 2018-12-28 07:10 好的描述,mr_matt。 你所说的都是正确的,除了那些数字之后的第一个字节(在你的情况下是12007)实际上总是文件内容的第一个字节(在s2p文件的情况下是'!')。 你读了12007字节,其中包括! 在你的情况下,然后我相信分析器也会在最后添加一个尾随的换行符(ASCII十进制值10),因为分析器传统上这样做表示查询响应的终止/结束。 以上来自于谷歌翻译 以下为原文 Nice description, mr_matt. All that you said is correct, except that the first byte that comes after those digits (the 12007 in your case) is always actually the first byte of the file's contents (a '!' in the case of an s2p file). You read those 12007 bytes which includes the ! in your case, and then I believe the analyzer also tacks-on a trailing linefeed character (ASCII decimal value 10) at the end because the analyzer traditionally does that to signify the termination/end of a query response. |
|
|
|
只有小组成员才能发言,加入小组>>
1230 浏览 0 评论
2351 浏览 1 评论
2160 浏览 1 评论
2026 浏览 5 评论
2908 浏览 3 评论
974浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
707浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
808浏览 0评论
1230浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-26 05:14 , Processed in 1.388057 second(s), Total 59, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号