完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,我想在Python中使用USB端口控制DSOX2024A示波器。
我之前使用串行端口的频谱分析仪完成了这项工作。 这需要Pyserial for Python直接将原始SCPI命令发送到设备并获得响应。 _我还没有使用过VISA,pyVISA。这里有3个选项.... 1.签证2. pyVISA 3.安捷伦IO库*从我的理解,它足以使用VISA和pyVISA来控制范围。请更正 我,如果我错了。*。 * Agilent IO库的用途是什么。 我可以使用Agilent IO库而不是带有pyVISA的VISA。*有没有办法,不使用pyVISA和VISA或agilent IO库来控制使用Python的范围(_like直接在USB接口中发送Raw SCPI命令?_) 以上来自于谷歌翻译 以下为原文 Hi, I want to control DSOX2024A scope using USB port in Python. I have done this previously with spectral analyzer using serial port. This requires just Pyserial for Python to directly send raw SCPI commands to the device and getting response. _I have not used VISA, pyVISA ._ Here, 3 options are there.... 1. VISA 2. pyVISA 3. Agilent IO libraries *from my understanding, it is enough to use VISA and pyVISA for controlling scope..Please correct me if i am wrong.*. *What is the purpose of Agilent IO libraries. Can i use them Agilent IO libraries instead of VISA with pyVISA.* is there any way, without using pyVISA and VISA or agilent IO libraries to control scopes using Python ( _like sending Raw SCPI commands directly in USB interface?_ ) |
|
相关推荐
4个回答
|
|
串口和USB非常不同。
USB具有固有协议,数据以数据包形式发送,带有确认等。假设您正在通过PC控制示波器,是的,您需要/想要Agilent I / O库以及pyvisa。 您需要打开连接,如文件,发送赞扬,并等待响应。 VISA库有助于此。 如果需要,您甚至可以使用串行连接。 以下是我所处的Python代码中的一些部分。 scope = instrument(“TCPIP0 :: 156.140.157.107 :: inst0 :: INSTR”) - 这将打开与作用域的连接。 引用的字符串告诉VISA如何谈论范围。 I / O库将识别范围,并为您提供此字符串,以便您可以将其复制并粘贴到程序中。 scope.write(“WAV:SOUR CHAN1”) - 只是其中一个设置命令。 data = scope.ask(“:WAVEFORM:DATA?”) - 询问数据范围并将数据转储到数组中(实际上是一个元组)祝你好运! 人 以上来自于谷歌翻译 以下为原文 Serial ports and USB are very different. USB has an inherent protocol, and data gets sent in packets, with acknowledgements, etc. Assuming you are controlling the scope from a PC, yes, you need/want the Agilent I/O Libraries, along with pyvisa. You need to open the connection, like a file, send commends, and wait for responses. The VISA libraries help with that. You can even use them with a serial connection if you want. Here are some pieces from some Python code I had lying around. scope = instrument("TCPIP0::156.140.157.107::inst0::INSTR") - This opens the connection to the scope. The quoted string tells VISA how to talk the scope. The I/O Libraries will identify the scope, and give you this string, so you can copy and paste it into your program. scope.write("WAV:SOUR CHAN1") - Just one of the setup commands. data = scope.ask(":WAVEFORM:DATA?") - ask the scope for data and dump the data into an array (actually a tuple) Good Luck! Al |
|
|
|
nvywyerwer 发表于 2018-12-7 20:55 嗨,谢谢你的支持。 我可以与DSO沟通。 在PyVISA 1.5中这个变化不大..进口签证; resMan = visa.ResourceManager(); res = resMan.list_resources(); temp =''+ join(res); temp1 = temp.encode('utf-8'); dsoObj = resMan.get_instrument(temp1); 打印(dsoObj.ask( “* IDN?”))。 从文档我发现,PyVISA使用visa32.dll访问VISA。 我不确定访问Agilent IO库的位置? 但由于安捷伦IO库,我有一个名为Agilent Connection Manager的应用程序,因为我可以连接到仪器并调试状态。 是否真的需要使用pyVISA与仪器进行通信。 我不是软件工程师,我最讨人喜欢.. 以上来自于谷歌翻译 以下为原文 Hi, Thank you for support. I can able to communicate with the DSO. in PyVISA 1.5 this is little changed.. import visa; resMan = visa.ResourceManager(); res = resMan.list_resources(); temp = ''+join(res); temp1 = temp.encode('utf-8'); dsoObj = resMan.get_instrument(temp1); print(dsoObj.ask("*IDN?")). from documentation i found that, PyVISA uses visa32.dll for accessing VISA. I am not sure where Agilent IO libraries are accessed ? But because of Agilent IO libraries i have one application called Agilent Connection Manager because of that i can connect to the instrument and debug the status. Is really Agilent IO libraries are required pyVISA to communicate with the instrument. I am not a software engineer, i am hobbiest.. |
|
|
|
I / O库不是必需的。 他们只是让事情变得容易多了。 当您有一个想要与之交谈的设备时,您的示例很有效。 当有许多设备,并且您正在尝试调试代码时,I / O库提供了许多有用的功能,例如自动设备发现和交互式I / O. 如果您想扩展使用仪器和远程控制的知识,请深入了解I / O库,然后是Command Expert,然后是BenchVue,所有这些都是免费工具。 人 以上来自于谷歌翻译 以下为原文 The I/O Libraries are not required. They just make things a lot easier. Your example works well when you have a single device that you want to talk to. When there are many devices, and you are trying to debug your code, the I/O Libraries provide a lot of useful functionality, such as automatic device discovery, and interactive I/O. If you want to expand your knowledge of using instruments and remote control, look deeper into the I/O Libraries, then Command Expert, then BenchVue, all of which are free tools. Al |
|
|
|
谢谢.......我会尝试看IO库...... 以上来自于谷歌翻译 以下为原文 Thank you....... I will try to see IO libraries...... |
|
|
|
只有小组成员才能发言,加入小组>>
866 浏览 0 评论
2192 浏览 1 评论
1974 浏览 1 评论
1839 浏览 5 评论
2711 浏览 3 评论
684浏览 1评论
关于Keysight x1149 Boundary Scan Analyzer
485浏览 0评论
N5230C用“CALC:MARK:BWID?”获取Bwid,Cent,Q,Loss失败,请问大佬们怎么解决呀
579浏览 0评论
2371浏览 0评论
1425浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-8-19 17:14 , Processed in 1.884237 second(s), Total 81, Slave 65 queries .
Powered by 电子发烧友网
© 2015 www.ws-dc.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191