Skip to content

sthronevlt/VersaLSS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laser SDK

This SDK allows you to discover, control, and monitor Vortran Stradus and OBIS lasers using Python.

Features

  • Discover connected lasers
  • Set power levels
  • Enable/disable emission
  • Monitor laser status (power, temperature, faults, etc.)
  • Poll Stradus diagnostic data (OP2–OP5 commands)

Installation

Option 1: From GitHub source (for development)

Clone the repository and install using:

pip install .

Option 2: From a prebuilt .whl file

If you have the .whl file, install it using:

pip install laser_sdk-0.1.1-py3-none-any.whl

Replace the filename with your specific version if different.

Basic Usage

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()

Advanced Usage

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())

Documentation

Laser object methods

Each laser instance (Stradus or OBIS) supports the following methods:

Sets the laser's target output power in milliwatts.

laser.set_power(mW: float)

Turns laser emission on (True) or off (False).

laser.enable(state: bool = True)

Turns off laser emission (equivalent to laser.enable(False)).

laser.disable()

Returns True if emission is enabled, otherwise False.

laser.emission_status() -> bool

Returns True if the interlock is closed (safe), otherwise False.

laser.interlock_status() -> bool

Returns True if the laser is still warming up, otherwise False.

laser.warmup_status() -> bool

Returns a dictionary of key laser status values (temperature, current, power, etc.).

laser.poll() -> dict

Additional methods for Stradus lasers

If the laser is a Vortran Stradus, additional diagnostic commands are available:

Returns real-time power, current, and temperature data.

laser._laser.get_op2() -> dict

Returns firmware version, rated power, and wavelength info.

laser._laser.get_op3() -> dict

Returns fault status, interlock state, hours of operation, and more.

laser._laser.get_op4() -> dict

Returns low-level current readings from internal laser systems.

laser._laser.get_op5() -> dict

Note: These get_opX() methods are only available for Stradus lasers. Always check if the laser ID starts with "Stradus" before calling them.

About

Software for VersaLSS multi-laser systems

Resources

Stars

Watchers

Forks

Packages

No packages published