Python library for interfacing with Newport Model 300-500B Series Laser Diode Driver
Project description
Newport Model 300-500B Series Laser Diode Driver Python USB Package (for Linux)
This package is developed within the advisory of the Gallicchio Research Group, Harvey Mudd College.
Pre-requisites
- Permission to connect to the Newport Laser Diode Driver USB device
- Python version >= 3
Set-up
Allow the Newport Laser Diode Driver USB device to be managed by Python
Run the Run the following shell command:
usb-devices # this allows us to see the idVendor and idProduct of all USB devices
Ensure that the idVendor and idProduct match the example below unless change the idVendor and idProduct to the appropriate values. The process below grants permission for our package to manage the specified Newport USB device.
Run the following shell command:
cd /etc/udev/rules.d/ ;
sudo touch 99-usb-permissions.rules ;
sudo vim 99-usb-permissions.rules ; # you can use other text editor of your choosing
Copy & paste the following line into the file:
# Newport Model 300-500B Series Laser Diode Driver
ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="104d", ATTRS{idProduct}=="1001", MODE="0666"
Then, type :wq and press ENTER to save the changes and close the file
Run the following shell command:
sudo udevadm control --reload ;
sudo udevadm trigger ;
Usage
In your desired Python environment, run the following shell command:
pip install newport-laser-diode-driver
Here is an example snippet of how a Laser Driver object could be instantiated:
from newport_laser_diode_driver import NewportLaserDiodeDriver
model_535B = NewportLaserDiodeDriver(idVendor=0x104d, idProduct=0x1001)
print(model_535B.identifier) # obtain the identification string of the device
model_535B.set_current_set_point(10.0) # set current set point to be 10.0 mA
current = model_535B.get_current_set_point() # get the current set point
print(current) # 10.0
model_535B.enable_laser_output() # enable laser output
Compatibility and Testing
I have tested this package with the Newport Model 500B Series devices that I have accessed including 505B and 535B. On paper, this package should work with Model 300B Series as well; however, I have no access to the devices to test them out.
Troubleshooting
To check if the device is recognized by the PC, run usb-devices to list all USB devices connected to your PC. If the Newport
device is not found, try connecting the USB cable from the device to your PC first and then restart the Newport device.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file newport_laser_diode_driver-1.1.0.tar.gz.
File metadata
- Download URL: newport_laser_diode_driver-1.1.0.tar.gz
- Upload date:
- Size: 7.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bb01257968fb66cc8981dbdab7ca5f9900186d136943e6d6a4c0eaca66d0b196
|
|
| MD5 |
36bbfb3adeffc6b81894c7c323e3d047
|
|
| BLAKE2b-256 |
4f5343a7515c51d780ec107d036ec3b3bf8134d178a778d2a72f4333eaea174e
|
File details
Details for the file newport_laser_diode_driver-1.1.0-py3-none-any.whl.
File metadata
- Download URL: newport_laser_diode_driver-1.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
71539461b7f23dc26e4e9469ab977587c7387aec077e4ccef84afad3cc64bd17
|
|
| MD5 |
98298bdea24fb8f4337d274878cc5225
|
|
| BLAKE2b-256 |
1ae2e7c10a80e197be6373b50a8ef4d7d855685ef7d3f622c0a09910f205dd41
|