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

Deviceclass

Module: zaber_motion.ascii

Represents the controller part of one device - may be either a standalone controller or an integrated controller.

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)
Related Guides:
  • Sending arbitrary commands

Index

pProperties
all_axes
axis_count
connection
device_address
device_id
firmware_version
identity
io
is_identified
is_integrated
label
name
oscilloscope
pvt
serial_number
settings
storage
streams
triggers
warnings
mMethods
generic_command()
generic_command_multi_response()
generic_command_no_response()
get_axis()
get_command_unit_conversion_descriptors()
get_lockstep()
get_state()
identify()
prepare_command()
renumber()
restore()
set_label()
set_state()
__repr__()

Properties

p

all_axes

readonly
device.all_axes
AllAxes Virtual axis which allows you to target all axes of this device.
p

axis_count

readonly
device.axis_count
int Number of axes this device has.
p

connection

readonly
device.connection
Connection Connection of this device.
p

device_address

readonly
device.device_address
int The device address uniquely identifies the device on the connection. It can be configured or automatically assigned by the renumber command.
p

device_id

readonly
device.device_id
int Unique ID of the device hardware.
p

firmware_version

readonly
device.firmware_version
FirmwareVersion Version of the firmware.
p

identity

readonly
device.identity
DeviceIdentity Identity of the device.
p

io

readonly
device.io
DeviceIO I/O channels of this device.
p

is_identified

readonly
device.is_identified
bool Indicates whether or not the device has been identified.
p

is_integrated

readonly
device.is_integrated
bool The device is an integrated product.
p

label

readonly
device.label
str User-assigned label of the device.
p

name

readonly
device.name
str Name of the product.
p

oscilloscope

readonly
device.oscilloscope
Oscilloscope Oscilloscope recording helper for this device. Requires at least Firmware 7.00.
p

pvt

readonly
device.pvt
Pvt Gets an object that provides access to PVT functions of this device. Note that as of ZML v5.0.0, this returns a Pvt object and NOT a PvtSequence object. The PvtSequence can now be obtained from the Pvt object. Requires at least Firmware 7.33.
p

serial_number

readonly
device.serial_number
int Serial number of the device.
p

settings

readonly
device.settings
DeviceSettings Settings and properties of this device.
p

storage

readonly
device.storage
DeviceStorage Key-value storage of this device.
p

streams

readonly
device.streams
Streams Gets an object that provides access to Streams on this device. Requires at least Firmware 7.05.
p

triggers

readonly
device.triggers
Triggers Triggers for this device. Requires at least Firmware 7.06.
p

warnings

readonly
device.warnings
Warnings Warnings and faults of this device and all its axes.

Methods

m

generic_command()

async available
device.generic_command(command, axis = 0, check_errors = True, timeout = 0)
Sends a generic ASCII command to this device. For more information refer to: ASCII Protocol Manual.
Arguments
NameTypeDescription
commandstrCommand and its parameters.
axisintOptional axis number to send the command to.
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
device.generic_command_multi_response(command, axis = 0, check_errors = True, timeout = 0)
Sends a generic ASCII command to this device 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.
axisintOptional axis number to send the command to.
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
device.generic_command_no_response(command, axis = 0)
Sends a generic ASCII command to this device without expecting a response and without adding a message ID For more information refer to: ASCII Protocol Manual.
Arguments
NameTypeDescription
commandstrCommand and its parameters.
axisintOptional axis number to send the command to. Specifying -1 omits the number completely.
m

get_axis()

device.get_axis(axis_number)
Gets an Axis class instance which allows you to control a particular axis on this device. Axes are numbered from 1.
Arguments
NameTypeDescription
axis_numberintNumber of axis intended to control.
Return Value
Axis Axis instance.
m

get_command_unit_conversion_descriptors()

device.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_lockstep()

device.get_lockstep(lockstep_group_id)
Gets a Lockstep class instance which allows you to control a particular lockstep group on the device. Requires at least Firmware 6.15 or 7.11.
Arguments
NameTypeDescription
lockstep_group_idintThe ID of the lockstep group to control. Lockstep group IDs start at one.
Return Value
Lockstep Lockstep instance.
m

get_state()

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

identify()

async available
device.identify(assume_version = None)
Queries the device and the database, gathering information about the product. Without this information features such as unit conversions will not work. Usually, called automatically by detect devices method.
Arguments
NameTypeDescription
assume_versionOptional[FirmwareVersion]The identification assumes the specified firmware version instead of the version queried from the device. Providing this argument can lead to unexpected compatibility issues.
Return Value
DeviceIdentity Device identification data.
m

prepare_command()

device.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 device. Unit conversion is not supported for commands where axes can be remapped, such as stream and PVT commands. 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

renumber()

async available
device.renumber(address)
Changes the address of this device. After the address is successfully changed, the existing device class instance no longer represents the device. Instead, use the new device instance returned by this method.
Arguments
NameTypeDescription
addressintThe new address to assign to the device.
Return Value
Device New device instance with the new address.
m

restore()

async available
device.restore(hard = False)
Restores most of the settings to their default values. Deletes all triggers, stream and PVT buffers, servo tunings. Deletes all zaber storage keys. Disables locksteps, unparks axes. Preserves storage, communication settings, peripherals (unless hard is specified). The device needs to be identified again after the restore.
Arguments
NameTypeDescription
hardboolIf true, completely erases device's memory. The device also resets.
m

set_label()

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

set_state()

async available
device.set_state(state, device_only = False)
Applies a saved state to this device.
Arguments
NameTypeDescription
statestrThe state object to apply to this device.
device_onlyboolIf true, only device scope settings and features will be set.
Return Value
SetStateDeviceResponse Reports of any issues that were handled, but caused the state to not be exactly restored.
m

__repr__()

device.__repr__()
Returns a string that represents the device.
Return Value
str A string that represents the device.
Top