I do not have any prior experience in Python and was trying to see if I can query information from a device with USB VISA address. I am running a Raspbian GNU/Linux 9 (stretch) with a Python 3.5.3 Shell. The VISA packages for python was installed using pip3:
$ sudo pip3 install pyvisa-py
Since I am interfacing the device with USB interface, I installed the python USB package as well.
$ sudo pip3 install pyusb
When I use the generic commands as per PyVISA website, I am able to read the partial VISA address without the serial number as shown below:
>>> import visa
>>> rm = visa.ResourceManager()
>>> print(rm.list_resources())
Found a device whose serial number cannot be read. The partial VISA resource name is: USB0::2391::11032::???::0::INSTR
('ASRL/dev/ttyAMA0::INSTR',)
Here is the python VISA info:
$ python3 -m visa info
Machine Details:
Platform ID: Linux-4.14.62-v7+-armv7l-with-debian-9.4
Processor:
Python:
Implementation: CPython
Executable: /usr/bin/python3
Version: 3.5.3
Compiler: GCC 6.3.0 20170124
Bits: 32bit
Build: Jan 19 2017 14:11:04 (#default)
Unicode: UCS4
PyVISA Version: 1.9.1
Backends:
ni:
Version: 1.9.1 (bundled with PyVISA)
Binary library: Not found
py:
Version: 0.3.0
TCPIP SOCKET: Available
GPIB INSTR:
Please install linux-gpib to use this resource type.
No module named 'gpib'
USB INSTR: Available via PyUSB (1.0.2). Backend: libusb1
ASRL INSTR: Available via PySerial (3.2.1)
USB RAW: Available via PyUSB (1.0.2). Backend: libusb1
TCPIP INSTR: Available
Not sure what I am doing wrong. How do I read the full VISA resource name? Without that, even if I try to force open the device with the full VISA address, it would throw another error.