From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

NI-VISA - USB devices not recognized - Linux (Ubuntu 20.04 LTS kernel 5.15)

Hi all,

 

I'm trying to interface with a USB Test and Measurement device. In the end, I want to be able to interface with the device from my own C++ program in a Linux environment. However, I'm unable to list the USB device under Linux through the NI-VISA API, whereas on Windows it works perfectly fine. On Linux, the device does not show up in the provided control software such as the Visa Configuration and Visa Interactive Control software.

 

I tested with multiple USBTMC compliant devices, but no luck. However, when connecting a device, they are al listed in the /dev/ directory as 'usbtmc1'. So the device is properly recognized by the linux kernel, but not by the VISA software. In comparison, on Windows, the USBTMC devices are perfectly recognized in the Interactive Control Software, and I've been able to communicate with the devices just fine.

 

What I've tried so far:

- Clean install of Ubuntu 20.04 LTS Kernel 5.15 on two separate devices (one through dual boot, another with only Ubuntu)

- Reinstall of the NI-VISA drivers.

- Changed to root mode

- Changed USB device permissions permanently

 

Also, I started out with Ubuntu 22.04 LTS, but I've been unable to get the software working. When I saw, it was not fully supported, I switched to Ubuntu 20.04.

 

Any suggestions?

Thanks in advance!

 

Kind regards,

 

Ulrik Van Hecke

 

0 Kudos
Message 1 of 2
(2,197 Views)

4. Notes on USB devices
Sometimes VISA might not see USB-based devices (no device on list, "Resource Busy" error, etc.)

In case that happens, try these things.

(a) run as root
You may be able to use USB devices only with root priviliges.

This is because sufficient permission to manipulate hardwares is not given to normal users.

Try a script by NI

/usr/local/vxipnp/linux/NIvisa/USB/AddUsbRawPermissions.sh

or add permissions manually

https://github.com/python-ivi/python-usbtmc#configuring-udev

(b) unload usbtmc kernel module
Another common situation is that a native kernel usbtmc modules is blocking access from VISA.

To check if it is loaded: $ lsmod | grep usbtmc
If it is: # rmmod usbtmc, and see if it works.
If it does, consider "blacklisting" it: # echo 'blacklist usbtmc' > /etc/modprobe.d/nousbtmc.conf

 

------------------------

https://forums.ni.com/t5/Linux-Users/Using-NI-VISA-with-Arch-Linux-or-Ubuntu-14-04/m-p/3462358?profi...

0 Kudos
Message 2 of 2
(2,168 Views)