PyVISA缺少的方法

编程入门 行业动态 更新时间:2024-10-21 16:26:45
本文介绍了PyVISA缺少的方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在用numpy/scipy/ipython运行Win 7 x64,NI 488.2,PyVISA 1.5和python.我试图通过GPIB-USB连接联系吉时利仪器并发送简单命令.但是,当我尝试创建仪器对象时,我发现PyVISA的ResourceManager缺少用于查找,读取和写入仪器的必需方法.

I am running Win 7 x64, NI 488.2, PyVISA 1.5, and python with numpy/scipy/ipython. I am attempting to contact a Keithley instrument through a GPIB-USB connection and send simple commands. However, when I attempt to create the instrument object, I discovered that PyVISA's ResourceManager was missing the required methods used for finding, reading, and writing to instruments.

下面是PyVISA页面上的示例代码,我现在有:

Following the example code on PyVISA's page, right now I have:

import visa rm = visa.ResourceManager my_instrument = rm.get_instrument('GPIB::3')

哪个返回错误,指出get_instrument不存在.使用制表符完成功能可以查看资源管理器rm的可用内容.揭示了它实际上缺少它应具有的所有方法,仅包含rm.init,rm.close和其他一些方法.这些都不执行任何操作或返回4099L.尝试调用rm本身只会打印字符串'ResourceManager()'.

Which returns an error that get_instrument doesn't exist. Using tab-completion to see what is available from the resource manager rm. reveals that it is lacking virtually all the methods it should have, containing only rm.init, rm.close, and a few others. These all either do nothing or return a 4099L. Attempting to call rm itself just prints the string 'ResourceManager()'.

进一步检查后,找不到签证Visa.VisaLibrary(),表明问题是安装不当;但是,在重新下载并重新安装整个软件包(使用pip)后,丢失文件的问题仍然存在.签证模块本身可以很好地加载,只是缺少了大部分重要文件.我是在搞砸安装,还是有其他事情发生?

Upon further examination, visa.VisaLibrary() is nowhere to be found, suggesting the problem is a botched installation; however, upon redownloading and reinstalling the entire package (using pip), the missing file problem persists. The visa module itself loads fine, it's just missing most of its important files. Am I screwing up the installation, or is there something else going on?

推荐答案

事实证明,答案很简单,就像从其他位置下载软件包一样.显然,我使用的网站的DL软件包已损坏或不完整.

Turns out the answer was as simple as downloading the package from a different location. Apparently the site I used had a corrupted or incomplete package up for DL.

更多推荐

PyVISA缺少的方法

本文发布于:2023-11-08 13:59:06,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1569573.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:方法   PyVISA

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!