No project description provided
Project description
Newport Model 300-500B Series Laser Diode Driver USB Package (for Linux)
Pre-requisites
- Permission to connect to the Newport Laser Diode Driver USB device
- Python version >= 3
- pyusb library
Set-up
Allow the Newport Laser Diode Driver USB device to be managed by Python ref
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.
Run the following shell command:
cd /lib/udev/rules.d/ ;
sudo touch 50-Newport_Laser_Diode_Driver.rules ;
sudo vim 50-Newport_Laser_Diode_Driver.rules ;
Copy & paste the following line into the file: ACTION=="add", SUBSYSTEMS=="usb", ATTRS{idVendor}=="104d", ATTRS{idProduct}=="1001", MODE="660", GROUP="plugdev"
Then, type :wq and press ENTER to save the changes
Run the following shell command:
sudo adduser USERNAME plugdev ; # don't forget to change the USERNAME
sudo udevadm control --reload ;
sudo udevadm trigger ;
Prepare Python and dependencies
In your desired Python environment, run the following shell command:
pip install pyusb # should be already installed by default
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)
identifier = model_535B.get_identification() # obtain the identification
print(identifier)
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
Troubleshooting
To check if the device is recognized by the PC, run lsusb 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 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.0.2.tar.gz.
File metadata
- Download URL: newport_laser_diode_driver-1.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87ffdf9d30b8eaee8ea696211e0497fc5c71dac3de788f347a17ed788b25534a
|
|
| MD5 |
e420bd5a03baebc468f385d0d567ba2e
|
|
| BLAKE2b-256 |
d0327d743d39bfba1af510daf31844f7e228e19caa11b6dea6d8ce18dcc5600d
|
File details
Details for the file newport_laser_diode_driver-1.0.2-py3-none-any.whl.
File metadata
- Download URL: newport_laser_diode_driver-1.0.2-py3-none-any.whl
- Upload date:
- Size: 3.9 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 |
aeb5620dac3532d4bcc6a8fc18f6574378734fff835b08bb8f4d4ea32d65b6f0
|
|
| MD5 |
8add98e47de253884c90d6e8dc672837
|
|
| BLAKE2b-256 |
74be7a3dba0b8622483d02345eacc739b9a65323f55d60d050f041486bcda941
|