Skip to main content

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

Here is an example snippet of how a Laser Driver object could be instantiated:

from 

model_535B = NewportLaserDriver(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

newport_laser_diode_driver-1.0.0.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.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.0.tar.gz
Algorithm Hash digest
SHA256 4d0e3460cacc9644c819a4bdfc10af8e7931f8b874f45101136b9158ec58704e
MD5 872131868f6ebca9c86aa74e75c99cc5
BLAKE2b-256 f14637878e93c3cf66006b92077c74e19b2dc34a13224dccb01f545cc5705753

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fe295fe40fd4ff317f160f24d16476044dfed26de2e1320da26dfbae816475e3
MD5 a931fc8640851dd5dd6ed795a9a69784
BLAKE2b-256 53b7f7aed5d5db18a19ed80400dc6f8153dee82ffed6382b45c6a11d7e4d9d75

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