Mac OS X上的NI VISA + pyVisa(雪豹) [英] NI VISA + pyVisa on Mac OS X (Snow Leopard)

查看:357
本文介绍了Mac OS X上的NI VISA + pyVisa(雪豹)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人成功使用NI GPIB模块在Snow Leopard上运行pyVisa吗?

根据我在NI网站上阅读的所有论坛,似乎不能在Max OS X上完成NI VISA和pyVisa的组合.

Based on all of the forums I have read on NI's website, it does not appear that the combination of NI VISA and pyVisa can be done on Max OS X.

令人困扰的部分是NI网站具有NI VISA支持

The troubling part is that NI website has the NI VISA support listed for Mac OS X. However in their support pages, they do not list OS X as a supported OS.

任何评论或帮助将不胜感激,因为我真的很想摆脱使用Windows进行此软件开发以及允许跨平台支持的麻烦.

Any comments or help would be greatly appreciated as I would really like to get away from having to use Windows to do this software development as well as allow cross platform support.

推荐答案

事实证明,NI-VISA 5.0在10.6.6上运行良好.

It turns out that NI-VISA 5.0 works well on 10.6.6.

我在打电话给pyVisa的Visa.Instrument("GPIB :: 1")时遇到的问题是它找不到该库.但是,在调用Visa.get_instruments_list()时,我的GPIB适配器显示为GPIB0.使用它作为设备,我可以正确连接.

The issue I was having was when calling pyVisa's visa.Instrument("GPIB::1") it said the library was not found. However when calling visa.get_instruments_list() displayed my GPIB adapter as GPIB0. Using this as the device I was able to connect properly.

为了完成此任务,我不得不做一些改动,这些改动在NI网站上(至少我可以找到)记录得不好.最重要的是NI-VISA 5.0安装的VISA库的名称.在/Library/Frameworks/Visa.framework/VISA中找到它. pyVisa文档中提到,我还没有尝试修改nsi文件以自动链接到该库.

There were a few changes that I had to make that were not documented well on NI's site (that I could find at least) in order to accomplish this. The most important being the name of the VISA library that NI-VISA 5.0 installs. It is found at /Library/Frameworks/Visa.framework/VISA. I have not tried modifying the nsi file to automatically link to this library as the pyVisa documentation mentions.

我无法使用pip安装pyvisa.我不得不使用easy_install.如果有人成功使用pip安装pyvisa,我真的很想知道怎么做!

I have been unable to install pyvisa with pip. I had to use easy_install. If anyone has had success installing pyvisa with pip, I would really like to know how!

系统设置:

运行virutalenv + virtualenvwrapper的Python 2.7.雪豹10.6.6. NI-VISA 5.0

Python 2.7 running virutalenv + virtualenvwrapper. Snow Leopard 10.6.6. NI-VISA 5.0

示例代码:

from pyvisa.vpp43 import visa_library
visa_library.load_library("/Library/Frameworks/Visa.framework/VISA")
import visa
visa.get_instruments_list() # Yields: ['ASRL1', 'ASRL2', 'ASRL3', 'ASRL4', 'GPIB0::1']
temp = visa.Instrument("GPIB0::1")
print temp # Yeilds: Instrument("GPIB0::1::INSTR")

更新:
移至Lion后,我发现了相同的问题,并且每次都必须手动加载该库.这让我觉得我缺少了一些东西.

Update:
After moving to Lion I have found the same issues and have had to load the library manually each time. This makes me think I'm missing something.

这篇关于Mac OS X上的NI VISA + pyVisa(雪豹)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆