Skip to main content

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

newport_laser_diode_driver-1.1.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

newport_laser_diode_driver-1.1.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file newport_laser_diode_driver-1.1.0.tar.gz.

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.1.0.tar.gz
Algorithm Hash digest
SHA256 bb01257968fb66cc8981dbdab7ca5f9900186d136943e6d6a4c0eaca66d0b196
MD5 36bbfb3adeffc6b81894c7c323e3d047
BLAKE2b-256 4f5343a7515c51d780ec107d036ec3b3bf8134d178a778d2a72f4333eaea174e

See more details on using hashes here.

File details

Details for the file newport_laser_diode_driver-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 71539461b7f23dc26e4e9469ab977587c7387aec077e4ccef84afad3cc64bd17
MD5 98298bdea24fb8f4337d274878cc5225
BLAKE2b-256 1ae2e7c10a80e197be6373b50a8ef4d7d855685ef7d3f622c0a09910f205dd41

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page