完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
我正在使用82357B和带有C#的Agilent VISA库来控制一堆仪器。
使用FormattedIO488方法一切正常。 我无法做的一件事是使用Tektronix FILESystem:READFile命令将文件从作用域传输到PC。 我可以将该命令写入范围,看似没有错误,但无论我如何尝试,读取数据都会产生错误。 Tek手册描述了如下命令:FILESystem:PRInt,GPIb“此命令(无查询形式)将命名文件打印到命名端口。此命令与FILESystem:READFile命令相同。此命令不符合IEEE 488.2 由于以下原因:该命令在488.2总线上产生输出。查询而不是命令是唯一应在488.2总线上产生输出的消息单元。如果在输出数据时发生错误则可能无法识别错误 如果在读取此命令生成的所有数据之前向仪器发送命令,这将很明显。在这种情况下,您应该向仪器发送设备清除消息。该命令不使用标准488.2 输出格式。最接近定义的格式是ARBITRARY BLOCK PROGRAM DATA编码的不定格式。但是,此命令输出省略了该格式所需的初始“#0”字符。换行符,ASCII值10,可以包含在输出中 放数据。 总线上的输出可以通过换行符终止。 此命令的输出仅以。结尾。 我尝试使用各种方法将命令写入范围,所有似乎都正常工作:viError = visa32.viOpenDefaultRM(out resourceManager); viError = visa32.viOpen(resourceManager,“GPIB0 ::”+ currentAddress +“:: INSTR”,visa32.VI_NO_LOCK,visa32.VI_TMO_IMMEDIATE,out session); string file = @“:FILES:READF”“C: TekScope waveform STARTUP.PNG”“,GPIb”; viError = visa32.viPrintf(session,file); 现在,我用来尝试读取总线上的数据的任何方法似乎超时或者什么都不读。 我不确定读取数据的正确方法。 格式化的命令似乎是错误的,因为我认为我想读取字节数据,而不是字符串或浮点数等。我已经尝试过viRead,viBufread,viscanf都没有成功。 我显然是在忽略某些事情或做错事,所以任何帮助都会得到赞赏。 (我试图在TEK论坛上发帖,但是由于某种原因它不允许我注册。)在此先感谢! 以上来自于谷歌翻译 以下为原文 I'm using the 82357B and the Agilent VISA library with C# to control a bunch of instruments. Everything works fine using the FormattedIO488 methods. The one thing I'm unable to do is transfer a file from the scope to the PC using the Tektronix FILESystem:READFile command. I can write that command to the scope seemingly without errors, but reading the data back gives an error no matter how I attempt it. The Tek manual describes the command as follows: FILESystem:PRInt , GPIb "This command (no query form) prints a named file to a named port. This command is the same as the FILESystem:READFile command. This command is not IEEE 488.2 compliant for the following reasons: The command produces output on the 488.2 bus. Queries, not commands, are the only message units that should produce output on the 488.2 bus. Errors may not be recognized if they occur while data is being output in response to this command. This will be evident if a command is sent to the instrument before all of the data generated by this command has been read. In such cases, you should send a device clear message to the instrument. The command does not use a standard 488.2 output format. The closest defined format is the indefinite format of ARBITRARY BLOCK PROGRAM DATA encoding. However, this command output omits the initial ’#0’ characters needed for that format. Newlines, ASCII value 10, can be included in the output data. Output on the bus can be terminated by newlines. The output of this command is only terminated by . I've tried writing the command to the scope using various methods, all seem to work OK: viError = visa32.viOpenDefaultRM(out resourceManager); viError = visa32.viOpen(resourceManager, "GPIB0::"+currentAddress+"::INSTR", visa32.VI_NO_LOCK, visa32.VI_TMO_IMMEDIATE, out session); string file = @":FILES:READF ""C:TekScopewaveformsSTARTUP.PNG"",GPIb"; viError = visa32.viPrintf(session,file); Now, any method I use to try to read the data on the bus seems to time out or read nothing. I'm not sure of the correct way to read the data. The formatted commands seem wrong because I would think I would want to read byte data, not a string or float etc. I've tried viRead, viBufread, viscanf all with no success. I'm obviously overlooking something or doing something wrong, so any help would be appreciaated. (I tried to post on the TEK forum, but it would not allow me to register for some reason.) Thanks in advance! |
|
相关推荐
1个回答
|
|
似乎我已经部分解决了这个问题。
Tek文档说命令格式如下:FILESystem:PRInt,GPIb即使示例在命令末尾显示“,GPIB”。 但是,文中说GPIB总线没有其他选项可供输出,所以我试着让GPIB离开命令的末尾。 现在它完美无缺。 不知道为什么Tek文档似乎需要GPIB,当它似乎不起作用时,(或者我的用户错误是什么)但是我没有它就启动并运行。 如果有人理解这一点,或者可以对语法有所了解,那么如果你可以插入它就会很棒。谢谢,John 以上来自于谷歌翻译 以下为原文 Seems I've partially solved this issue. The Tek documentation says that the command format is as follows: FILESystem:PRInt , GPIb Even the examples show the ",GPIB" at the end of the command. However, the text says there is no other option than the GPIB bus for output, so I tried leaving the ,GPIB off of the end of the command. Now it works perfectly. Not sure why the Tek documentation seems to require the ,GPIB when it doesn't seem to work, (or what the user error on my part is) but I'm up and running without it. If anyone understands this or could shed some light on the syntax it would be great if you could chime in. Thanks, John |
|
|
|
只有小组成员才能发言,加入小组>>
1251 浏览 0 评论
2360 浏览 1 评论
2173 浏览 1 评论
2041 浏览 5 评论
2925 浏览 3 评论
997浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
725浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
826浏览 0评论
1252浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-3 07:18 , Processed in 1.378782 second(s), Total 78, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号