Skip to content

SHOT-702¤

SHOT702 (Serial) ¤

SHOT702(equipment: Equipment)

              flowchart LR
              msl.equipment_resources.optosigma.shot702.SHOT702[SHOT702]
              msl.equipment.interfaces.serial.Serial[Serial]
              msl.equipment.interfaces.message_based.MessageBased[MessageBased]
              msl.equipment.schema.Interface[Interface]

                              msl.equipment.interfaces.serial.Serial --> msl.equipment_resources.optosigma.shot702.SHOT702
                                msl.equipment.interfaces.message_based.MessageBased --> msl.equipment.interfaces.serial.Serial
                                msl.equipment.schema.Interface --> msl.equipment.interfaces.message_based.MessageBased
                




              click msl.equipment_resources.optosigma.shot702.SHOT702 href "" "msl.equipment_resources.optosigma.shot702.SHOT702"
              click msl.equipment.interfaces.serial.Serial href "" "msl.equipment.interfaces.serial.Serial"
              click msl.equipment.interfaces.message_based.MessageBased href "" "msl.equipment.interfaces.message_based.MessageBased"
              click msl.equipment.schema.Interface href "" "msl.equipment.schema.Interface"
            

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

The default baud rate is set to 38400 and the read/write termination characters are \r\n.

Regular-expression patterns that are used to select this Resource when connect() is called.

manufacturer=r"Opto\s*Sigma|Sigma\s*Koki"
model=r"SHOT-702"

Parameters:

Name Type Description Default
equipment Equipment

An Equipment instance.

required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
def __init__(self, equipment: Equipment) -> None:
    r"""Two-axis stage controller (SHOT-702) from OptoSigma.

    The default baud rate is set to 38400 and the read/write termination characters are `\r\n`.

    Regular-expression patterns that are used to select this Resource when
    [connect()][msl.equipment.schema.Equipment.connect] is called.
    ```python
    manufacturer=r"Opto\s*Sigma|Sigma\s*Koki"
    model=r"SHOT-702"
    ```

    Args:
        equipment: An [Equipment][] instance.
    """
    assert equipment.connection is not None  # noqa: S101
    equipment.connection.properties.setdefault("baud_rate", 38400)
    super().__init__(equipment)

    self.read_termination: bytes = b"\r\n"
    self.write_termination: bytes = b"\r\n"

    self._status_regex: Pattern[str] = re.compile(r"(-*)\s*(\d+),(-*)\s*(\d+),([XK]),([LMWK]),([BR])")
    self._speed_regex: Pattern[str] = re.compile(r"S(\d+)F(\d+)R(\d+)S(\d+)F(\d+)R(\d+)")

get_input_status ¤

get_input_status() -> int

Get the I/O input connector status.

Returns:

Type Description
int

Can either be 0 or 1 (see manual).

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
143
144
145
146
147
148
149
def get_input_status(self) -> int:
    """Get the I/O input connector status.

    Returns:
        Can either be 0 or 1 (see manual).
    """
    return int(self.query("I:"))

get_speed ¤

get_speed() -> tuple[Speed, Speed]

Get the speed that each stage moves to a position.

Returns:

Type Description
tuple[Speed, Speed]

The speed of each stage, (stage1, stage2).

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
151
152
153
154
155
156
157
158
159
160
161
162
163
164
def get_speed(self) -> tuple[Speed, Speed]:
    """Get the speed that each stage moves to a position.

    Returns:
        The speed of each stage, `(stage1, stage2)`.
    """
    reply = self.query("?:DW")
    match = self._speed_regex.match(reply)
    if match is None:
        msg = f"Invalid speed regex expression for the reply {reply!r}"
        raise MSLConnectionError(self, msg)

    a, b, c, d, e, f = map(int, match.groups())
    return Speed(a, b, c), Speed(d, e, f)

get_speed_origin ¤

get_speed_origin() -> tuple[Speed, Speed]

Get the speed that each stage moves to the origin.

Returns:

Type Description
tuple[Speed, Speed]

The speed of each stage, (stage1, stage2).

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
166
167
168
169
170
171
172
173
174
175
176
177
178
179
def get_speed_origin(self) -> tuple[Speed, Speed]:
    """Get the speed that each stage moves to the origin.

    Returns:
        The speed of each stage, `(stage1, stage2)`.
    """
    reply = self.query("?:BW")
    match = self._speed_regex.match(reply)
    if match is None:
        msg = f"Invalid speed regex expression for the reply {reply!r}"
        raise MSLConnectionError(self, msg)

    a, b, c, d, e, f = map(int, match.groups())
    return Speed(a, b, c), Speed(d, e, f)

get_steps ¤

get_steps() -> tuple[int, int]

Get the number of steps for each stage.

Returns:

Type Description
tuple[int, int]

The number of steps for (stage1, stage2).

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
181
182
183
184
185
186
187
188
def get_steps(self) -> tuple[int, int]:
    """Get the number of steps for each stage.

    Returns:
        The number of steps for `(stage1, stage2)`.
    """
    a, b = map(int, self.query("?:SW").split(","))
    return a, b

get_travel_per_pulse ¤

get_travel_per_pulse() -> tuple[float, float]

Get the travel per pulse for each stage.

Returns:

Type Description
tuple[float, float]

The travel per pulse for (stage1, stage2).

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
190
191
192
193
194
195
196
197
def get_travel_per_pulse(self) -> tuple[float, float]:
    """Get the travel per pulse for each stage.

    Returns:
        The travel per pulse for `(stage1, stage2)`.
    """
    a, b = map(float, self.query("?:PW").split(","))
    return a, b

get_version ¤

get_version() -> str

Get the firmware version number.

Returns:

Type Description
str

The version number.

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
199
200
201
202
203
204
205
def get_version(self) -> str:
    """Get the firmware version number.

    Returns:
        The version number.
    """
    return self.query("?:V").rstrip()

home ¤

home(stage: Literal[1, 2, 'W']) -> None

Move the stage(s) to the home position.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to home.

  • 1 — home stage 1
  • 2 — home stage 2
  • "W" — home stages 1 and 2
required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
207
208
209
210
211
212
213
214
215
216
217
218
219
220
def home(self, stage: Literal[1, 2, "W"]) -> None:
    """Move the stage(s) to the home position.

    Args:
        stage: The stage(s) to home.

            * `1` — home stage 1
            * `2` — home stage 2
            * `"W"` — home stages 1 and 2
    """
    reply = self.query(f"H:{stage}")
    if not reply.startswith("OK"):
        msg = f"Cannot home stage {stage}"
        raise MSLConnectionError(self, msg)

is_moving ¤

is_moving() -> bool

Check if a stage is busy moving.

Returns:

Type Description
bool

Whether a stage is busy moving.

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
222
223
224
225
226
227
228
def is_moving(self) -> bool:
    """Check if a stage is busy moving.

    Returns:
        Whether a stage is busy moving.
    """
    return self.query("!:").startswith("B")

move ¤

move(
    stage: Literal[1, 2, "W"],
    direction: Literal["+", "-", "++", "+-", "-+", "--"],
) -> None

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

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to move.

  • 1 — move stage 1
  • 2 — move stage 2
  • "W" — move stages 1 and 2
required
direction Literal['+', '-', '++', '+-', '-+', '--']

The direction that the stage(s) should move.

  • "+" — move a single stage in the + direction
  • "-" — move a single stage 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
  • "--" — move stage 1 in the - direction, stage 2 in the - direction
required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
def move(self, stage: Literal[1, 2, "W"], direction: Literal["+", "-", "++", "+-", "-+", "--"]) -> None:
    """Start moving the stage(s), at the minimum speed, in the specified direction.

    Args:
        stage: The stage(s) to move.

            * `1` — move stage 1
            * `2` — move stage 2
            * `"W"` — move stages 1 and 2

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

            * `"+"` — move a single stage in the `+` direction
            * `"-"` — move a single stage 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
            * `"--"` — move stage 1 in the `-` direction, stage 2 in the `-` direction
    """
    reply = self.query(f"J:{stage}{direction}")
    if not reply.startswith("OK") or not self.query("G:").startswith("OK"):
        msg = f"Cannot move stage {stage} in direction={direction!r}"
        raise MSLConnectionError(self, msg)

move_absolute ¤

move_absolute(stage: Literal[1, 2, 'W'], *position: int) -> None

Move the stage(s) to the specified position.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to move.

  • 1 — move stage 1
  • 2 — move stage 2
  • "W" — move stages 1 and 2
required
position int

The position the stage(s) should move to.

()

Example

  • 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
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
def move_absolute(self, stage: Literal[1, 2, "W"], *position: int) -> None:
    """Move the stage(s) to the specified position.

    Args:
        stage: The stage(s) to move.

            * `1` — move stage 1
            * `2` — move stage 2
            * `"W"` — move stages 1 and 2

        position: The position the stage(s) should move to.

    !!! example
        * `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
    """
    self._move("A", stage, *position)

move_relative ¤

move_relative(stage: Literal[1, 2, 'W'], *num_pulses: int) -> None

Move the stage(s) by a relative amount.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to move.

  • 1 — move stage 1
  • 2 — move stage 2
  • "W" — move stages 1 and 2
required
num_pulses int

The number of pulses the stage(s) should move.

()

Example

  • 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
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
def move_relative(self, stage: Literal[1, 2, "W"], *num_pulses: int) -> None:
    """Move the stage(s) by a relative amount.

    Args:
        stage: The stage(s) to move.

            * `1` — move stage 1
            * `2` — move stage 2
            * `"W"` — move stages 1 and 2

        num_pulses: The number of pulses the stage(s) should move.

    !!! example
        * `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
    """
    self._move("M", stage, *num_pulses)

set_mode ¤

set_mode(stage: Literal[1, 2, 'W'], mode: Literal[0, 1] | Mode) -> None

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

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to set the mode of.

  • 1 — set the mode for stage 1
  • 2 — set the mode for stage 2
  • "W" — set the mode for stages 1 and 2
required
mode Literal[0, 1] | Mode

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

required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
def set_mode(self, stage: Literal[1, 2, "W"], mode: Literal[0, 1] | Mode) -> None:
    """Set whether the stage(s) can be moved by hand or by the motor.

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

            * `1` — set the mode for stage 1
            * `2` — set the mode for stage 2
            * `"W"` — set the mode for stages 1 and 2

        mode: Whether the stage(s) can be moved by hand (0) or by motor (1).
    """
    reply = self.query(f"C:{stage}{mode}")
    if not reply.startswith("OK"):
        msg = f"Cannot set stage {stage} to mode={mode}"
        raise MSLConnectionError(self, msg)

set_origin ¤

set_origin(stage: Literal[1, 2, 'W']) -> None

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

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to set the home of.

  • 1 — set the home for stage 1
  • 2 — set the home for stage 2
  • "W" — set the home for stages 1 and 2
required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
311
312
313
314
315
316
317
318
319
320
321
322
323
324
def set_origin(self, stage: Literal[1, 2, "W"]) -> None:
    """Set the origin of the stage(s) to its current position.

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

            * `1` — set the home for stage 1
            * `2` — set the home for stage 2
            * `"W"` — set the home for stages 1 and 2
    """
    reply = self.query(f"R:{stage}")
    if not reply.startswith("OK"):
        msg = f"Cannot set the origin for stage {stage}"
        raise MSLConnectionError(self, msg)

set_output_status ¤

set_output_status(status: Literal[0, 1]) -> None

Set the I/O output status.

Parameters:

Name Type Description Default
status Literal[0, 1]

Can either be 0 or 1 (see manual).

required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
326
327
328
329
330
331
332
333
334
335
def set_output_status(self, status: Literal[0, 1]) -> None:
    """Set the I/O output status.

    Args:
        status: Can either be 0 or 1 (see manual).
    """
    reply = self.query(f"O:{status}")
    if not reply.startswith("OK"):
        msg = f"Cannot set the output status to {status}"
        raise MSLConnectionError(self, msg)

set_speed ¤

set_speed(stage: Literal[1, 2, 'W'], *speeds: Speed) -> None

Set the speed when moving to a position.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to set the speed settings for.

  • 1 — set the speed for stage 1
  • 2 — set the speed for stage 2
  • "W" — set the speed for stages 1 and 2 (speeds is then the speed settings for stage 1, stage 2)
required
speeds Speed

The speed settings.

()

Example

  • set_speed(1, Speed(100, 1000, 50)) — stage 1 moves at a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.
  • set_speed("W", Speed(100, 1000, 50), Speed(200, 2000, 100)) — stage 1 moves at a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time, and, stage 2 moves at a minimum speed of 200 PPS, maximum speed of 2000 PPS and a 100 ms acceleration/deceleration time.
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
def set_speed(self, stage: Literal[1, 2, "W"], *speeds: Speed) -> None:
    """Set the speed when moving to a position.

    Args:
        stage: The stage(s) to set the speed settings for.

            * `1` — set the speed for stage 1
            * `2` — set the speed for stage 2
            * `"W"` — set the speed for stages 1 and 2
                (`speeds` is then the speed settings for stage 1, stage 2)

        speeds: The speed settings.

    !!! example
        * `set_speed(1, Speed(100, 1000, 50))` — stage 1 moves at a minimum speed of 100 PPS,
            maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.
        * `set_speed("W", Speed(100, 1000, 50), Speed(200, 2000, 100))` — stage 1 moves at a
            minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time, and,
            stage 2 moves at a minimum speed of 200 PPS, maximum speed of 2000 PPS and a 100 ms
            acceleration/deceleration time.
    """
    self._speed("D", stage, *speeds)

set_speed_origin ¤

set_speed_origin(stage: Literal[1, 2, 'W'], *speeds: Speed) -> None

Set the speed when moving to the origin.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to set the speed settings for.

  • 1 — set the speed for stage 1
  • 2 — set the speed for stage 2
  • "W" — set the speed for stages 1 and 2 (speeds is then the speed settings for stage 1, stage 2)
required
speeds Speed

The speed settings.

()

Example

  • set_speed_origin(2, Speed(100, 1000, 50)) — stage 2 moves at a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.
  • set_speed_origin("W", Speed(100, 1000, 50), Speed(200, 2000, 100)) — stage 1 moves at a minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time, and, stage 2 moves at a minimum speed of 200 PPS, maximum speed of 2000 PPS and a 100 ms acceleration/deceleration time.
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
def set_speed_origin(self, stage: Literal[1, 2, "W"], *speeds: Speed) -> None:
    """Set the speed when moving to the origin.

    Args:
        stage: The stage(s) to set the speed settings for.

            * `1` — set the speed for stage 1
            * `2` — set the speed for stage 2
            * `"W"` — set the speed for stages 1 and 2
                (`speeds` is then the speed settings for stage 1, stage 2)

        speeds: The speed settings.

    !!! example
        * `set_speed_origin(2, Speed(100, 1000, 50))` — stage 2 moves at a minimum speed of 100 PPS,
            maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time.
        * `set_speed_origin("W", Speed(100, 1000, 50), Speed(200, 2000, 100))` — stage 1 moves at a
            minimum speed of 100 PPS, maximum speed of 1000 PPS and a 50 ms acceleration/deceleration time, and,
            stage 2 moves at a minimum speed of 200 PPS, maximum speed of 2000 PPS and a 100 ms
            acceleration/deceleration time.
    """
    self._speed("V", stage, *speeds)

set_steps ¤

set_steps(stage: Literal[1, 2], steps: int) -> None

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

See the manual for more details (the S command).

Parameters:

Name Type Description Default
stage Literal[1, 2]

The stage to set the steps of.

required
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).

required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
383
384
385
386
387
388
389
390
391
392
393
394
395
396
def set_steps(self, stage: Literal[1, 2], steps: int) -> None:
    """Set the number of steps that the stage motor will use.

    See the manual for more details (the `S` command).

    Args:
        stage: The stage to set the steps of.
        steps: 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`).
    """
    reply = self.query(f"S:{stage}{steps}")
    if not reply.startswith("OK"):
        msg = f"Cannot set stage {stage} to #steps={steps}"
        raise MSLConnectionError(self, msg)

status ¤

status() -> Status

Get the current position and state of each stage.

Returns:

Type Description
Status

The current position and state of each stage.

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
def status(self) -> Status:
    """Get the current position and state of each stage.

    Returns:
        The current position and state of each stage.
    """
    reply = self.query("Q:")
    if reply == "NG":  # then try again
        self.serial.reset_input_buffer()
        self.serial.reset_output_buffer()
        return self.status()

    match = self._status_regex.match(reply)
    if not match:
        msg = f"Invalid regex expression for the reply {reply!r}"
        raise MSLConnectionError(self, msg)

    negative1, position1, negative2, position2, ok, state, moving = match.groups()
    if ok != "K":
        msg = f"Controller indicates a command or parameter error, reply={reply!r}"
        raise MSLConnectionError(self, msg)

    pos1 = -int(position1) if negative1 else int(position1)
    pos2 = -int(position2) if negative2 else int(position2)
    return Status(pos1, pos2, State(state), moving == "B")

stop ¤

stop() -> None

Immediately stop both stages from moving.

Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
424
425
426
427
428
429
def stop(self) -> None:
    """Immediately stop both stages from moving."""
    reply = self.query("L:E")
    if not reply.startswith("OK"):
        msg = "Cannot stop the stages"
        raise MSLConnectionError(self, msg)

stop_slowly ¤

stop_slowly(stage: Literal[1, 2, 'W']) -> None

Slowly bring the stage(s) to a stop.

Parameters:

Name Type Description Default
stage Literal[1, 2, 'W']

The stage(s) to slowly stop.

  • 1 — slowly stop stage 1
  • 2 — slowly stop stage 2
  • "W" — slowly stop stages 1 and 2
required
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
431
432
433
434
435
436
437
438
439
440
441
442
443
444
def stop_slowly(self, stage: Literal[1, 2, "W"]) -> None:
    """Slowly bring the stage(s) to a stop.

    Args:
        stage: The stage(s) to slowly stop.

            * `1` — slowly stop stage 1
            * `2` — slowly stop stage 2
            * `"W"` — slowly stop stages 1 and 2
    """
    reply = self.query(f"L:{stage}")
    if not reply.startswith("OK"):
        msg = f"cannot slowly stop stage {stage}"
        raise MSLConnectionError(self, msg)

wait ¤

wait(
    callback: Callable[[Status], None] | None = None, sleep: float = 0.05
) -> None

Wait for all stages to finish moving.

This is a blocking call because it uses sleep.

Parameters:

Name Type Description Default
callback Callable[[Status], None] | None

A callable function. The function will receive 1 argument, the Status

None
sleep float

The number of seconds to wait between calls to the callback.

0.05
Source code in packages/resources/src/msl/equipment_resources/optosigma/shot702.py
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
def wait(self, callback: Callable[[Status], None] | None = None, sleep: float = 0.05) -> None:
    """Wait for all stages to finish moving.

    This is a blocking call because it uses [sleep][time.sleep].

    Args:
        callback: A callable function. The function will receive 1 argument,
            the [Status][msl.equipment_resources.optosigma.shot702.Status]
        sleep: The number of seconds to wait between calls to the `callback`.
    """
    while True:
        status = self.status()
        if callback is not None:
            callback(status)
        if not status.is_moving:
            return
        time.sleep(sleep)

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

Mode (IntEnum) ¤

The mode by which a stage can be be moved.

Attributes:

Name Type Description
HAND int

Move by hand, 0.

MOTOR int

Move by motor, 1.

Speed dataclass ¤

Speed(minimum: int, maximum: int, acceleration: int)

Speed settings.

Parameters:

Name Type Description Default
minimum int

Minimum speed (1 - 500k pulses/second).

required
maximum int

Maximum speed (1 - 500k pulses/second).

required
acceleration int

Acceleration (deceleration) time in milliseconds (1 - 1000 ms).

required

State (Enum) ¤

Stage stopped state.

Attributes:

Name Type Description
L str

Stage 1 stopped at a limit sensor.

M str

Stage 2 stopped at a limit sensor.

W str

Stage 1 and stage 2 stopped at a limit sensor.

K str

Normal stop.

Status (NamedTuple) ¤

The status of each stage.

Attributes:

Name Type Description
position1 int

The current position of stage 1.

position2 int

The current position of stage 2.

state State

The stopped state of the stage.

is_moving bool

Whether a stage is busy moving.