# API Reference v10.3.1 (Python)

## Lockstep (class)

Module: zaber_motion.ascii

Represents a lockstep group with this ID on a device. A lockstep group is a movement synchronized pair of axes on a device.

Requires at least Firmware 6.15 or 7.11.

The following example illustrates how you can obtain an instance of this type:

```py
from zaber_motion.ascii import Connection

connection = Connection.open_serial_port("COM3")
device = connection.get_device(1)
lockstep = device.get_lockstep(1)
```

Related Guides:

- [Lockstep](https://software.zaber.com/motion-library/docs/guides/device_features/lockstep.md)

### Properties

#### `device` (read-only)

`lockstep.device`

Type: [`Device`](https://software.zaber.com/motion-library/api/py/ascii/device.md)

Device that controls this lockstep group.

#### `lockstep_group_id` (read-only)

`lockstep.lockstep_group_id`

Type: `int`

The number that identifies the lockstep group on the device.

### Methods

#### `disable()` (async available)

`lockstep.disable()`

Disable the lockstep group.

#### `enable()` (async available)

`lockstep.enable(*axes)`

Activate the lockstep group on the axes specified.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `*axes` | `int` | The numbers of axes in the lockstep group. |

#### `get_axis_numbers()` (async available)

`lockstep.get_axis_numbers()`

Gets the axis numbers of the lockstep group.

##### Return Value

Type: `List[int]`

Axis numbers in order specified when enabling lockstep.

#### `get_info()` (async available)

`lockstep.get_info(unit = Units.NATIVE)`

Gets information about the lockstep group, including its axes and offsets.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of the offsets. Uses primary axis unit conversion. |

##### Return Value

Type: [`LockstepInfo`](https://software.zaber.com/motion-library/api/py/ascii/lockstepinfo.md)

Information about the lockstep group.

#### `get_offsets()` (async available)

`lockstep.get_offsets(unit = Units.NATIVE)`

Gets the initial offsets of secondary axes of an enabled lockstep group.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of position. Uses primary axis unit conversion. |

##### Return Value

Type: `List[float]`

Initial offset for each axis of the lockstep group.

#### `get_position()` (async available)

`lockstep.get_position(unit = Units.NATIVE)`

Returns current position of the primary axis.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of the position. |

##### Return Value

Type: `float`

Primary axis position.

#### `get_tolerances()` (async available)

`lockstep.get_tolerances(unit = Units.NATIVE)`

Gets the twist tolerances of secondary axes of an enabled lockstep group.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of the tolerance. Uses primary axis unit conversion. |

##### Return Value

Type: `List[float]`

Twist tolerance for each secondary axis of the lockstep group.

#### `get_twists()` (async available)

`lockstep.get_twists(unit = Units.NATIVE)`

Gets the twists of secondary axes of an enabled lockstep group.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of position. Uses primary axis unit conversion. |

##### Return Value

Type: `List[float]`

Difference between the initial offset and the actual offset for each axis of the lockstep group.

#### `home()` (async available)

`lockstep.home(wait_until_idle = True)`

Retracts the axes of the lockstep group until a home associated with an individual axis is detected.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `is_busy()` (async available)

`lockstep.is_busy()`

Returns bool indicating whether the lockstep group is executing a motion command.

##### Return Value

Type: `bool`

True if the axes are currently executing a motion command.

#### `is_enabled()` (async available)

`lockstep.is_enabled()`

Checks if the lockstep group is currently enabled on the device.

##### Return Value

Type: `bool`

True if a lockstep group with this ID is enabled on the device.

#### `is_parked()` (async available)

`lockstep.is_parked()`

Returns bool indicating whether the axis is parked or not.

##### Return Value

Type: `bool`

True if lockstep group is parked.

#### `move_absolute()` (async available)

`lockstep.move_absolute(position, unit = Units.NATIVE, wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE, cyclic_direction = None, extra_cycles = None)`

Move the first axis of the lockstep group to an absolute position. The other axes in the lockstep group maintain their offsets throughout movement.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `position` | `float` | Absolute position. |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of position. |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |
| `velocity` | `float` | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| `velocity_unit` | [`VelocityUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of velocity. |
| `acceleration` | `float` | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| `acceleration_unit` | [`AccelerationUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of acceleration. |
| `cyclic_direction` | [`Optional[CyclicDirection]`](https://software.zaber.com/motion-library/api/py/root/cyclicdirection.md) | Which direction a cyclic lockstep group should take to get to the target position. |
| `extra_cycles` | `Optional[int]` | Number of extra cycles to complete before stopping at the target. |

#### `move_max()` (async available)

`lockstep.move_max(wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)`

Moves the axes to the maximum valid position. The axes in the lockstep group maintain their offsets throughout movement. Respects lim.max for all axes in the group.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |
| `velocity` | `float` | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| `velocity_unit` | [`VelocityUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of velocity. |
| `acceleration` | `float` | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| `acceleration_unit` | [`AccelerationUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of acceleration. |

#### `move_min()` (async available)

`lockstep.move_min(wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)`

Moves the axes to the minimum valid position. The axes in the lockstep group maintain their offsets throughout movement. Respects lim.min for all axes in the group.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |
| `velocity` | `float` | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| `velocity_unit` | [`VelocityUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of velocity. |
| `acceleration` | `float` | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| `acceleration_unit` | [`AccelerationUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of acceleration. |

#### `move_relative()` (async available)

`lockstep.move_relative(position, unit = Units.NATIVE, wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)`

Move the first axis of the lockstep group to a position relative to its current position. The other axes in the lockstep group maintain their offsets throughout movement.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `position` | `float` | Relative position. |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of position. |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |
| `velocity` | `float` | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| `velocity_unit` | [`VelocityUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of velocity. |
| `acceleration` | `float` | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| `acceleration_unit` | [`AccelerationUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of acceleration. |

#### `move_sin()` (async available)

`lockstep.move_sin(amplitude, amplitude_units, period, period_units, count = 0, wait_until_idle = True)`

Moves the first axis of the lockstep group in a sinusoidal trajectory. The other axes in the lockstep group maintain their offsets throughout movement.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `amplitude` | `float` | Amplitude of the sinusoidal motion (half of the motion's peak-to-peak range). |
| `amplitude_units` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of position. |
| `period` | `float` | Period of the sinusoidal motion. |
| `period_units` | [`TimeUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of time. |
| `count` | `float` | Number of sinusoidal cycles to complete. Must be a multiple of 0.5 If count is not specified or set to 0, the axis will move indefinitely. |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `move_sin_stop()` (async available)

`lockstep.move_sin_stop(wait_until_idle = True)`

Stops the lockstep group at the end of the sinusoidal trajectory for the first axis. If the sinusoidal motion was started with an integer-plus-half cycle count, the motion ends at the half-way point of the sinusoidal trajectory.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `move_velocity()` (async available)

`lockstep.move_velocity(velocity, unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)`

Moves the first axis of the lockstep group at the specified speed. The other axes in the lockstep group maintain their offsets throughout movement.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `velocity` | `float` | Movement velocity. |
| `unit` | [`VelocityUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of velocity. |
| `acceleration` | `float` | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| `acceleration_unit` | [`AccelerationUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of acceleration. |

#### `park()` (async available)

`lockstep.park()`

Parks lockstep group in anticipation of turning the power off. It can later be powered on, unparked, and moved without first having to home it.

#### `set_tolerance()` (async available)

`lockstep.set_tolerance(tolerance, unit = Units.NATIVE, axis_index = 0)`

Sets lockstep twist tolerance. Twist tolerances that do not match the system configuration can reduce performance or damage the system.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `tolerance` | `float` | Twist tolerance. |
| `unit` | [`LengthUnits`](https://software.zaber.com/motion-library/api/py/root/units.md) | Units of the tolerance. Uses primary axis unit conversion when setting to all axes, otherwise uses specified secondary axis unit conversion. |
| `axis_index` | `int` | Optional index of a secondary axis to set the tolerance for. If left empty or set to 0, the tolerance is set to all the secondary axes. |

#### `stop()` (async available)

`lockstep.stop(wait_until_idle = True)`

Stops ongoing lockstep group movement. Decelerates until zero speed.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `wait_until_idle` | `bool` | Determines whether the function waits for the movement to finish before returning. When false, you must call WaitUntilIdle afterwards to detect and handle any errors that occur during the movement. |

#### `__repr__()`

`lockstep.__repr__()`

Returns a string which represents the enabled lockstep group.

##### Return Value

Type: `str`

String which represents the enabled lockstep group.

#### `unpark()` (async available)

`lockstep.unpark()`

Unparks lockstep group. Lockstep group will now be able to move.

#### `wait_until_idle()` (async available)

`lockstep.wait_until_idle(throw_error_on_fault = True)`

Waits until the lockstep group stops moving.

##### Arguments

| Name | Type | Description |
| --- | --- | --- |
| `throw_error_on_fault` | `bool` | Determines whether to throw error when fault is observed. |
