API Reference v9.2.0
Deviceclass
Module: zaber_motion.binary
Represents a device using the binary protocol.
To use this type, add from zaber_motion.binary import Device to the top of your source code.
Index
cConstants
pProperties
Constants
c
Properties
p
p
p
device.device_typeDeviceType Determines the type of an device and units it accepts.p
p
p
p
p
p
Methods
m
device.generic_command(command, data = 0, timeout = 0.0, check_errors = True)Sends a generic Binary command to this device. For more information please refer to the Binary Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command | CommandCode | Command to send. |
| data | int | Optional data argument to the command. Defaults to zero. |
| timeout | float | Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s. |
| check_errors | bool | Controls whether to throw an exception when the device rejects the command. |
Return Value
Message A response to the command.m
device.generic_command_no_response(command, data = 0)Sends a generic Binary command to this device without expecting a response. For more information please refer to the Binary Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| command | CommandCode | Command to send. |
| data | int | Optional data argument to the command. Defaults to zero. |
m
device.generic_command_with_units(command, data = 0, from_unit = Units.NATIVE, to_unit = Units.NATIVE, timeout = 0.0)Sends a generic Binary command to this device with unit conversions for both sent data and retrieved data.
Arguments
| Name | Type | Description |
|---|---|---|
| command | CommandCode | Command to send. |
| data | float | Data argument to the command. Defaults to zero. |
| from_unit | UnitsAndLiterals | Unit to convert sent data from. |
| to_unit | UnitsAndLiterals | Unit to convert retrieved data to. |
| timeout | float | Number of seconds to wait for a response from the device. 0 or negative defaults to 0.5s. |
Return Value
float Data that has been converted to the provided unit.m
device.get_position(unit = Units.NATIVE)Returns current device position.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | Units of position. |
Return Value
float Axis position.m
device.home(unit = Units.NATIVE, timeout = DEFAULT_MOVEMENT_TIMEOUT)Homes device. Device returns to its homing position.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | Unit to convert returned position to. |
| timeout | float | Number of seconds to wait for response from the device chain (defaults to 60s). |
Return Value
float Current position that has been converted to the provided unit.m
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
| Name | Type | Description |
|---|---|---|
| assume_version | Optional[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
m
m
device.move_absolute(position, unit = Units.NATIVE, timeout = DEFAULT_MOVEMENT_TIMEOUT)Move device to absolute position.
Arguments
| Name | Type | Description |
|---|---|---|
| position | float | Absolute position. |
| unit | LengthUnits | Unit for the provided position as well as position returned by the device. |
| timeout | float | Number of seconds to wait for response from the device chain (defaults to 60s). |
Return Value
float Current position that has been converted to the provided unit.m
device.move_relative(position, unit = Units.NATIVE, timeout = DEFAULT_MOVEMENT_TIMEOUT)Move device to position relative to current position.
Arguments
| Name | Type | Description |
|---|---|---|
| position | float | Relative position. |
| unit | LengthUnits | Unit for the provided position as well as position returned by the device. |
| timeout | float | Number of seconds to wait for response from the device chain (defaults to 60s). |
Return Value
float Current position that has been converted to the provided unit.m
device.move_velocity(velocity, unit = Units.NATIVE)Begins to move device at specified speed.
Arguments
| Name | Type | Description |
|---|---|---|
| velocity | float | Movement velocity. |
| unit | VelocityUnits | Unit to convert returned velocity to. |
Return Value
float Device velocity that has been converted to the provided unit.m
m
device.stop(unit = Units.NATIVE, timeout = DEFAULT_MOVEMENT_TIMEOUT)Stops ongoing device movement. Decelerates until zero speed.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | LengthUnits | Unit to convert returned position to. |
| timeout | float | Number of seconds to wait for response from the device chain (defaults to 60s). |
Return Value
float Current position that has been converted to the provided unit.m
m