I have an Amrel PLA5K-400-400 eLoad connected via GPIB to an NI GPIB-USB-HS adapter and an Agilent 34980A datalogger connected via USB to my Ubuntu 22.04 laptop. I am trying to control these devices using PyVisa via the IVI NI backend. Here is what I did:
- Fresh install of Ubuntu 22.04.4
- Install PyCharm Community Edition from the Ubuntu UI
- Download NILinux2024Q1DeviceDrivers
- Install ni-ubuntu2004-drivers-stream.deb
- Install ni-visa, ni-488
- Install libusb-1.0-0
$ apt list --installed | grep libusb
libusb-1.0-0-dev/jammy-updates,now 2:1.0.25-1ubuntu2 amd64 [installed]
libusb-1.0-0/jammy-updates,now 2:1.0.25-1ubuntu2 amd64 [installed,automatic]
libusb-1.0-doc/jammy-updates,jammy-updates,now 2:1.0.25-1ubuntu2 all [installed,automatic]
libusbmuxd6/jammy,now 2.0.2-3build2 amd64 [installed,automatic]
- Create rule for usb subsystem to usbusers group
$ sudo su
$ echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' >> /etc/udev/rules.d/99-com.rules
- Install python pyvisa, pyvisa-py, pyusb
$ pyvisa-info
Machine Details:
Platform ID: Linux-6.5.0-26-generic-x86_64-with-glibc2.35
Processor: x86_64
Python:
Implementation: CPython
Executable: /home/pwrtest/PycharmProjects/test/.venv/bin/python
Version: 3.10.12
Compiler: GCC 11.4.0
Architecture: ('x86', 64)
Build: Nov 20 2023 15:14:05 (#main)
Unicode: UCS4
PyVISA Version: 1.14.1
Backends:
ivi:
Version: 1.14.1 (bundled with PyVISA)
#1: /usr/lib/x86_64-linux-gnu/libvisa.so.24.0.0:
found by: auto
architecture:
('x86', 64)
Vendor: National Instruments
Impl. Version: 25165824
Spec. Version: 7340032
py:
Version: 0.7.2
USB INSTR: Available via PyUSB (1.2.1). Backend: libusb1
USB RAW: Available via PyUSB (1.2.1). Backend: libusb1
TCPIP INSTR: Available
Resource discovery:
- VXI-11: partial (psutil not installed)
- hislip: disabled (zeroconf not installed)
TCPIP SOCKET: Available
ASRL INSTR:
Please install PySerial (>=3.0) to use this resource type.
No module named 'serial'
VICP INSTR:
Please install PyVICP to use this resource type.
GPIB INSTR:
Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
No module named 'gpib'
GPIB INTFC:
Please install linux-gpib (Linux) or gpib-ctypes (Windows, Linux) to use this resource type. Note that installing gpib-ctypes will give you access to a broader range of functionalities.
No module named 'gpib'
- Plug in the usb cable. The "Ready" light turns orange, the "Active" light is not lit. lsusb shows the device:
$ lsusb | grep GPIB
Bus 003 Device 002: ID 3923:709b National Instruments Corp. GPIB-USB-HS
$ lsusb | grep Agile
Bus 003 Device 016: ID 0957:0507 Agilent Technologies, Inc. 34980A Switch Measure Unit
- Listing NI
$ lsni -v
Scanning localhost for devices...
System Configuration API Experts found:
NI Device Interconnect Manager 24.0.0 (nidim)
NI-488.2 23.5 (ni-488.2)
NI-CONTROLLER 24.0 (ni-controller)
NI Network Browser 24.0 (network)
NI MX Routing Utility 24.0.0 (nimru)
NI-MXI 24.0 (ni-mxi)
NI PXI Platform Services 24.0 (ni-pxi)
NI-QPXI 24.0 (ni-qpxi)
NI System Configuration 24.0 (nisyscfg)
NI-VISA 24.0 (ni-visa)
System Configuration API resources found:
pwrtest-ThinkPad-W520
--Primary Expert: NI System Configuration 24.0
--Model Name: 4282AD4
Ethernet Adapter enp0s25
--Primary Expert: NI System Configuration 24.0
ASRL10::INSTR
--Primary Expert: NI-VISA 24.0
ASRL11::INSTR
--Primary Expert: NI-VISA 24.0
ASRL12::INSTR
--Primary Expert: NI-VISA 24.0
ASRL13::INSTR
--Primary Expert: NI-VISA 24.0
ASRL14::INSTR
--Primary Expert: NI-VISA 24.0
ASRL15::INSTR
--Primary Expert: NI-VISA 24.0
ASRL16::INSTR
--Primary Expert: NI-VISA 24.0
ASRL17::INSTR
--Primary Expert: NI-VISA 24.0
ASRL18::INSTR
--Primary Expert: NI-VISA 24.0
ASRL19::INSTR
--Primary Expert: NI-VISA 24.0
ASRL1::INSTR
--Primary Expert: NI-VISA 24.0
ASRL20::INSTR
--Primary Expert: NI-VISA 24.0
ASRL21::INSTR
--Primary Expert: NI-VISA 24.0
ASRL22::INSTR
--Primary Expert: NI-VISA 24.0
ASRL23::INSTR
--Primary Expert: NI-VISA 24.0
ASRL24::INSTR
--Primary Expert: NI-VISA 24.0
ASRL25::INSTR
--Primary Expert: NI-VISA 24.0
ASRL26::INSTR
--Primary Expert: NI-VISA 24.0
ASRL27::INSTR
--Primary Expert: NI-VISA 24.0
ASRL28::INSTR
--Primary Expert: NI-VISA 24.0
ASRL29::INSTR
--Primary Expert: NI-VISA 24.0
ASRL2::INSTR
--Primary Expert: NI-VISA 24.0
ASRL30::INSTR
--Primary Expert: NI-VISA 24.0
ASRL31::INSTR
--Primary Expert: NI-VISA 24.0
ASRL32::INSTR
--Primary Expert: NI-VISA 24.0
ASRL3::INSTR
--Primary Expert: NI-VISA 24.0
ASRL4::INSTR
--Primary Expert: NI-VISA 24.0
ASRL5::INSTR
--Primary Expert: NI-VISA 24.0
ASRL6::INSTR
--Primary Expert: NI-VISA 24.0
ASRL7::INSTR
--Primary Expert: NI-VISA 24.0
ASRL8::INSTR
--Primary Expert: NI-VISA 24.0
ASRL9::INSTR
--Primary Expert: NI-VISA 24.0
USB0::0x0A5C::0x217F::402CF4E1EB51::2::RAW
--Primary Expert: NI-VISA 24.0
--Model Name: Broadcom Bluetooth Device
--Serial Number: 402CF4E1EB51
USB0::0x17EF::0x1003::NI-VISA-2003::RAW
--Primary Expert: NI-VISA 24.0
--Model Name: Integrated Smart Card Reader
--Serial Number: NI-VISA-2003
- pyvisa with IVI NI backend does not show the device:
import pyvisa
rm = pyvisa.ResourceManager()
rm.list_resources()
('ASRL1::INSTR', 'ASRL2::INSTR', 'ASRL3::INSTR', 'ASRL4::INSTR', 'ASRL5::INSTR', 'ASRL6::INSTR', 'ASRL7::INSTR', 'ASRL8::INSTR', 'ASRL9::INSTR', 'ASRL10::INSTR', 'ASRL11::INSTR', 'ASRL12::INSTR', 'ASRL13::INSTR', 'ASRL14::INSTR', 'ASRL15::INSTR', 'ASRL16::INSTR', 'ASRL17::INSTR', 'ASRL18::INSTR', 'ASRL19::INSTR', 'ASRL20::INSTR', 'ASRL21::INSTR', 'ASRL22::INSTR', 'ASRL23::INSTR', 'ASRL24::INSTR', 'ASRL25::INSTR', 'ASRL26::INSTR', 'ASRL27::INSTR', 'ASRL28::INSTR', 'ASRL29::INSTR', 'ASRL30::INSTR', 'ASRL31::INSTR', 'ASRL32::INSTR')
When I try using the pyvisa-py backend I am seeing the USB Agilent device:
import pyvisa
rm = pyvisa.ResourceManager('@py)
rm.list_resources()
('USB0::2391::1287::MY44009773::0::INSTR',)
I am expecting the same 'USB0::2391::1287::MY44009773::0::INSTR' device to show up using the IVI ni backend.
I was able to get the USB devices to be recognized after running the following commands followed by a reboot....
The GPIB device is still not recognized however