"没有这样的设备"使用pyvisa和pyvisa-py后端的错误

时间:2016-04-27 11:57:59

标签: python linux visa gpib

我尝试使用Python后端rm=ResourceManager('@py')设置pyvisa。

当我启动rm.list_resources()

我收到以下错误:

libgpib: error locking board mutex!  
Traceback (most recent call last):  
  File "<stdin>", line 1, in <module>  
  File "/home/frank/.local/lib/python2.7/site-packages/pyvisa/highlevel.py", line 1560, in list_resources  
    return self.visalib.list_resources(self.session, query)  
  File "/home/frank/.local/lib/python2.7/site-packages/pyvisa-py/highlevel.py", line 231, in list_resources
    for key, st in sessions.Session.iter_valid_session_classes()], [])  
  File "/home/frank/.local/lib/python2.7/site-packages/pyvisa-py/gpib.py", line 57, in list_resources
    return ['GPIB0::%d::INSTR' % pad for pad in _find_listeners()]  
  File "/home/frank/.local/lib/python2.7/site-packages/pyvisa-py/gpib.py", line 35, in _find_listeners
    if gpib.listener(BOARD, i) and gpib.ask(BOARD, 1) != i:
gpib.GpibError: listener() error: No such device (errno: 19)  

python -m visa info的输出是:

Machine Details:  
   Platform ID:    Linux-4.2.0-36-generic-x86_64-with-Ubuntu-15.10-wily  
   Processor:      x86_64  

Python:  
   Implementation: CPython  
   Executable:     /usr/bin/python  
   Version:        2.7.10  
   Compiler:       GCC 5.2.1 20151010  
   Bits:           64bit  
   Build:          Oct 14 2015 16:09:02 (#default)  
   Unicode:        UCS4  

PyVISA Version: 1.7

Backends:  
   ni:  
      Version: 1.7 (bundled with PyVISA)  
      #1: /usr/lib/libvisa.so.7:  
         found by: user  
         bitness: n/a  
         Could not get more info:  
            Error while accessing /usr/lib/libvisa.so.7: /usr/lib  /libvisa.so.7: cannot open shared object file: No such file or directory
      #2: /usr/lib/x86_64-linux-gnu/libvisa.so.0.0.0:  
         found by: auto  
         bitness: 64  
         Could not get more info:  
            VI_ERROR_NSUP_ATTR (-1073807331): The specified attribute is not defined or supported by the referenced object.  
   py:  
      Version: 0.2  
      ASRL INSTR: Available via PySerial (2.7)  
      TCPIP INSTR: Available   
      USB RAW: Available via PyUSB (1.0.0rc1). Backend: libusb1  
      USB INSTR: Available via PyUSB (1.0.0rc1). Backend: libusb1  
      GPIB INSTR: Available   
      TCPIP SOCKET: Available   
   sim:  
      Version: 0.3  
      Spec version: 1.1  

知道我错过了什么?

1 个答案:

答案 0 :(得分:2)

这是一个已知的错误,这里是跟踪器。我有一个类似的问题,这个链接有帮助。

https://github.com/hgrecco/pyvisa-py/issues/78