msl.equipment.resources.thorlabs.kinesis.integrated_stepper_motors module

This module provides all the functionality required to control a number of Integrated Stepper Motors including:

  • Long Travel Stages (LTS150 and LTS300)

  • Lab Jack (MLJ050, MLJ150)

  • Cage Rotator (K10CR1)

class msl.equipment.resources.thorlabs.kinesis.integrated_stepper_motors.IntegratedStepperMotors(record)[source]

Bases: MotionControl

A wrapper around Thorlabs.MotionControl.IntegratedStepperMotors.dll.

The properties for an IntegratedStepperMotors connection supports the following key-value pairs in the Connections Database:

'device_name': str, the device name found in ThorlabsDefaultSettings.xml [default: None]

Do not instantiate this class directly. Use the connect() method to connect to the equipment.

Parameters:

record (EquipmentRecord) – A record from an Equipment-Register Database.

can_home()[source]

Can the device perform a home()?

Returns:

bool – Whether the device can be homed.

can_move_without_homing_first()[source]

Does the device need to be home()’d before a move can be performed?

Returns:

bool – Whether the device needs to be homed.

check_connection()[source]

Check connection.

Returns:

bool – Whether the USB is listed by the FTDI controller.

clear_message_queue()[source]

Clears the device message queue.

close()[source]

Disconnect and close the device.

disable_channel()[source]

Disable the channel so that motor can be moved by hand.

When disabled, power is removed from the motor and it can be freely moved.

Raises:

ThorlabsError – If not successful.

enable_channel()[source]

Enable channel for computer control.

When enabled, power is applied to the motor so it is fixed in position.

Raises:

ThorlabsError – If not successful.

enable_last_msg_timer(enable, last_msg_timeout)[source]

Enables the last message monitoring timer.

This can be used to determine whether communications with the device is still good.

Parameters:
  • enable (bool) – True to enable monitoring otherwise False to disable.

  • last_msg_timeout (int) – The last message error timeout in ms. Set to 0 to disable.

get_backlash()[source]

Get the backlash distance setting (used to control hysteresis).

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The backlash distance in DeviceUnits (see manual).

get_bow_index()[source]

Gets the stepper motor bow index.

Returns:

int – The bow index.

get_button_params()[source]

Gets the LTS button parameters.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

  • enums.MOT_ButtonModes – The button mode.

  • int – The Preset position in DeviceUnits for the left button (when in preset mode).

  • int – The Preset position in DeviceUnits for the right button (when in preset mode).

  • int – The time that buttons need to be pressed in order to go home or to record a preset buttons defined position.

Raises:

ThorlabsError – If not successful.

get_button_params_block()[source]

Get the button parameters.

Returns:

structs.MOT_ButtonParameters – The button parameters.

Raises:

ThorlabsError – If not successful.

get_calibration_file()[source]

Get the calibration file for this motor.

Returns:

str – The filename of the calibration file.

Raises:

ThorlabsError – If not successful.

get_device_unit_from_real_value(real_value, unit_type)[source]

Converts a real-world value to a device value.

Either load_settings(), load_named_settings() or set_motor_params_ext() must be called before calling this function, otherwise the returned value will always be 0.

Parameters:
  • real_value (float) – The real-world value.

  • unit_type (enums.UnitType) – The unit of the real-world value.

Returns:

int – The device value.

Raises:

ThorlabsError – If not successful.

get_firmware_version()[source]

Gets version number of the device firmware.

Returns:

str – The firmware version.

get_hardware_info()[source]

Gets the hardware information from the device.

Returns:

structs.TLI_HardwareInformation – The hardware information.

Raises:

ThorlabsError – If not successful.

get_hardware_info_block()[source]

Gets the hardware information in a block.

Returns:

structs.TLI_HardwareInformation – The hardware information.

Raises:

ThorlabsError – If not successful.

get_homing_params_block()[source]

Get the homing parameters.

Returns:

structs.MOT_HomingParameters – The homing parameters.

Raises:

ThorlabsError – If not successful.

get_homing_velocity()[source]

Gets the homing velocity.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The homing velocity in DeviceUnits (see manual).

get_jog_mode()[source]

Gets the jog mode.

Returns:

Raises:

ThorlabsError – If not successful.

get_jog_params_block()[source]

Get the jog parameters.

Returns:

structs.MOT_JogParameters – The jog parameters.

Raises:

ThorlabsError – If not successful.

get_jog_step_size()[source]

Gets the distance to move when jogging.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The step size in DeviceUnits (see manual).

get_jog_vel_params()[source]

Gets the jog velocity parameters.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

  • int – The maximum velocity in DeviceUnits (see manual).

  • int – The acceleration in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

get_led_switches()[source]

Get the LED indicator bits on the device.

Returns:

int – Sum of: 8 to indicate moving 2 to indicate end of track and 1 to flash on identify command.

get_limit_switch_params()[source]

Gets the limit switch parameters.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

Raises:

ThorlabsError – If not successful.

get_limit_switch_params_block()[source]

Get the limit switch parameters.

Returns:

structs.MOT_LimitSwitchParameters – The limit switch parameters.

Raises:

ThorlabsError – If not successful.

get_motor_params()[source]

Gets the motor stage parameters.

Deprecated: calls get_motor_params_ext()

get_motor_params_ext()[source]

Gets the motor stage parameters.

These parameters, when combined define the stage motion in terms of RealWorldUnits [millimeters or degrees]. The real-world unit is defined from steps_per_rev * gear_box_ratio / pitch.

Returns:

  • class`float` – The steps per revolution.

  • float – The gear box ratio.

  • float – The pitch.

Raises:

ThorlabsError – If not successful.

get_motor_travel_limits()[source]

Gets the motor stage min and max position.

Returns:

  • float – The minimum position in RealWorldUnits [millimeters or degrees].

  • float – The maximum position in RealWorldUnits [millimeters or degrees].

Raises:

ThorlabsError – If not successful.

get_motor_travel_mode()[source]

Get the motor travel mode.

Returns:

enums.MOT_TravelModes – The travel mode.

get_motor_velocity_limits()[source]

Gets the motor stage maximum velocity and acceleration.

Returns:

  • float – The maximum velocity in RealWorldUnits [millimeters or degrees].

  • float – The maximum acceleration in RealWorldUnits [millimeters or degrees].

Raises:

ThorlabsError – If not successful.

get_move_absolute_position()[source]

Gets the move absolute position.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The move absolute position in DeviceUnits (see manual).

get_move_relative_distance()[source]

Gets the move relative distance.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The move relative position in DeviceUnits (see manual).

get_next_message()[source]

Get the next Message Queue item. See messages.

Returns:

  • int – The message type.

  • int – The message ID.

  • int – The message data.

Raises:

ThorlabsError – If not successful.

get_number_positions()[source]

Get the number of positions.

This function will get the maximum position reachable by the device. The motor may need to be set to its home() position before this parameter can be used.

Returns:

int – The number of positions.

get_position()[source]

Get the current position.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

index (int) – The position in DeviceUnits (see manual).

get_position_counter()[source]

Get the position counter.

The position counter is identical to the position parameter. The position counter is set to zero when homing is complete.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The position counter in DeviceUnits (see manual).

get_potentiometer_params(index)[source]

Gets the potentiometer parameters for the LTS.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Parameters:

index (int) – The potentiometer index to be read.

Returns:

  • int – The potentiometer threshold, range 0 to 127.

  • int – The velocity in DeviceUnits for the current potentiometer threshold.

Raises:

ThorlabsError – If not successful.

get_potentiometer_params_block()[source]

Get the potentiometer parameters.

Returns:

structs.MOT_PotentiometerSteps – The potentiometer parameters.

Raises:

ThorlabsError – If not successful.

get_power_params()[source]

Gets the power parameters for the stepper motor.

Returns:

structs.MOT_PowerParameters – The power parameters.

Raises:

ThorlabsError – If not successful.

get_real_value_from_device_unit(device_value, unit_type)[source]

Converts a device value to a real-world value.

Either load_settings(), load_named_settings() or set_motor_params_ext() must be called before calling this function, otherwise the returned value will always be 0.

Parameters:
  • device_value (int) – The device value.

  • unit_type (enums.UnitType) – The unit of the device value.

Returns:

float – The real-world value.

Raises:

ThorlabsError – If not successful.

get_soft_limit_mode()[source]

Gets the software limits mode.

Returns:

enums.MOT_LimitsSoftwareApproachPolicy – The software limits mode.

get_software_version()[source]

Gets version number of the device software.

Returns:

str – The device software version.

get_stage_axis_max_pos()[source]

Gets the LTS Motor maximum stage position.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The maximum position in DeviceUnits (see manual).

get_stage_axis_min_pos()[source]

Gets the LTS Motor minimum stage position.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

int – The minimum position in DeviceUnits (see manual).

get_status_bits()[source]

Get the current status bits.

This returns the latest status bits received from the device. To get new status bits, use request_status_bits() or use request_status() or use the polling function, start_polling().

Returns:

int – The status bits from the device.

get_trigger_switches()[source]

Gets the trigger switch bits.

Returns:

int – 8 bits indicating action on trigger input and events to trigger electronic output.

get_vel_params()[source]

Gets the move velocity parameters.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Returns:

  • max_velocity (int) – The maximum velocity in DeviceUnits (see manual).

  • acceleration (int) – The acceleration in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

get_vel_params_block()[source]

Get the move velocity parameters.

Returns:

structs.MOT_VelocityParameters – The velocity parameters.

Raises:

ThorlabsError – If not successful.

has_last_msg_timer_overrun()[source]

Queries if the time since the last message has exceeded the lastMsgTimeout set by enable_last_msg_timer().

This can be used to determine whether communications with the device is still good.

Returns:

boolTrue if last message timer has elapsed, False if monitoring is not enabled or if time of last message received is less than lastMsgTimeout.

home()[source]

Home the device.

Homing the device will set the device to a known state and determine the home position.

Raises:

ThorlabsError – If not successful.

identify()[source]

Sends a command to the device to make it identify itself.

Raises:

ThorlabsError – If not successful.

is_calibration_active()[source]

Is a calibration file active for this motor?

Returns:

bool – Whether a calibration file is active.

load_settings()[source]

Update device with stored settings.

The settings are read from ThorlabsDefaultSettings.xml, which gets created when the Kinesis software is installed.

Raises:

ThorlabsError – If not successful.

load_named_settings(settings_name)[source]

Update device with named settings.

Parameters:

settings_name (str) – The name of the device to load the settings for. Examples for the value of setting_name can be found in ThorlabsDefaultSettings.xml`, which gets created when the Kinesis software is installed.

Raises:

ThorlabsError – If not successful.

message_queue_size()[source]

Gets the size of the message queue.

Returns:

int – The number of messages in the queue.

move_absolute()[source]

Moves the device to the position defined in set_move_absolute_position().

Raises:

ThorlabsError – If not successful.

move_at_velocity(direction)[source]

Start moving at the current velocity in the specified direction.

Parameters:

direction (enums.MOT_TravelDirection) – The required direction of travel as a enums.MOT_TravelDirection enum value or member name.

Raises:

ThorlabsError – If not successful.

move_jog(jog_direction)[source]

Perform a jog.

Parameters:

jog_direction (enums.MOT_TravelDirection) – The jog direction as a enums.MOT_TravelDirection enum value or member name.

Raises:

ThorlabsError – If not successful.

move_relative(displacement)[source]

Move the motor by a relative amount.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

displacement (int) – Signed displacement in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

move_relative_distance()[source]

Moves the device by a relative distance defined by set_move_relative_distance().

Raises:

ThorlabsError – If not successful.

move_to_position(index)[source]

Move the device to the specified position (index).

The motor may need to be set to its home() position before a position can be set.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

index (int) – The position in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

needs_homing()[source]

Does the device need to be home()’d before a move can be performed?

Deprecated: calls can_move_without_homing_first() instead.

Returns:

bool – Whether the device needs to be homed.

open()[source]

Open the device for communication.

Raises:

ThorlabsError – If not successful.

persist_settings()[source]

Persist the devices current settings.

Raises:

ThorlabsError – If not successful.

polling_duration()[source]

Gets the polling loop duration.

Returns:

int – The time between polls in milliseconds or 0 if polling is not active.

register_message_callback(callback)[source]

Registers a callback on the message queue.

Parameters:

callback (MotionControlCallback) – A function to be called whenever messages are received.

request_backlash()[source]

Requests the backlash.

Raises:

ThorlabsError – If not successful.

request_bow_index()[source]

Requests the stepper motor bow index.

Raises:

ThorlabsError – If not successful.

request_button_params()[source]

Requests the LTS button parameters.

Raises:

ThorlabsError – If not successful.

request_homing_params()[source]

Requests the homing parameters.

Raises:

ThorlabsError – If not successful.

request_jog_params()[source]

Requests the jog parameters.

Raises:

ThorlabsError – If not successful.

request_limit_switch_params()[source]

Requests the limit switch parameters.

Raises:

ThorlabsError – If not successful.

request_move_absolute_position()[source]

Requests the position of next absolute move.

Raises:

ThorlabsError – If not successful.

request_move_relative_distance()[source]

Requests the relative move distance.

Raises:

ThorlabsError – If not successful.

request_position()[source]

Requests the current position.

This needs to be called to get the device to send its current position. Note, this is called automatically if Polling is enabled for the device using start_polling().

Raises:

ThorlabsError – If not successful.

request_potentiometer_params()[source]

Requests the potentiometer parameters.

Raises:

ThorlabsError – If not successful.

request_power_params()[source]

Requests the power parameters.

Raises:

ThorlabsError – If not successful.

request_settings()[source]

Requests that all settings are downloaded from the device.

This function requests that the device upload all its settings to the DLL.

Raises:

ThorlabsError – If not successful.

request_status()[source]

Request position and status bits.

This needs to be called to get the device to send it’s current status. Note, this is called automatically if Polling is enabled for the device using start_polling().

Raises:

ThorlabsError – If not successful.

request_status_bits()[source]

Request the status bits which identify the current motor state.

This needs to be called to get the device to send its current status bits. Note, this is called automatically if Polling is enabled for the device using start_polling().

Raises:

ThorlabsError – If not successful.

request_trigger_switches()[source]

Requests the trigger switch bits.

Raises:

ThorlabsError – If not successful.

request_vel_params()[source]

Requests the velocity parameters.

Raises:

ThorlabsError – If not successful.

reset_rotation_modes()[source]

Reset the rotation modes for a rotational device.

Raises:

ThorlabsError – If not successful.

reset_stage_to_defaults()[source]

Reset the stage settings to defaults.

Raises:

ThorlabsError – If not successful.

set_backlash(distance)[source]

Sets the backlash distance (used to control hysteresis).

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

distance (int) – The backlash distance in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_bow_index(bow_index)[source]

Sets the stepper motor bow index.

Parameters:

bow_index (int) – The bow index.

Raises:

ThorlabsError – If not successful.

set_button_params(button_mode, left_button_position, right_button_position)[source]

Sets the LTS button parameters.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • button_mode (enums.MOT_ButtonModes) – The button mode as a enums.MOT_ButtonModes enum value or member name.

  • left_button_position (int) – The Preset position in DeviceUnits for the left button (when in preset mode).

  • right_button_position (int) – The Preset position in DeviceUnits for the right button (when in preset mode).

Raises:

ThorlabsError – If not successful.

set_button_params_block(mode, left_button, right_button, timeout)[source]

Set the button parameters.

Parameters:
  • mode (enums.MOT_ButtonModes) – The mode of operation of the device buttons as a enums.MOT_ButtonModes enum value or member name.

  • left_button (int) – Position in encoder counts to go to when left button is pressed.

  • right_button (int) – Position in encoder counts to go to when right button is pressed.

  • timeout (int) – The Time a button needs to be held down for to record the position as a preset.

Raises:

ThorlabsError – If not successful.

set_calibration_file(path, enabled)[source]

Set the calibration file for this motor.

Parameters:
  • path (str) – The path to a calibration file to load.

  • enabled (bool) – True to enable, False to disable.

Raises:

OSError – If the path does not exist.

set_direction(reverse)[source]

Sets the motor direction sense.

This function is used because some actuators use have directions of motion reversed. This parameter will tell the system to reverse the direction sense when moving, jogging etc.

Parameters:

reverse (bool) – If True then directions will be swapped on these moves.

Raises:

ThorlabsError – If not successful.

set_homing_params_block(direction, limit, velocity, offset)[source]

Set the homing parameters.

Parameters:
Raises:

ThorlabsError – If not successful.

set_homing_velocity(velocity)[source]

Sets the homing velocity.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

velocity (int) – The homing velocity in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_jog_mode(mode, stop_mode)[source]

Sets the jog mode.

Parameters:
Raises:

ThorlabsError – If not successful.

set_jog_params_block(jog_params)[source]

Set the jog parameters.

Parameters:

jog_params (structs.MOT_JogParameters) – The jog parameters.

Raises:
set_jog_step_size(step_size)[source]

Sets the distance to move on jogging.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

step_size (int) – The step size in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_jog_vel_params(max_velocity, acceleration)[source]

Sets jog velocity parameters.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • max_velocity (int) – The maximum velocity in DeviceUnits (see manual).

  • acceleration (int) – The acceleration in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_led_switches(led_switches)[source]

Set the LED indicator bits on the device.

Parameters:

led_switches (int) – Sum of: 8 to indicate moving 2 to indicate end of track and 1 to flash on identify command.

Raises:

ThorlabsError – If not successful.

set_limit_switch_params(cw_lim, ccw_lim, cw_pos, ccw_pos, soft_limit_mode)[source]

Sets the limit switch parameters.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
Raises:

ThorlabsError – If not successful.

set_limit_switch_params_block(params)[source]

Set the limit switch parameters.

Parameters:

params (structs.MOT_LimitSwitchParameters) – The new limit switch parameters.

Raises:
set_limits_software_approach_policy(policy)[source]

Sets the software limits policy.

Parameters:

policy (enums.MOT_LimitsSoftwareApproachPolicy) – The soft limit mode as a enums.MOT_LimitsSoftwareApproachPolicy enum value or member name.

set_motor_params(steps_per_rev, gear_box_ratio, pitch)[source]

Sets the motor stage parameters.

Deprecated: calls set_motor_params_ext()

These parameters, when combined, define the stage motion in terms of RealWorldUnits [millimeters or degrees]. The real-world unit is defined from steps_per_rev * gear_box_ratio / pitch.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Parameters:
  • steps_per_rev (float) – The steps per revolution.

  • gear_box_ratio (float) – The gear box ratio.

  • pitch (float) – The pitch.

Raises:

ThorlabsError – If not successful.

set_motor_params_ext(steps_per_rev, gear_box_ratio, pitch)[source]

Sets the motor stage parameters.

These parameters, when combined, define the stage motion in terms of RealWorldUnits [millimeters or degrees]. The real-world unit is defined from steps_per_rev * gear_box_ratio / pitch.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Parameters:
  • steps_per_rev (float) – The steps per revolution.

  • gear_box_ratio (float) – The gear box ratio.

  • pitch (float) – The pitch.

Raises:

ThorlabsError – If not successful.

set_motor_travel_limits(min_position, max_position)[source]

Sets the motor stage min and max position.

These define the range of travel for the stage.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Parameters:
  • min_position (float) – The minimum position in RealWorldUnits [millimeters or degrees].

  • max_position (float) – The maximum position in RealWorldUnits [millimeters or degrees].

Raises:

ThorlabsError – If not successful.

set_motor_travel_mode(travel_mode)[source]

Set the motor travel mode.

Parameters:

travel_mode (enums.MOT_TravelModes) – The travel mode as a enums.MOT_TravelModes enum value or member name.

Raises:

ThorlabsError – If not successful.

set_motor_velocity_limits(max_velocity, max_acceleration)[source]

Sets the motor stage maximum velocity and acceleration.

See get_real_value_from_device_unit() for converting from a DeviceUnit to a RealValue.

Parameters:
  • max_velocity (float) – The maximum velocity in RealWorldUnits [millimeters or degrees].

  • max_acceleration (float) – The maximum acceleration in RealWorldUnits [millimeters or degrees].

Raises:

ThorlabsError – If not successful.

set_move_absolute_position(position)[source]

Sets the move absolute position.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

position (int) – The absolute position in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_move_relative_distance(distance)[source]

Sets the move relative distance.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

distance (int) – The relative position in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_position_counter(count)[source]

Set the position counter.

Setting the position counter will locate the current position. Setting the position counter will effectively define the home position of a motor.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:

count (int) – The position counter in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_potentiometer_params(index, threshold, velocity)[source]

Sets the potentiometer parameters for the LTS.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • index (int) – The potentiometer index to be stored.

  • threshold (int) – The potentiometer threshold, range 0 to 127.

  • velocity (int) – The velocity in DeviceUnits for the current potentiometer threshold.

Raises:

ThorlabsError – If not successful.

set_potentiometer_params_block(params)[source]

Set the potentiometer parameters.

Parameters:

params (structs.MOT_PotentiometerSteps) – The potentiometer parameters.

Raises:

ThorlabsError – If not successful.

set_power_params(rest, move)[source]

Sets the power parameters for the stepper motor.

Parameters:
  • rest (int) – Percentage of full power to give while not moving (0 - 100).

  • move (int) – Percentage of full power to give while moving (0 - 100).

Raises:

ThorlabsError – If not successful.

set_rotation_modes(mode, direction)[source]

Set the rotation modes for a rotational device.

Parameters:
Raises:

ThorlabsError – If not successful.

set_stage_axis_limits(min_position, max_position)[source]

Sets the stage axis position limits.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • min_position (int) – The minimum position in DeviceUnits (see manual).

  • max_position (int) – The maximum position in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_trigger_switches(indicator_bits)[source]

Sets the trigger switch bits.

Parameters:

indicator_bits (int) – Sets the 8 bits indicating action on trigger input and events to trigger electronic output.

Raises:

ThorlabsError – If not successful.

set_vel_params(max_velocity, acceleration)[source]

Sets the move velocity parameters.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • max_velocity (int) – The maximum velocity in DeviceUnits (see manual).

  • acceleration (int) – The acceleration in DeviceUnits (see manual).

Raises:

ThorlabsError – If not successful.

set_vel_params_block(min_velocity, max_velocity, acceleration)[source]

Set the move velocity parameters.

See get_device_unit_from_real_value() for converting from a RealValue to a DeviceUnit.

Parameters:
  • min_velocity (int) – The minimum velocity in DeviceUnits (see manual)..

  • max_velocity (int) – The maximum velocity in DeviceUnits (see manual)..

  • acceleration (int) – The acceleration in DeviceUnits (see manual)..

Raises:

ThorlabsError – If not successful.

start_polling(milliseconds)[source]

Starts the internal polling loop.

This function continuously requests position and status messages.

Parameters:

milliseconds (int) – The polling rate, in milliseconds.

Raises:

ThorlabsError – If not successful.

stop_immediate()[source]

Stop the current move immediately (with the risk of losing track of the position).

Raises:

ThorlabsError – If not successful.

stop_polling()[source]

Stops the internal polling loop.

stop_profiled()[source]

Stop the current move using the current velocity profile.

Raises:

ThorlabsError – If not successful.

time_since_last_msg_received()[source]

Gets the time, in milliseconds, since the last message was received.

This can be used to determine whether communications with the device is still good.

Returns:

  • int – The time, in milliseconds, since the last message was received.

  • boolTrue if monitoring is enabled otherwise False.

wait_for_message()[source]

Wait for next Message Queue item. See messages.

Returns:

  • int – The message type.

  • int – The message ID.

  • int – The message data.

Raises:

ThorlabsError – If not successful.