我正在尝试使用 National Instruments 的 GPIB-USB-HS 适配器与 Tektronix 示波器 TDS 210 通信。我的系统是 Ubuntu 14.04.3,我在此链接中安装了 linux-gpib:Linux GPIB Driver package (source)和 python-gpib。我像这样重新配置了 /etc/gpib.conf:
interface {
minor = 0 /* board index, minor = 0 uses /dev/gpib0, minor = 1 uses /dev/gpib1, etc. */
board_type = "ni_usb_b" /* type of interface board being used */
name = "tds" /* optional name, allows you to get a board descriptor using ibfind() */
pad = 0 /* primary address of interface */
sad = 0 /* secondary address of interface */
master = yes /* interface board is system controller */
timeout = TNONE /* timeout for commands */
}
device {
minor = 0
name = "ATTN"
pad = 0
sad = 0
}
lsmod 给我这个:
$ lsmod | grep gpib
ni_usb_gpib 36515 1
gpib_common 38274 3 ni_usb_gpib
dmesg:
$ dmesg | grep gpib
[ 2173.992039] ni_usb_gpib driver loadingni_usb_gpib: probe succeeded for path: usb-0000:00:1a.0-1.2
[ 2173.992098] usbcore: registered new interface driver ni_usb_gpib
[ 2173.992102] gpib: registered ni_usb_b interface
[ 2173.995077] ni_usb_gpib: attach
但是当尝试使用 ibtest 与示波器通信时,我收到此错误:
gpib status is:
ibsta = 0x8100 < ERR CMPL >
iberr= 0
EDVR 0: OS error
ibcnt = 25
使用 Python:
import Gpib
tds = Gpib.Gpib(0,0)
tds.write("*IDN?")
---------------------------------------------------------------------------
GpibError Traceback (most recent call last)
<ipython-input-4-e61e6a76ac49> in <module>()
1 import Gpib
2 inst = Gpib.Gpib(0,0)
----> 3 inst.write("*IDN?")
/usr/local/lib/python2.7/dist-packages/Gpib.pyc in write(self, str)
47
48 def write(self,str):
---> 49 gpib.write(self.id, str)
50
51 def write_async(self,str):
GpibError: write() error: Inappropriate ioctl for device (errno: 25)
是否有人已经有类似的问题或知道如何解决这个问题?