Reports until 17:19, Tuesday 16 April 2024
GRAVITES Optics 1550nm
epolini - posted 17:19, Tuesday 16 April 2024 - last comment - 19:05, Tuesday 23 April 2024(11592)
Thorlabs ULN15TK laser installed in green lab

[Eric, Eleonora]

Today we installed the new 1550nm thorlabs laser in green lab. We connected it to the interlock connecting the red cable to a power strip under the optical bench where the power supplies of both lasers are currently connected. 

How to turn the laser ON/OFF

Open the Command Prompt 

>python

>>import serial

Verify to which COM port the device is connected (it might change after the PC restarts)

>>ser = serial.Serial('COM8', baudrate=9600)

>>ser.write(b'laser on\r')

Now the laser is on and it is emitting 100mW.

To turn it off

>>ser.write(b'laser off\r')

Comments related to this report
epolini - 19:05, Tuesday 23 April 2024 (11606)

How to read the quieries with pyserial

>>> import serial
>>> ser = serial.Serial('COM8', baudrate = 9600)

>>> ser.write(b'laser on\r')
9
>>> ser.write(b'read_param laser_state\r')
23

>>> out = ''
>>> while ser.inWaiting() > 0:
...     out += ser.read(1).decode()
...
>>> print(out)

000: OK

000: OK:60,0x0000

>>> ser.write(b'read_param laser.current\r')
25
>>> while ser.inWaiting() > 0:
...     out += ser.read(1).decode()  --- NB press tab before out
...
>>> print(out)

000: OK

000: OK:60,0x0000

000: OK:0.550000,0x0000

>>> ser.write(b'read_param laser_tec_ctrl.temperature\r')
38
>>> while ser.inWaiting() > 0:
...     out += ser.read(1).decode()
...
>>> print(out)

000: OK

000: OK:60,0x0000

000: OK:0.550000,0x0000

000: OK:24.999786,0x0000 

>>> ser.write(b'read_param fbg_tec_ctrl.temperature\r')
36
>>> while ser.inWaiting() > 0:
...     out += ser.read(1).decode()
...
>>> print(out)

000: OK

000: OK:60,0x0000

000: OK:0.550000,0x0000

000: OK:24.999786,0x0000
000: OK:27.999939,0x0000