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 MIT license.

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.25.tar.gz (11.3 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.25-py3-none-any.whl (13.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: iomatchbox-0.25.tar.gz
  • Upload date:
  • Size: 11.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for iomatchbox-0.25.tar.gz
Algorithm Hash digest
SHA256 f9d28c099d4f1be561d1bdf9ceb3c17c6bd932090c63c51da371691bf2dc021e
MD5 4bc123e4eadf9de877f102dcfbc4164e
BLAKE2b-256 56bb2bf424ea7a18e8a3dafea572af7dd9e394f81b87911d0292c38a064b9d45

See more details on using hashes here.

File details

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

File metadata

  • Download URL: iomatchbox-0.25-py3-none-any.whl
  • Upload date:
  • Size: 13.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.13.2

File hashes

Hashes for iomatchbox-0.25-py3-none-any.whl
Algorithm Hash digest
SHA256 6f39cc411d09f42dae18e38eeb0e4ed10a218547e207eedda8da3ee8b7c59362
MD5 534f9c7bd57e61a68510420e3e29b2ba
BLAKE2b-256 500f534d4214ab3280c0414694300e7de327e9260f0f50a902ab603eefd94590

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