I am trying to communicate with a Newport ESP300 motion controller using python 3.10 on a Linux machine. Either USB or Serial connection will work but I can't connect with either.
I started with a clean install (minimal) of Linux Ubuntu 22.04.3 LTS. Then, installed NI drivers (ni-ubuntu2204-drivers-2023Q4.deb
) and NI-VISA. That seemed to work as no errors were generated. When I install pyVISA and create ResourceManager, I just get a list of 33 ASRLx::INSTR ports. When I install pyMeasure and list resources I see the same 33 but with the error (repeated for each of the 33 ports.
0 : ASRL1::INSTR : Visa IO Error: check connections
VI_ERROR_NPERMISSION (-1073807192): Access to the resource or remote machine is denied. This is due to lack of sufficient privileges for the current user or machine
My pyvisa-info (all python packages installed in virtual environment):
(practice) physix@physix-Latitude-E7470:~$ pyvisa-info
Machine Details:
Platform ID: Linux-6.2.0-37-generic-x86_64-with-glibc2.35
Processor: x86_64
Python:
Implementation: CPython
Executable: /home/physix/Projects/practice/bin/python3
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.23.8.0:
found by: auto
architecture:
('x86', 64)
Vendor: National Instruments
Impl. Version: 24119296
Spec. Version: 7340032
py:
Version: 0.7.1
ASRL INSTR: Available via PySerial (3.5)
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: ok
- hislip: ok
TCPIP SOCKET: Available
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'
So far, I have tried (unsuccessfully) the following:
sudo chmod 777 /dev
sudo usermod -a -G tty physix
echo 'SUBSYSTEM=="usb", MODE="0666", GROUP="usbusers"' >> /etc/udev/rules.d/99-com.rules
sudo udevadm trigger
- add output from
hostname -I
to visa configuration, security, allow access
To communicate with ESP300 motion controller, start with a clean install of Ubuntu 22.04. Forget about NI-VISA; for this simple instrument it's not necessary. I connected the ESP300 to a Dell Inspiron laptop via USB to Serial cable (with FTDI chip). Install the necessary python packages in the environment:
I did the next part in VS Code but Jupyter Notebook also works.
I didn't need any special drivers, but I had to edit the groups to give myself access to the usb and serial ports.
and just for good measure
All that's left is to modify the ESP class file to program specific routines or whatever. I hope this helps somebody else.