This SDK allows you to discover, control, and monitor Vortran Stradus and OBIS lasers using Python.
- Discover connected lasers
- Set power levels
- Enable/disable emission
- Monitor laser status (power, temperature, faults, etc.)
- Poll Stradus diagnostic data (OP2–OP5 commands)
Clone the repository and install using:
pip install .If you have the .whl file, install it using:
pip install laser_sdk-0.1.1-py3-none-any.whlReplace the filename with your specific version if different.
import time
from laser_sdk import LaserSDK
sdk = LaserSDK()
sdk.discover()
for laser in sdk.get_lasers():
print(f"Discovered: {laser.laser_id} - {laser.wavelength}nm")
# Set power to 10 mW
laser.set_power(10)
# Enable emission
laser.enable()
print(f"Emission enabled for {laser.laser_id}")
time.sleep(2)
# Disable emission
laser.disable()
# Disconnect the laser
laser.disconnect()To access diagnostic data for Stradus lasers using OP2–OP5 commands:
from laser_sdk.lasers import StradusLaser
for laser in sdk.get_lasers():
if isinstance(laser._laser, StradusLaser): # Access the underlying laser instance
print("OP2:", laser._laser.get_op2())
print("OP3:", laser._laser.get_op3())
print("OP4:", laser._laser.get_op4())
print("OP5:", laser._laser.get_op5())Each laser instance (Stradus or OBIS) supports the following methods:
laser.set_power(mW: float)
laser.enable(state: bool = True)
laser.disable()
laser.emission_status() -> bool
laser.interlock_status() -> bool
laser.warmup_status() -> bool
laser.poll() -> dict
laser._laser.get_op2() -> dict
laser._laser.get_op3() -> dict
laser._laser.get_op4() -> dict
laser._laser.get_op5() -> dict