Zaber Launcher Tutorials
Zaber Motion Library
Sample Projects
Virtual DeviceDropdown icon
About3D Viewer
AccountDropdown icon
Sign InSign Up
Zaber Motion LibraryGetting StartedHow-to Guides
API Reference
root
zaber_motion.ascii
AlertEventAllAxesAxisAxisGroupAxisIdentityAxisSettingsAxisStorageAxisTypeConnectionConversionFactorDeviceDeviceIdentityDeviceIODeviceIOInfoDeviceSettingsDeviceStorageDigitalOutputActionGetAxisSettingGetAxisSettingResultGetSettingGetSettingResultIoPortLabelIoPortTypeLockstepMeasurementSequenceMessageTypeOscilloscopeOscilloscopeCapturePropertiesOscilloscopeDataOscilloscopeDataSourceParamsetInfoPidTuningPvtPvtAxisDefinitionPvtAxisTypePvtBufferPvtCallActionPvtCancelAllOutputsScheduleActionPvtCancelOutputScheduleActionPvtCsvDataPvtIoPvtModePvtPartialCsvDataPvtPartialPointPvtPartialSequenceItemPvtPointPvtSequencePvtSequenceItemPvtSetAllAnalogOutputsActionPvtSetAllDigitalOutputsActionPvtSetAnalogOutputActionPvtSetDigitalOutputActionResponseServoTunerServoTuningParamServoTuningParamsetSetStateAxisResponseSetStateDeviceResponseSettingConstantsSimpleTuningSimpleTuningParamDefinitionStreamStreamAxisDefinitionStreamAxisTypeStreamBufferStreamIoStreamModeStreamsTransportTriggerTriggerActionTriggerConditionTriggerEnabledStateTriggerOperationTriggersTriggerStateUnknownResponseEventWarningFlagsWarnings
zaber_motion.binary
BinarySettingsCommandCodeConnectionDeviceDeviceIdentityDeviceSettingsDeviceTypeErrorCodeMessageReplyCodeReplyOnlyEventUnknownResponseEvent
zaber_motion.exceptions
MotionLibExceptionBinaryCommandFailedExceptionDataCommandFailedExceptionDataCommandTooLongExceptionDataDeviceAddressConflictExceptionDataDeviceDbFailedExceptionDataDeviceDbInnerErrorGCodeExecutionExceptionDataGCodeSyntaxExceptionDataInvalidPacketExceptionDataInvalidPvtPointInvalidResponseExceptionDataMovementFailedExceptionDataMovementInterruptedExceptionDataOperationFailedExceptionDataPvtExecutionExceptionDataPvtMovementFailedExceptionDataPvtMovementInterruptedExceptionDataSetDeviceStateExceptionDataSetPeripheralStateExceptionDataStreamExecutionExceptionDataStreamMovementFailedExceptionDataStreamMovementInterruptedExceptionData
zaber_motion.gcode
AxisDefinitionAxisMappingAxisTransformationDeviceDefinitionOfflineTranslatorTranslateMessageTranslateResultTranslatorTranslatorConfig
zaber_motion.microscopy
AutofocusAutofocusStatusCameraTriggerFilterChangerIlluminatorIlluminatorChannelMicroscopeMicroscopeConfigObjectiveChangerThirdPartyComponentsWdiAutofocusProviderWdiAutofocusProviderStatus
zaber_motion.product
ProcessProcessControllerProcessControllerModeProcessControllerSourceProcessControllerSourceSensor
zaber_motion
AxisAddressChannelAddressCyclicDirectionDeviceDbSourceDeviceDbSourceTypeDeviceDiscoveryResultDevicePortTypeFirmwareVersionLibraryLogOutputModeMeasurementNamedParameterRotationDirectionToolsUnitConversionDescriptorUnitsUnitTable
SupportBinary Protocol (Legacy)
© 2026 Zaber Technologies Inc.

API Reference v9.0.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:
  • Sending arbitrary commands

Index

pProperties
axis_number
axis_type
device
identity
is_peripheral
label
peripheral_id
peripheral_name
peripheral_serial_number
resolution
settings
storage
warnings
mMethods
activate()
driver_disable()
driver_enable()
generic_command()
generic_command_multi_response()
generic_command_no_response()
get_command_unit_conversion_descriptors()
get_index_position()
get_number_of_index_positions()
get_position()
get_state()
home()
is_busy()
is_homed()
is_parked()
move_absolute()
move_index()
move_max()
move_min()
move_relative()
move_sin()
move_sin_stop()
move_velocity()
park()
prepare_command()
restore()
set_label()
set_state()
stop()
__repr__()
unpark()
wait_until_idle()

Properties

p

axis_number

readonly
axis.axis_number
int The axis number identifies the axis on the device. The first axis has the number one.
p

axis_type

readonly
axis.axis_type
AxisType Determines the type of an axis and units it accepts.
p

device

readonly
axis.device
Device Device that controls this axis.
p

identity

readonly
axis.identity
AxisIdentity Identity of the axis.
p

is_peripheral

readonly
axis.is_peripheral
bool Indicates whether the axis is a peripheral or part of an integrated device.
p

label

readonly
axis.label
str User-assigned label of the peripheral.
p

peripheral_id

readonly
axis.peripheral_id
int Unique ID of the peripheral hardware.
p

peripheral_name

readonly
axis.peripheral_name
str Name of the peripheral.
p

peripheral_serial_number

readonly
axis.peripheral_serial_number
int Serial number of the peripheral, or 0 when not applicable.
p

resolution

readonly
axis.resolution
int The number of microsteps per full step for motion axes. Always equal to 0 for non-motion axes.
p

settings

readonly
axis.settings
AxisSettings Settings and properties of this axis.
p

storage

readonly
axis.storage
AxisStorage Key-value storage of this axis. Requires at least Firmware 7.30.
p

warnings

readonly
axis.warnings
Warnings Warnings and faults of this axis.

Methods

m

activate()

async available
axis.activate()
Activates a peripheral on this axis. Removes all identity information for the device. Run the identify method on the device after activating to refresh the information.
m

driver_disable()

async available
axis.driver_disable()
Disables the driver, which prevents current from being sent to the motor or load. If the driver is already disabled, the driver remains disabled.
m

driver_enable()

async available
axis.driver_enable(timeout = 10)
Attempts to enable the driver repeatedly for the specified timeout. If the driver is already enabled, the driver remains enabled.
Arguments
NameTypeDescription
timeoutfloatTimeout in seconds. Specify 0 to attempt to enable the driver once.
m

generic_command()

async available
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
NameTypeDescription
commandstrCommand and its parameters.
check_errorsboolControls whether to throw an exception when the device rejects the command.
timeoutintThe 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

generic_command_multi_response()

async available
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
NameTypeDescription
commandstrCommand and its parameters.
check_errorsboolControls whether to throw an exception when a device rejects the command.
timeoutintThe 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

generic_command_no_response()

async available
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
NameTypeDescription
commandstrCommand and its parameters.
m

get_command_unit_conversion_descriptors()

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
NameTypeDescription
command_templatestrTemplate 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

get_index_position()

async available
axis.get_index_position()
Returns current axis index position.
Return Value
int Index position starting from 1 or 0 if the position is not an index position.
m

get_number_of_index_positions()

async available
axis.get_number_of_index_positions()
Gets number of index positions of the axis.
Return Value
int Number of index positions.
m

get_position()

async available
axis.get_position(unit = Units.NATIVE)
Returns current axis position.
Arguments
NameTypeDescription
unitLengthUnitsUnits of position.
Return Value
float Axis position.
m

get_state()

async available
axis.get_state()
Returns a serialization of the current axis state that can be saved and reapplied.
Return Value
str A serialization of the current state of the axis.
m

home()

async available
axis.home(wait_until_idle = True)
Homes axis. Axis returns to its homing position.
Arguments
NameTypeDescription
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
m

is_busy()

async available
axis.is_busy()
Returns bool indicating whether the axis is executing a motion command.
Return Value
bool True if the axis is currently executing a motion command.
m

is_homed()

async available
axis.is_homed()
Returns bool indicating whether the axis has position reference and was homed.
Return Value
bool True if the axis has position reference and was homed.
m

is_parked()

async available
axis.is_parked()
Returns bool indicating whether the axis is parked or not.
Return Value
bool True if the axis is currently parked. False otherwise.
m

move_absolute()

async available
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
NameTypeDescription
positionfloatAbsolute position.
unitLengthUnitsUnits of position.
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
velocityfloatMovement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocity_unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
cyclic_directionOptional[CyclicDirection]Which direction a cyclic device should take to get to the target position.
extra_cyclesOptional[int]Number of extra cycles to complete before stopping at the target.
m

move_index()

async available
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
NameTypeDescription
indexintIndex position. Index positions are numbered from 1.
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
velocityfloatMovement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocity_unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
m

move_max()

async available
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
NameTypeDescription
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
velocityfloatMovement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocity_unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
m

move_min()

async available
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
NameTypeDescription
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
velocityfloatMovement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocity_unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
m

move_relative()

async available
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
NameTypeDescription
positionfloatRelative position.
unitLengthUnitsUnits of position.
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
velocityfloatMovement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocity_unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
m

move_sin()

async available
axis.move_sin(amplitude, amplitude_units, period, period_units, count = 0, wait_until_idle = True)
Moves the axis in a sinusoidal trajectory.
Arguments
NameTypeDescription
amplitudefloatAmplitude of the sinusoidal motion (half of the motion's peak-to-peak range).
amplitude_unitsLengthUnitsUnits of position.
periodfloatPeriod of the sinusoidal motion in milliseconds.
period_unitsTimeUnitsUnits of time.
countfloatNumber 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_idleboolDetermines whether function should return after the movement is finished or just started.
m

move_sin_stop()

async available
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
NameTypeDescription
wait_until_idleboolDetermines whether function should return after the movement is finished.
m

move_velocity()

async available
axis.move_velocity(velocity, unit = Units.NATIVE, acceleration = 0, acceleration_unit = Units.NATIVE)
Begins to move axis at specified speed.
Arguments
NameTypeDescription
velocityfloatMovement velocity.
unitVelocityUnitsUnits of velocity.
accelerationfloatMovement acceleration. Default value of 0 indicates that the accel setting is used instead.
acceleration_unitAccelerationUnitsUnits of acceleration.
m

park()

async available
axis.park()
Parks the axis in anticipation of turning the power off. It can later be powered on, unparked, and moved without first having to home it.
m

prepare_command()

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
NameTypeDescription
command_templatestrTemplate of a command to prepare. Parameters are denoted by question marks.
*parametersMeasurementVariable number of command parameters.
Return Value
str Command with converted parameters.
m

restore()

async available
axis.restore()
Restores all axis settings to their default values. Deletes all zaber axis storage keys. Disables lockstep if the axis is part of one. Unparks the axis. Preserves storage. The device needs to be identified again after the restore.
m

set_label()

async available
axis.set_label(label)
Sets the user-assigned peripheral label. The label is stored on the controller and recognized by other software.
Arguments
NameTypeDescription
labelstrLabel to set.
m

set_state()

async available
axis.set_state(state)
Applies a saved state to this axis.
Arguments
NameTypeDescription
statestrThe 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

stop()

async available
axis.stop(wait_until_idle = True)
Stops ongoing axis movement. Decelerates until zero speed.
Arguments
NameTypeDescription
wait_until_idleboolDetermines whether function should return after the movement is finished or just started.
m

__repr__()

axis.__repr__()
Returns a string that represents the axis.
Return Value
str A string that represents the axis.
m

unpark()

async available
axis.unpark()
Unparks axis. Axis will now be able to move.
m

wait_until_idle()

async available
axis.wait_until_idle(throw_error_on_fault = True)
Waits until axis stops moving.
Arguments
NameTypeDescription
throw_error_on_faultboolDetermines whether to throw error when fault is observed.
Top