Skip to main content

Functions and examples to control Integrated Optics CW lasers and standalone TECs through serial commands with Python

Project description

IOmatchbox

Functions and examples to control Integrated Optics CW lasers and standalone TECs through serial commands with Python.

The official software can be found on the Supplier Download Site

Documentation is also available through the same website. The serial commands have been taken from the User Manual (MB_IO_2.5_Continuous_Wave_Laser_Users_Manual.pdf).

There is no official documentation for the Stand-alone Air Cooled Heatsink with TEC (AM-H09/10/11). Thus I just used the commands of the laser as far as they worked.

Requirements

Needs serial and pyserial (both of them are needed for this to work somehow), best installed through:

pip install serial pyserial

Usage

Simply run

pip install IOmatchbox

Then in your Python script invoke the functions by

from IOmatchbox import IOM, IOT
iom = IOM()
iot = IOT()

With iom you can then call all functions and methods of the laser, with iot you can communicate with the external TEC.

Get some more info with

iom.get_settings()
iom.get_readings()
iom.laser_status()

Fire up the laser with

iom.start_laser()

Stop the laser with

iom.stop_laser()

Disconnect with

iom.closelaser()

To see all functions, simply use

help(iom)

More examples in example.py. Includes also commands to communicate with the TEC though they are still not complete.

Warning: Do NOT enable autostart of the TEC. It will just start heating at maximum power no matter what is the setpoint. This is a serious bug and will kill your laser.

Access Codes

Most setting changes require a change of access level which can be done with

iom.set_access_level(3)

However, you need a 5-digit access code for level 2 and 3 that you need to request from the supplier. Level 1 can be accessed by default.

Serial ports

By default the openlaser()-function will use all the ports found under /dev/ttyUSB* (Windows: COM[0-255]), try to connect through serial and check the productcode. If the first three digits of the product are a number it will assume that it found a CW laser and stay with that connection. This is to distinguish the port from a port that is potentially connected to a TEC. You can also manually put a port in the openlaser-function.

You need write-access to the tty-port. Either run as the admin or change the permissions or the ownership on the serial port, preferably with a udev rule, e.g. something like /etc/udev/rules.d/80-usb-serial.rules

SUBSYSTEM=="tty", MODE="0666"

(After changing run as root: udevadm control --reload-rules && udevadm trigger)

Status

This is under development but I hope it will be helpful for fellow users. Comments and suggestions highly welcome.

License

This project is licensed under the Apache-2.0 license. Copyright 2025 iancynk

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

iomatchbox-0.27.tar.gz (14.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

iomatchbox-0.27-py3-none-any.whl (16.4 kB view details)

Uploaded Python 3

File details

Details for the file iomatchbox-0.27.tar.gz.

File metadata

  • Download URL: iomatchbox-0.27.tar.gz
  • Upload date:
  • Size: 14.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for iomatchbox-0.27.tar.gz
Algorithm Hash digest
SHA256 655c1ac3f25dedd5c836cac7301c3e64ce646e2a5e2667b3121184bc67a9acea
MD5 d8de6da331b6eb4c7d56bf20aea0242c
BLAKE2b-256 bbbec4e256eccd6dbb4a65637251b87ad1652ecddfc6a2388b7d699ac83849c3

See more details on using hashes here.

File details

Details for the file iomatchbox-0.27-py3-none-any.whl.

File metadata

  • Download URL: iomatchbox-0.27-py3-none-any.whl
  • Upload date:
  • Size: 16.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for iomatchbox-0.27-py3-none-any.whl
Algorithm Hash digest
SHA256 537e1705e657915e5ef97f4dce28d15ae54d68ca7bb231261e7d903aa50d3f0c
MD5 5b4cc5a2e51b2bd9520ea778ad35d0ff
BLAKE2b-256 b37cff74f09f727f742b3f43deba80ee52512040fbda1cd30884f58d6c0c7ce3

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