API Reference v9.2.0
Axisclass
Module: zaber_motion.ascii
Represents an axis of motion associated with a device.
The following example illustrates how you can obtain an instance of this type:
from zaber_motion.ascii import Connection
connection = Connection.open_serial_port('COM3')
device = connection.get_device(1)
axis = device.get_axis(1)Related Guides:
Index
pProperties
mMethods
Properties
p
p
p
p
p
p
p
p
p
axis.storageAxisStorage Key-value storage of this axis. Requires at least Firmware 7.30.p
Methods
m
m
m
m
axis.generic_command(command, check_errors = True, timeout = 0)Sends a generic ASCII command to this axis. For more information refer to: ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command | str | Command and its parameters. |
| check_errors | bool | Controls whether to throw an exception when the device rejects the command. |
| timeout | int | The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout. |
Return Value
Response A response to the command.m
axis.generic_command_multi_response(command, check_errors = True, timeout = 0)Sends a generic ASCII command to this axis and expect multiple responses. Responses are returned in order of arrival. For more information refer to: ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command | str | Command and its parameters. |
| check_errors | bool | Controls whether to throw an exception when a device rejects the command. |
| timeout | int | The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout. |
Return Value
List[Response] All responses to the command.m
axis.generic_command_no_response(command)Sends a generic ASCII command to this axis without expecting a response and without adding a message ID For more information refer to: ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command | str | Command and its parameters. |
m
axis.get_command_unit_conversion_descriptors(command_template)Retrieves unit conversion descriptors for a command, allowing unit conversion without a device. The descriptors can be used with the ConvertTo/FromNativeUnits methods of the UnitTable class. Parameters in the command template are denoted by a question mark. For more information refer to: ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command_template | str | Template of the command. Parameters are denoted by question marks. |
Return Value
List[Optional[UnitConversionDescriptor]] Unit conversion descriptor for each parameter in the command. Nil if a parameter does not have conversion.m
m
m
axis.get_position(unit = Units.NATIVE)Returns current axis position.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | Units of position. |
Return Value
float Axis position.m
m
m
m
m
m
axis.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 axis to absolute position.
Arguments
| Name | Type | Description |
|---|---|---|
| position | float | Absolute position. |
| unit | LengthUnits | Units of position. |
| wait_until_idle | bool | Determines whether function should return after the movement is finished or just started. |
| velocity | float | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| velocity_unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
| cyclic_direction | Optional[CyclicDirection] | Which direction a cyclic device should take to get to the target position. |
| extra_cycles | Optional[int] | Number of extra cycles to complete before stopping at the target. |
m
axis.move_index(index, wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)Moves the axis to index position.
Arguments
| Name | Type | Description |
|---|---|---|
| index | int | Index position. Index positions are numbered from 1. |
| wait_until_idle | bool | Determines whether function should return after the movement is finished or just started. |
| velocity | float | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| velocity_unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
m
axis.move_max(wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)Moves the axis to the maximum position as specified by limit.max.
Arguments
| Name | Type | Description |
|---|---|---|
| wait_until_idle | bool | Determines whether function should return after the movement is finished or just started. |
| velocity | float | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| velocity_unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
m
axis.move_min(wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)Moves the axis to the minimum position as specified by limit.min.
Arguments
| Name | Type | Description |
|---|---|---|
| wait_until_idle | bool | Determines whether function should return after the movement is finished or just started. |
| velocity | float | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| velocity_unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
m
axis.move_relative(position, unit = Units.NATIVE, wait_until_idle = True, velocity = 0, velocity_unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)Move axis to position relative to current position.
Arguments
| Name | Type | Description |
|---|---|---|
| position | float | Relative position. |
| unit | LengthUnits | Units of position. |
| wait_until_idle | bool | Determines whether function should return after the movement is finished or just started. |
| velocity | float | Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead. |
| velocity_unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
m
axis.move_sin(amplitude, amplitude_units, period, period_units, count = 0, wait_until_idle = True)Moves the axis in a sinusoidal trajectory.
Arguments
| Name | Type | Description |
|---|---|---|
| amplitude | float | Amplitude of the sinusoidal motion (half of the motion's peak-to-peak range). |
| amplitude_units | LengthUnits | Units of position. |
| period | float | Period of the sinusoidal motion in milliseconds. |
| period_units | TimeUnits | 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 function should return after the movement is finished or just started. |
m
axis.move_sin_stop(wait_until_idle = True)Stops the axis at the end of the sinusoidal trajectory. 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 function should return after the movement is finished. |
m
axis.move_velocity(velocity, unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)Begins to move axis at specified speed.
Arguments
| Name | Type | Description |
|---|---|---|
| velocity | float | Movement velocity. |
| unit | VelocityUnits | Units of velocity. |
| acceleration | float | Movement acceleration. Default value of 0 indicates that the accel setting is used instead. |
| acceleration_unit | AccelerationUnits | Units of acceleration. |
m
m
axis.prepare_command(command_template, *parameters)Formats parameters into a command and performs unit conversions. Parameters in the command template are denoted by a question mark. Command returned is only valid for this axis and this device. For more information refer to: ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command_template | str | Template of a command to prepare. Parameters are denoted by question marks. |
| *parameters | Measurement | Variable number of command parameters. |
Return Value
str Command with converted parameters.m
m
m
axis.set_state(state)Applies a saved state to this axis.
Arguments
| Name | Type | Description |
|---|---|---|
| state | str | The state object to apply to this axis. |
Return Value
SetStateAxisResponse Reports of any issues that were handled, but caused the state to not be exactly restored.m
m