Skip to main content

No project description provided

Project description

Newport Model 300-500B Series Laser Diode Driver Python 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 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 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.0.4.tar.gz (5.9 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.0.4-py3-none-any.whl (7.0 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.4.tar.gz
Algorithm Hash digest
SHA256 857a2405d82f970f7e5c438d09fdac3dc9bc0e3f190419de4f0babae1df72fe0
MD5 160b96609675eaaba6e1e1ca38c0fc03
BLAKE2b-256 048e6db6df4b3d3543cc98968f17a36d83c1fa662fe2a6da1b42ce1b0b0fecdc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 41086a8da7ecd37ade0c4bce1d0bc941cbbe05a27234d727093295ae3415c738
MD5 f965ec83c929379f448f21b164cec79e
BLAKE2b-256 2a3a4e6b11a1758aad4a1ace0220af230f32eb235ce3ec5adb8d9f9aee6c690d

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