navigate.model.devices.APIs.omicron.LuxxLaser.LuxxLaser
- class navigate.model.devices.APIs.omicron.LuxxLaser.LuxxLaser(comport)
Bases:
LaserBase
- __init__(comport)
# Luxx Laser Class # LUXX488, 200 mW, is COM19 # LUXX642, 140 mW, is COM17 # LIGHTHUB ULTRA, is COM20 # Open port (auto stands for /dev/ttyUSB0 in Linux or COM17 # in Windows, because it is what I use); then get device model; # finally, get maximum output power and store it in pmax variable.
Methods
__init__
(comport)# Luxx Laser Class # LUXX488, 200 mW, is COM19 # LUXX642, 140 mW, is COM17 # LIGHTHUB ULTRA, is COM20 # Open port (auto stands for /dev/ttyUSB0 in Linux or COM17 # in Windows, because it is what I use); then get device model; # finally, get maximum output power and store it in pmax variable.
ask
(command)# Write, then read.
close
()# Close the port before exit.
# Check if light is emitted on powerup.
# print contents of failure byte # Bit description: # 15 Diode power exceeded maximum value # 14 An internal error occured # 12 The temperature at the diode exceeded the valid temperature range # 11 The ambient temperature exceeded the minimum or maximum value # 10 The current through the diode exceeded the maximum allowed value # 9 The interlock loop is not closed.
get_mode
()# Get the current mode.
# print a table showing laser status.
# Get the current power value in mW
# Initialize lasers.
read
()# Read all information from the port and return it as string.
set_autostart
(state)# Decide if light is emitted on powerup.
set_mode
(mode)# The device is able to work in the following modes: # * Standby # Laser is ready, but no emission is produced.
set_power
(power)Set the desired power in mW TODO: Intermittent failure due to list index out of range in self.ask (line 115)
smart_ask
(command)# TODO: Not working. Depends on broken print_hex function. Several commands return information coded in ASCII HEX numbers. The relevant are bits in the registers. For convenient representation, we will print(these bytes in tables. This is relevant for the following commands: * GOM * GFB * GLF * GLP For all other commands the behavior is identical to ask function.
start
()# Start the emission (takes about 3 seconds)
stop
()# Stop the emission immediately
turn_off
()Turn off the laser
turn_on
()Turn on the laser
write
(command)# Send command to device.
Attributes
- ask(command)
# Write, then read. # Uses regular expressions to clean up response from the device # !UK = Unknown command
- close()
# Close the port before exit.
- get_autostart()
# Check if light is emitted on powerup.
- get_errors()
# print contents of failure byte # Bit description: # 15 Diode power exceeded maximum value # 14 An internal error occured # 12 The temperature at the diode exceeded the valid temperature range # 11 The ambient temperature exceeded the minimum or maximum value # 10 The current through the diode exceeded the maximum allowed value # 9 The interlock loop is not closed. Please close the interlockt loop # 8 Overvoltage or Undervoltage lockout occured. Bring supply voltage to # a valid range # 4 If CDRH-Bit is set and no CDRH-Kit is connected or # CDRH-Bit is not set but a CDRH-Kit is connected # CDRH-Kit is a box with a key, a LED and an interlock # 0 Soft interlock: If an interlock error occurs, this bit is set. # It can only be reset by resetting the whole system, even if the # interlock error is not present anymore. # Bits 1, 2, 3, 5, 6, 7, 13 are reserved
- get_mode()
# Get the current mode.
- get_parameters()
# print a table showing laser status. # Bit description: # 15 Auto PowerUP if ONE # 14 Autostart (emission at powerup) if ONE # 13 Adhoc USB - Laser sends info messages from time to time if ONE # 8 Power control (APC) mode if ONE; current control (ACC) if ZERO # 7 External analog input enabled if ONE # 4 Mod level: ONE - active; ZERO - not active # 3 Bias level: ONE - active; ZERO - not active # Bits 0, 1, 2, 5, 6, 9, 10, 11, 12 are reserved
- get_power()
# Get the current power value in mW
- initialize_laser()
# Initialize lasers. # Sets the laser to the maximum power, and sets the mode to CW-APC.
- read()
# Read all information from the port and return it as string.
- set_autostart(state)
# Decide if light is emitted on powerup.
- set_mode(mode)
# The device is able to work in the following modes: # * Standby # Laser is ready, but no emission is produced. However, if we # it is turned on (e.g. with start function), then change to # other mode will result in immediate emission, i.e. without # 3 seconds delay. # * CW-ACC # constant wave, automatic current control # * CW-APC # constant wave, automatic power control # * Analog # the output power is dependent on the analog input; however, # it cannot exceed the specified with set_power value.
- set_power(power)
Set the desired power in mW TODO: Intermittent failure due to list index out of range in self.ask (line 115)
- smart_ask(command)
# TODO: Not working. Depends on broken print_hex function. Several commands return information coded in ASCII HEX numbers. The relevant are bits in the registers. For convenient representation, we will print(these bytes in tables. This is relevant for the following commands:
GOM
GFB
GLF
GLP
For all other commands the behavior is identical to ask function
- start()
# Start the emission (takes about 3 seconds)
- stop()
# Stop the emission immediately
- turn_off() → None
Turn off the laser
- turn_on() → None
Turn on the laser
- write(command)
# Send command to device. Preceed it with “?” und end with CR.
- configuration
Configuration dictionary
- Type:
dict
- device_config
Laser ID
- Type:
int
- device_connection
Communication instance with the device
- Type:
Any
- microscope_name
Name of the microscope
- Type:
str