Skip to content

pycobolt API

Charlotte-Cobolt edited this page May 17, 2021 · 3 revisions

Functions

list_lasers()

Return a list of laser objects for all cobolt lasers connected to the computer

Classes

class CoboltLaser (port=None, serialnumber=None, baudrate=115200)

Creates a laser object using either COM-port or serial number to connect to laser. 
Will automatically return proper subclass, if applicable. 
If you are uncertain about your laser type, initiate as CoboltLaser.

Subclasses

Cobolt06DPL Cobolt06MLD 

Methods

clear_fault()

Clear laser fault

connect()

Connects the laser on using a specified COM-port (preferred) or serial number. 
Will throw exception if it cannot connect to specified port
or find laser with given serial number

constant_current(current=None)

Enter constant current mode, current in mA. If current=None, the laser will use previously saved settings

constant_power(power=None)

Enter constant power mode, power in mW. If power=None, the laser will use previously saved settings

disconnect()

Disconnect the laser

get_current()

Get laser current in mA

get_current_setpoint()

Get laser current setpoint in mA

get_fault()

Get laser fault

get_mode()

Get operating mode

get_ophours()

Get laser operational hours

get_power()

Get laser power in mW

get_power_setpoint()

Get laser power setpoint in mW

get_state()

Get autostart state

interlock()

Returns: 0 if closed, 1 if open

is_connected()

Ask if laser is connected

is_on()

Ask if laser is turned on

send_cmd(message, timeout=1)

Sends a message to the laset and awaits response until timeout (in s).

Returns:
The response recieved from the laser is string format or
"Syntax Error: No response" on a failed attempt,
"Syntax Error: Write failed" if no connection is available

set_current(current)

Set laser current in mA

set_power(power)

Set laser power in mW

turn_off()

Turn off the laser

turn_on()

Turn on the laser with the autostart sequence.The laser will await the TEC setpoints and pass a warm-up state

class Cobolt06DPL (port=None, serialnumber=None)

For lasers of type 06-DPL. Inherits all methods from CoboltLaser

Methods

analog_modulation(enable)

Enable analog modulation mode by enable=1, turn off by enable=0

digital_modulation(enable)

Enable digital modulation mode by enable=1, turn off by enable=0

get_modualtion_tec_setpoint()

Get the setpoint of the modulation TEC in °C

get_modulation_current()

Return the modulation currrent setpoints in mA as [highCurrent,lowCurrent]

get_modulation_state()

Get the laser modulation settings as [analog, digital]

get_modulation_tec()

Read the temperature of the modulation TEC in °C

modulation_mode(highI=None)

Enter Modulation mode, with possibiity to set the modulation high current level in mA (). 
If high=None, the laser will enter at last saved settings

set_modulation_current_high(highI)

Set the modulation high current in mA

set_modulation_current_low(lowI)

Set the modulation low current in mA

set_modulation_tec(temperature)

Set the temperature of the modulation TEC in °C

class Cobolt06MLD (port=None, serialnumber=None)

For lasers of type 06-MLD. Inherits all methods from CoboltLaser.

Methods

analog_modulation(enable)

Enable analog modulation mode by enable=1, turn off by enable=0

digital_modulation(enable)

Enable digital modulation mode by enable=1, turn off by enable=0

get_analog_impedance()

Get the impedance of the analog modulation
returns: 0 for HighZ and 1 for 50 Ohm

get_modulation_power()

Get the modulation power setpoint in mW

get_modulation_state()

Get the laser modulation settings as [analog, digital]

modulation_mode(self, power=None)

Enter modulation mode with the possibility to set modulation power in mW. 
If power=None, the laser will use last saved settings

on_off_modulation(enable)

Enable On/Off modulation mode by enable=1, turn off by enable=0

set_analog_impedance(arg)

Set the impedance of the analog modulation by
arg=0 for HighZ and
arg=1 for 50 Ohm

set_modulation_power(power)

Set the modulation power in mW