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), }
- home(stage)[source]
Move the stage(s) to the home position.
- Parameters:
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:
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
- 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
- set_mode(stage, mode)[source]
Set whether the stage(s) can be moved by hand or by the motor.
- Parameters:
- 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:
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
orstr
) – The stage(s) to set the setting for. Allowed values:1
,2
,'W'
.minimum (
int
orlist
ofint
) – The minimum speed (allowed range 1 - 500k).maximum (
int
orlist
ofint
) – The maximum speed (allowed range 1 - 500k).acceleration (
int
orlist
ofint
) – 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
orstr
) – The stage(s) to set the setting for. Allowed values:1
,2
,'W'
.minimum (
int
orlist
ofint
) – The minimum origin speed (allowed range 1 - 500k).maximum (
int
orlist
ofint
) – The maximum origin speed (allowed range 1 - 500k).acceleration (
int
orlist
ofint
) – 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:
- Raises:
OptoSigmaError – If there was an error processing the command.
- status()[source]
Returns the current position and state of each stage.
- Returns:
- 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:
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 fromstatus()
sleep (
float
, optional) – The number of seconds to wait between calls to callback.