- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在尝试在 Python 中导入 visa
并与 GPIB
交互以控制设备。我使用的设备名称是"GPIB0::9::INSTR"
,我想这个应该没有问题。
我在 2.7.3 Python Shell 中运行了以下代码
>>> from visa import *
>>> a = instrument("GPIB0::9", timeout = 20)
>>> a.write("*IDN?")
>>> print a.read()
Traceback (most recent call last):
File "<pyshell#53>", line 1, in <module>
print a.read()
File "C:\Python27\lib\site-packages\pyvisa\visa.py", line 433, in read
return self._strip_term_chars(self.read_raw())
File "C:\Python27\lib\site-packages\pyvisa\visa.py", line 407, in read_raw
chunk = vpp43.read(self.vi, self.chunk_size)
File "C:\Python27\lib\site-packages\pyvisa\vpp43.py", line 840, in read
visa_library().viRead(vi, buffer, count, byref(return_count))
File "C:\Python27\lib\site-packages\pyvisa\vpp43.py", line 398, in check_status
raise visa_exceptions.VisaIOError, status
VisaIOError: VI_ERROR_TMO: Timeout expired before operation completed.
以上是系统报错。其实一开始,我把Timeout
设置为3,就显示了这个errot。但是我如上图改成20后还是不行。
有人可以帮帮我吗?
最佳答案
有不同的问题可能会导致超时。首先,您应该检查您的设备是否支持 *IDN?
查询。它是 IEEE-488.2 标准命令,因此它受支持的可能性很高(如果不支持,请查看您的手册中的命令)。
然后你应该检查你的通信设置,特别是终止字符和 EOI。
如果您使用了错误的终止字符,visa 将继续读取并最终超时。
注意:如果您使用的是可查询命令(它是写入和读取的组合),您可以使用 pyvisa 的 ask 函数。
import visa
# If you've got just one gpib card installed, you can ommit the 0.
# ASsuming the EOI line should be asserted and a termination character
# of '\n'
instrument = visa.instrument('GPIB::9', term_chars='\n', send_end=True)
# use ask to write the command and read back the response
print instrument.ask('*IDN?')
关于python - 使用 visa 与 GPIB 接口(interface)总是给我 VisaIOError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10615691/
我正在尝试使用 National Instruments 的 GPIB-USB-HS 适配器与 Tektronix 示波器 TDS 210 进行通信。我的系统是 Ubuntu 14.04.3,我按照此
我想使用 python 访问 Agilent Device N3301A。目的是连接到 GPIB我使用的端口 GPIB到 National Instruments 的 USB 适配器。我已经安装了Py
我有一个 GPIB 设备,我正在使用 National Instruments USB 转 GPIB 与之通信。 USB 到 GPIB 工作得很好。 我想知道什么会导致 GPIB 设备无响应?如果我关
架构->来自外部接口(interface)的GBIP通过gpib总线连接到目标(linux)系统。Linux 盒子内部有一条从 GPIB 到主板的以太网电缆。 外部接口(interface)上的PIC
我想通过 GPIB 同时触发多个测量设备。有一个可与 LabVIEW 配合使用的 GPIB 函数“GET”,我想将其与 pyVISA 一起使用。 我可以使用 pyVISA 发送这个全局 GET 命令吗
我正在尝试使用 PyVISA 控制 GPIB 上的仪器(非常古老的霍尔测量设备)。我知道它可以与labview一起使用,在那里我发现了哪些地址执行什么操作以及一些带有跟踪器的基本命令,但没有什么乐趣。
在 C# 和 visual studio 中,您使用什么命令与 GPIB 仪器通信?我需要能够向仪器写入命令并读取输出。 最佳答案 我使用 Agilent IO Library Suite . 这是在
我正在尝试通过 Python 与一个非常古老的仪器(CCD 相机)进行通信。仪器制造商于 1999 年出版的 GPIB 编程手册仅提供了基本命令列表。它还描述了 GPIB 通信的一些标准程序。 我之前
有没有办法使用 MATLAB 建立 GPIB 连接 没有 仪表控制工具箱? (我没有)。还有一种方法可以让 MATLAB 知道外部设备的 RS232 参数值是什么(波特率、停止位等)。对于 RS232
我正在尝试使用 C++ 和 Qt 通过 GPIB 与连接到 Windows PC 的 Yokogawa GS200 直流电源进行通信。 我从 Yokogawa ( https://y-link.yok
所以我已经像这样初始化了 GPIB 仪器: import pyvisa rm = pyvisa.ResourceManager() kk = rm.open_resource('GPIB0::1::I
我想知道是否可以使用 C++ 和 Qt 与 GPIB 仪器进行交互。如果可能的话,谁能告诉我这有多容易和/或为我指明教程或示例的方向? 非常感谢。 最佳答案 是的,这应该是可能的。该包的一部分应该是用
我正在尝试使用 Ubuntu 13.04 下的 pyvisa 控制 Agilent 33120A 任意波形发生器(Raring Ringtail)。我已经使用我们的实验室 NI GPIB-USB-B
我有一个带有 Agilent E4426B RF 信号发生器的测试夹具,通过 National Instrument 以太网到 GPIB 桥接器连接到 PC。我的软件试图通过预设来净化仪器,然后将当前
如何仅使用 ANSI-C 和可能的 Windows header 打开和关闭与 GPIB 设备的连接。 是否有默认方法可以执行此操作,或者 gpib 本质上涉及第三方驱动程序? 最佳答案 仅使用 Wi
我需要使用来自国家仪器的 NI-488.2 将 GPIB 转换为 USB,我需要使用 python 创建一个完整的带有 GUI 的软件。我公司用于测量的旧机器是普林斯顿应用研究公司的273A型恒电位仪
我正在尝试在 Python 中导入 visa 并与 GPIB 交互以控制设备。我使用的设备名称是"GPIB0::9::INSTR",我想这个应该没有问题。 我在 2.7.3 Python Shell
我是一名优秀的程序员,十分优秀!