msl.equipment.resources.optosigma.shot702 module

Two-axis stage controller (SHOT-702) from OptoSigma.

class msl.equipment.resources.optosigma.shot702.SHOT702(record)[source]

Bases: ConnectionSerial

Two-axis stage controller (SHOT-702) from OptoSigma.

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.

get_input_status()[source]

Get the I/O input connector status.

Returns:

status (int) – Can either be 0 or 1 – see manual.

get_speed()[source]

Get the speed that each stage moves to a position.

Returns:

dict

The speed of each stage. The returned value has the form:

{
  'stage1' : (minimum, maximum, acceleration),
  'stage2' : (minimum, maximum, acceleration),
}

get_speed_origin()[source]

Get the speed that each stage moves to the origin.

Returns:

dict

The speed of each stage. The returned value has the form:

{
  'stage1' : (minimum, maximum, acceleration),
  'stage2' : (minimum, maximum, acceleration),
}

get_steps()[source]

Get the number of steps for each stage.

Returns:

  • int – The number of steps for stage 1.

  • int – The number of steps for stage 2.

get_travel_per_pulse()[source]

Get the travels per pulse for each stage.

Returns:

  • float – The travel per pulse for stage 1.

  • float – The travel per pulse for stage 2.

get_version()[source]

Get the version number.

Returns:

str – The version number.

home(stage)[source]

Move the stage(s) to the home position.

Parameters:

stage (int or str) –

The stage(s) to home. Allowed values:

  • 1 (home stage 1),

  • 2 (home stage 2), or

  • 'W' (home stages 1 and 2).

Raises:

OptoSigmaError – If there was an error processing the command.

is_moving()[source]

Whether a stage is busy moving.

Returns:

bool – Whether a stage is busy moving.

move(stage, direction)[source]

Start moving the stage(s), at the minimum speed, in the specified direction.

Parameters:
  • stage (int or str) –

    The stage(s) to move. Allowed values:

    • 1 (start moving stage 1),

    • 2 (start moving stage 2), or

    • 'W' (start moving stages 1 and 2).

  • direction (str) –

    The direction that the stage(s) should move. Allowed values are:

    • '+' or '-' (move a single stage in the specified direction)

    • '++' (move stage 1 in the + direction, stage 2 in the + direction)

    • '+-' (move stage 1 in the + direction, stage 2 in the - direction)

    • '-+' (move stage 1 in the - direction, stage 2 in the + direction)

    • '--' (move stage 1 in the - direction, stage 2 in the - direction)

Raises:

OptoSigmaError – If there was an error processing the command.

move_absolute(stage, *position)[source]

Move the stage(s) to the specified position.

Examples:

  • move_absolute(1, 1000)

    • move stage 1 to position 1000 in the + direction

  • move_absolute(2, -5000)

    • move stage 2 to position 5000 in the - direction

  • move_absolute(‘W’, 1000, -5000)

    • move stage 1 to position 1000 in the + direction, and

    • move stage 2 to position 5000 in the - direction

Parameters:
  • stage (int or str) – The stage(s) to move. Allowed values: 1, 2, 'W'.

  • position (int or tuple of int) – The position the stage(s) should move to.

Raises:

OptoSigmaError – If there was an error processing the command.

move_relative(stage, *num_pulses)[source]

Move the stage(s) by a relative amount.

Examples:

  • move_relative(1, 1000)

    • move stage 1 by 1000 pulses in the + direction

  • move_relative(2, -5000)

    • move stage 2 by 5000 pulses in the - direction

  • move_relative(‘W’, 1000, -5000)

    • move stage 1 by 1000 pulses in the + direction, and

    • move stage 2 by 5000 pulses in the - direction

Parameters:
  • stage (int or str) – The stage(s) to move. Allowed values: 1, 2, 'W'.

  • num_pulses (int or tuple of int) – The number of pulses the stage(s) should move.

Raises:

OptoSigmaError – If there was an error processing the command.

set_mode(stage, mode)[source]

Set whether the stage(s) can be moved by hand or by the motor.

Parameters:
  • stage (int or str) –

    The stage(s) to set the mode of. Allowed values:

    • 1 (set the mode for stage 1),

    • 2 (set the mode for stage 2), or

    • 'W' (set the mode for stages 1 and 2).

  • mode (int) – Whether the stage(s) can be moved by hand (0) or motor (1).

Raises:

OptoSigmaError – If there was an error processing the command.

set_origin(stage)[source]

Set the origin of the stage(s) to its current position.

Parameters:

stage (int or str) –

The stage(s) to set the home of. Allowed values:

  • 1 (set the home for stage 1),

  • 2 (set the home for stage 2), or

  • 'W' (set the home for stages 1 and 2).

Raises:

OptoSigmaError – If there was an error processing the command.

set_output_status(status)[source]

Set the I/O output status.

Parameters:

status (int) – Can either be 0 or 1 – see manual.

Raises:

OptoSigmaError – If there was an error processing the command.

set_speed(stage, minimum, maximum, acceleration)[source]

Set the minimum, maximum and acceleration values when moving to a position.

Examples:

  • set_speed(1, 100, 1000, 50)

    • set stage 1 to a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.

  • set_speed(2, 1000, 5000, 200)

    • set stage 2 to a minimum speed of 1000 PPS, maximum speed of 5000 PPS and a 200 ms acceleration/deceleration time.

  • set_speed(‘W’, [100,1000], [1000,5000], [50,200])

    • set stage 1 to a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.

    • set stage 2 to a minimum speed of 1000 PPS, maximum speed of 5000 PPS and a 200 ms acceleration/deceleration time.

Parameters:
  • stage (int or str) – The stage(s) to set the setting for. Allowed values: 1, 2, 'W'.

  • minimum (int or list of int) – The minimum speed (allowed range 1 - 500k).

  • maximum (int or list of int) – The maximum speed (allowed range 1 - 500k).

  • acceleration (int or list of int) – The acceleration and deceleration time in milliseconds (allowed range 1 - 1000).

Raises:

OptoSigmaError – If there was an error processing the command.

set_speed_origin(stage, minimum, maximum, acceleration)[source]

Set the minimum, maximum and acceleration values when moving to the origin.

Examples:

  • set_speed_origin(1, 100, 1000, 50)

    • set origin speed for stage 1 to a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.

  • set_speed_origin(2, 1000, 5000, 200)

    • set origin speed for stage 2 to a minimum speed of 1000 PPS, maximum speed of 5000 PPS and a 200 ms acceleration/deceleration time.

  • set_speed_origin(‘W’, [100,1000], [1000,5000], [50,200])

    • set origin speed for stage 1 to a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.

    • set origin speed for stage 2 to a minimum speed of 1000 PPS, maximum speed of 5000 PPS and a 200 ms acceleration/deceleration time.

Parameters:
  • stage (int or str) – The stage(s) to set the setting for. Allowed values: 1, 2, 'W'.

  • minimum (int or list of int) – The minimum origin speed (allowed range 1 - 500k).

  • maximum (int or list of int) – The maximum origin speed (allowed range 1 - 500k).

  • acceleration (int or list of int) – The origin acceleration and deceleration time in milliseconds (allowed range 1 - 1000).

Raises:

OptoSigmaError – If there was an error processing the command.

set_steps(stage, num_steps)[source]

Set the number of steps that the stage motor will use.

See the manual for more details – the S command.

Parameters:
  • stage (int) – The stage to set the steps of (must be 1 or 2).

  • num_steps (int) – The number of steps that the motor should use (must be one of 1, 2, 4, 5, 8, 10, 20, 25, 40, 50, 80, 100, 125, 200, 250).

Raises:

OptoSigmaError – If there was an error processing the command.

status()[source]

Returns the current position and state of each stage.

Returns:

  • pos1 (int) – The current position of stage 1.

  • pos2 (int) – The current position of stage 2.

  • state (str) – The stopped state of the stage (one of 'L', 'M', 'W', 'K') – see the manual for more details.

  • is_moving (bool) – Whether a stage is busy moving.

Raises:

OptoSigmaError – If there was an error processing the command.

stop()[source]

Immediately stop both stages from moving.

Raises:

OptoSigmaError – If there was an error processing the command.

stop_slowly(stage)[source]

Slowly bring the stage(s) to a stop.

Parameters:

stage (int or str) –

The stage(s) to slowly stop. Allowed values:

  • 1 (slowly stop stage 1),

  • 2 (slowly stop stage 2), or

  • 'W' (slowly stop stages 1 and 2).

Raises:

OptoSigmaError – If there was an error processing the command.

wait(callback=None, sleep=0.05)[source]

Wait for the stages to finish moving.

This is a blocking call because it uses time.sleep().

Parameters:
  • callback (callable(), optional) – A callable function. The function will receive 4 arguments – the returned values from status()

  • sleep (float, optional) – The number of seconds to wait between calls to callback.