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

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

newport_laser_diode_driver-1.0.1.tar.gz (3.4 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.1-py3-none-any.whl (3.9 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b21d13888b07b88ef41c015e052fbceb898af54fb735c1f72a2a669c16bbef74
MD5 f724c1c7b010e0e91ba5364e4e813bb7
BLAKE2b-256 a08cc24cc0231a0bf0312a565410d9c17b7ecee298e7f8c1e947ae8f2e03d846

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for newport_laser_diode_driver-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9fda2e085afe7150f6b2f8217a8b7728123d1a7d798a721900cb14025a52f8e0
MD5 7b8bc97b3241a583c8519789366cdbbd
BLAKE2b-256 b9a8d05fd95b28e4fc1ab02969e2cf430b9f881eb79df781cd4551f0d412d5f2

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