Since Newport only provides driver support for Windows, we previously faced issues communicating with Newport/NewFocus 8742 picomotor controllers from CyMAC/Linux. While the USB driver for these does not provide a traditional serial port interface, you can still communicate with them using ASCII commands sent through their USB endpoints. This functionality can be utilized in all the PyUSB library operating systems. I ported an older code written in Python2.7 for Mac to CyMAC Debian Linux (Python3.9). It seems to work well for the testbedAI picomotors. Code attached. Requires pyusb library and sudo permission (as of now). We need Product-ID and Vendor-ID for each device. This can be easily obtained via lsusb from the terminal.
For 8742 controllers,
idProduct = '0x4000'
idVendor = '0x104d'
To setup:
conda create -n "newport_controller" python==3.9
conda activate newport_controller
pip install pyusb
Example:
sudo /home/controls/miniconda3/envs/newport_controller/bin/python newport_8742_controller.py
# to rotate counter-clockwise motor1 (say in yaw) by 100 units
Input > 1PR-100
# to rotate clockwise motor1 (say in pitch) by 50 units
Input > 2PR+50