LL

Tunable Laser O-band

May 3, 20233 min read

Github Link

TLX3 Tunable Laser Source

This tunable O-band laser source from Thorlabs can be controlled via serial communication using USB or RS-232 ports.

Prerequisite

Please install the PySerial package by running the following command:

Copy A solid styled icon from Orion Icon Library.
pip install pyserial

Also install the Thorlabs software if you are using the USB communication.

Example

Copy A solid styled icon from Orion Icon Library.
import time
from tlx3 import TLX3


def main():
    port = "COM3"  # Replace with the appropriate COM port for your TLX3
    tlx3 = TLX3(port)

    # Connect to the TLX3
    tlx3.connect()

    # Set and get the wavelength
    wavelength = 1550000  # in pm
    tlx3.set_wavelength(wavelength)
    print(f"Set wavelength to {wavelength} pm")

    current_wavelength = tlx3.get_wavelength()
    print(f"Current wavelength: {current_wavelength} pm")

    # Set laser power on
    tlx3.set_laser_on(1)
    print("Laser power on")

    # Wait for 5 seconds
    time.sleep(5)

    # Get laser status and power
    laser_status = tlx3.get_laser_status()
    laser_power = tlx3.get_laser_power()
    print(f"Laser status: {laser_status}, Laser power: {laser_power}")

    # Set laser power off
    tlx3.set_laser_on(0)
    print("Laser power off")

    # Disconnect from the TLX3
    tlx3.disconnect()

if __name__ == "__main__":
    main()

This example code does the following:

  1. Imports the necessary modules and the TLX3 class from the tlx3.py file provided.

  2. Defines a main function that:

    • Assumes you have your TLX3 connected to a serial port.
    • Connects to the TLX3 device.
    • Sets the wavelength (in pm).
    • Gets the current wavelength (in pm).
    • Sets the laser power on.
    • Waits for 5 seconds, and then gets the laser status and power.
    • Sets the laser power off.
    • Disconnects from the TLX3.

Make sure to replace the port variable with the appropriate COM port for your TLX3. See 'Tutorials' section for more details.