Hello,
inspired by xdevs page I would like to script some measurements on a DMM. But I have some problems to get the basic drivers or software running. First I did a step by step installation from
https://www.cl.cam.ac.uk/~osc22/tutorials/gpib_usb_linux.html. I installed pyvisa as front end and pyvisa-py and NI-VISA as backends. pyvisa-info gives:
pyvisa-info
Machine Details:
Platform ID: Linux-6.2.0-32-generic-x86_64-with-glibc2.35
Processor: x86_64
Python:
Implementation: CPython
Executable: /usr/bin/python3
Version: 3.10.12
Compiler: GCC 11.4.0
Bits: 64bit
Build: Jun 11 2023 05:26:28 (#main)
Unicode: UCS4
PyVISA Version: 1.13.0
Backends:
ivi:
Version: 1.13.0 (bundled with PyVISA)
#1: /usr/lib/x86_64-linux-gnu/libvisa.so.23.5.0:
found by: auto
bitness: 64
Vendor: National Instruments
Impl. Version: 24118528
Spec. Version: 7340032
py:
Version: 0.7.0
ASRL INSTR: Available via PySerial (3.5)
USB INSTR: Available via PyUSB (1.2.1-1). Backend: libusb1
USB RAW: Available via PyUSB (1.2.1-1). Backend: libusb1
TCPIP INSTR: Available
Resource discovery:
- VXI-11: ok
- hislip: ok
TCPIP SOCKET: Available
GPIB INSTR: Available via Linux GPIB (b'4.3.6')
GPIB INTFC: Available via Linux GPIB (b'4.3.6')
VICP INSTR:
Please install PyVICP to use this resource type.
When I tried it with the pyvisa-py backend and it throws:
python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvisa
>>> rm = pyvisa.ResourceManager('@py')
>>> rm.list_resources()
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: No such file or directory
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: ibBoardOpen failed to open device file /dev/gpib0
libgpib: No such file or directory
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
libgpib: invalid descriptor
('ASRL/dev/ttyS4::INSTR', 'ASRL/dev/ttyS0::INSTR')
With the NI-VISA backend it throws:
python3
Python 3.10.12 (main, Jun 11 2023, 05:26:28) [GCC 11.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyvisa
>>> rm = pyvisa.ResourceManager('@ivi')
>>> rm.list_resources()
('ASRL1::INSTR', 'ASRL5::INSTR')
>>>
If I connect the GPIB adapter the udevadm monitor --environment says:
UDEV [30086.657642] add /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4.2/1-5.4.2:1.0 (usb)
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4.2/1-5.4.2:1.0
SUBSYSTEM=usb
DEVTYPE=usb_interface
PRODUCT=3923/709b/101
TYPE=0/0/0
INTERFACE=255/0/0
MODALIAS=usb:v3923p709Bd0101dc00dsc00dp00icFFisc00ip00in00
SEQNUM=4209
USEC_INITIALIZED=30086650903
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_MODEL_FROM_DATABASE=GPIB-USB-HS
ID_PATH=pci-0000:00:14.0-usb-0:5.4.2:1.0
ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_4_2_1_0
TAGS=:snap_cups_cupsd:snap_cups_ippeveprinter:
CURRENT_TAGS=:snap_cups_cupsd:snap_cups_ippeveprinter:
UDEV [30086.669265] bind /devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4.2 (usb)
ACTION=bind
DEVPATH=/devices/pci0000:00/0000:00:14.0/usb1/1-5/1-5.4/1-5.4.2
SUBSYSTEM=usb
DEVNAME=/dev/bus/usb/001/011
DEVTYPE=usb_device
DRIVER=usb
PRODUCT=3923/709b/101
TYPE=0/0/0
BUSNUM=001
DEVNUM=011
SEQNUM=4210
USEC_INITIALIZED=30086620303
ID_VENDOR=National_Instruments
ID_VENDOR_ENC=National\x20Instruments
ID_VENDOR_ID=3923
ID_MODEL=GPIB-USB-HS
ID_MODEL_ENC=GPIB-USB-HS
ID_MODEL_ID=709b
ID_REVISION=0101
ID_SERIAL=National_Instruments_GPIB-USB-HS_01268E03
ID_SERIAL_SHORT=01268E03
ID_BUS=usb
ID_USB_INTERFACES=:ff0000:
ID_VENDOR_FROM_DATABASE=National Instruments Corp.
ID_MODEL_FROM_DATABASE=GPIB-USB-HS
ID_PATH=pci-0000:00:14.0-usb-0:5.4.2
ID_PATH_TAG=pci-0000_00_14_0-usb-0_5_4_2
ID_FOR_SEAT=usb-pci-0000_00_14_0-usb-0_5_4_2
MAJOR=189
MINOR=10
TAGS=:snap_cups_cupsd:seat:snap_cups_ippeveprinter:
CURRENT_TAGS=:seat:snap_cups_cupsd:snap_cups_ippeveprinter:
In /etc/udev/rules.d/ I applied the following rules:
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709[ab]", MODE="660", GROUP="plugdev", SYMLINK+="usb_gpib"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709[ab]", RUN+="/lib/udev/ni_usb_gpib"
KERNEL=="gpib[0-9]*", ACTION=="add", MODE="660", GROUP="plugdev"
Someone has a hint how to fix this problem
![Scared :scared:](https://www.eevblog.com/forum/Smileys/default/scared.gif)
?