API Reference v9.2.0
Streamclass
Module: zaber_motion.ascii
A handle for a stream with this number on the device. Streams provide a way to execute or store a sequence of actions. Stream methods append actions to a queue which executes or stores actions in a first in, first out order.
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)
streams = device.streams
stream = streams.get_stream(1)Related Guides:
Index
mMethods
Properties
p
stream.axesList[StreamAxisDefinition] An array of axes definitions the stream is set up to control.p
p
p
Methods
m
stream.arc_absolute(rotation_direction, center_x, center_y, end_x, end_y)Queue an absolute arc movement on the first two axes of the stream. Absolute meaning that the home positions of the axes is treated as the origin.
Arguments
| Name | Type | Description |
|---|---|---|
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the arc exists. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the arc exists. |
| end_x | Measurement | The first dimension of the end position of the arc. |
| end_y | Measurement | The second dimension of the end position of the arc. |
m
stream.arc_absolute_on(target_axes_indices, rotation_direction, center_x, center_y, end_x, end_y)Queue an absolute arc movement in the stream. The movement will only target the specified subset of axes in the stream.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the arc exists. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the arc exists. |
| end_x | Measurement | The first dimension of the end position of the arc. |
| end_y | Measurement | The second dimension of the end position of the arc. |
m
stream.arc_relative(rotation_direction, center_x, center_y, end_x, end_y)Queue a relative arc movement on the first two axes of the stream. Relative meaning that the current position of the axes is treated as the origin.
Arguments
| Name | Type | Description |
|---|---|---|
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the arc exists. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the arc exists. |
| end_x | Measurement | The first dimension of the end position of the arc. |
| end_y | Measurement | The second dimension of the end position of the arc. |
m
stream.arc_relative_on(target_axes_indices, rotation_direction, center_x, center_y, end_x, end_y)Queue a relative arc movement in the stream. The movement will only target the specified subset of axes in the stream.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the arc exists. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the arc exists. |
| end_x | Measurement | The first dimension of the end position of the arc. |
| end_y | Measurement | The second dimension of the end position of the arc. |
m
stream.call(stream_buffer)Append the actions in a stream buffer to the queue.
Arguments
| Name | Type | Description |
|---|---|---|
| stream_buffer | StreamBuffer | The stream buffer to call. |
m
m
stream.circle_absolute(rotation_direction, center_x, center_y)Queue an absolute circle movement on the first two axes of the stream. Absolute meaning that the home positions of the axes are treated as the origin.
Arguments
| Name | Type | Description |
|---|---|---|
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle. |
| center_y | Measurement | The second dimension of the position of the center of the circle. |
m
stream.circle_absolute_on(target_axes_indices, rotation_direction, center_x, center_y)Queue an absolute circle movement in the stream. The movement will only target the specified subset of axes in the stream.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle. |
| center_y | Measurement | The second dimension of the position of the center of the circle. |
m
stream.circle_relative(rotation_direction, center_x, center_y)Queue a relative circle movement on the first two axes of the stream. Relative meaning that the current position of the axes is treated as the origin.
Arguments
| Name | Type | Description |
|---|---|---|
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle. |
| center_y | Measurement | The second dimension of the position of the center of the circle. |
m
stream.circle_relative_on(target_axes_indices, rotation_direction, center_x, center_y)Queue a relative circle movement in the stream. The movement will only target the specified subset of axes in the stream.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle. |
| center_y | Measurement | The second dimension of the position of the center of the circle. |
m
stream.cork()Cork the front of the stream's action queue, blocking execution. Execution resumes upon uncorking the queue, or when the number of queued actions reaches its limit. Corking eliminates discontinuities in motion due to subsequent stream commands reaching the device late. You can only cork an idle live stream.
m
m
m
stream.generic_command_batch(batch)Sends a batch of generic ASCII commands to the stream. Keeps resending command while the device rejects with AGAIN reason. The batch is atomic in terms of thread safety.
Arguments
| Name | Type | Description |
|---|---|---|
| batch | List[str] | Array of commands. |
m
stream.get_max_centripetal_acceleration(unit = Units.NATIVE)Gets the maximum centripetal acceleration of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | AccelerationUnits | Units of acceleration. |
Return Value
float The maximum centripetal acceleration of the live stream.m
stream.get_max_speed(unit = Units.NATIVE)Gets the maximum speed of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | VelocityUnits | Units of velocity. |
Return Value
float The maximum speed of the stream.m
stream.get_max_tangential_acceleration(unit = Units.NATIVE)Gets the maximum tangential acceleration of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| unit | AccelerationUnits | Units of acceleration. |
Return Value
float The maximum tangential acceleration of the live stream.m
stream.helix_absolute_on(target_axes_indices, rotation_direction, center_x, center_y, end_x, end_y, *endpoint)Queue an absolute helix movement in the stream.
Requires at least Firmware 7.28.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. The first two axes refer to the helix's arc component, while the rest refers to the helix's line component. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the helix projects. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the helix projects. |
| end_x | Measurement | The first dimension of the end position of the helix's arc component. |
| end_y | Measurement | The second dimension of the end position of the helix's arc component. |
| *endpoint | Measurement | Positions for the helix's line component axes, relative to their home positions. |
m
stream.helix_relative_on(target_axes_indices, rotation_direction, center_x, center_y, end_x, end_y, *endpoint)Queue a relative helix movement in the stream.
Requires at least Firmware 7.28.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. The first two axes refer to the helix's arc component, while the rest refers to the helix's line component. |
| rotation_direction | RotationDirection | The direction of the rotation. |
| center_x | Measurement | The first dimension of the position of the center of the circle on which the helix projects. |
| center_y | Measurement | The second dimension of the position of the center of the circle on which the helix projects. |
| end_x | Measurement | The first dimension of the end position of the helix's arc component. |
| end_y | Measurement | The second dimension of the end position of the helix's arc component. |
| *endpoint | Measurement | Positions for the helix's line component axes, relative to their positions before movement. |
m
m
m
stream.line_absolute(*endpoint)Queue an absolute line movement in the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| *endpoint | Measurement | Positions for the axes to move to, relative to their home positions. |
m
stream.line_absolute_on(target_axes_indices, endpoint)Queue an absolute line movement in the stream, targeting a subset of the stream axes.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| endpoint | List[Measurement] | Positions for the axes to move to, relative to their home positions. |
m
stream.line_relative(*endpoint)Queue a relative line movement in the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| *endpoint | Measurement | Positions for the axes to move to, relative to their positions before movement. |
m
stream.line_relative_on(target_axes_indices, endpoint)Queue a relative line movement in the stream, targeting a subset of the stream axes.
Requires at least Firmware 7.11.
Arguments
| Name | Type | Description |
|---|---|---|
| target_axes_indices | List[int] | Indices of the axes in the stream the movement targets. Refers to the axes provided during the stream setup or further execution. Indices are zero-based. |
| endpoint | List[Measurement] | Positions for the axes to move to, relative to their positions before movement. |
m
m
stream.set_max_centripetal_acceleration(max_centripetal_acceleration, unit = Units.NATIVE)Sets the maximum centripetal acceleration of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| max_centripetal_acceleration | float | Maximum centripetal acceleration at which any stream action is executed. |
| unit | AccelerationUnits | Units of acceleration. |
m
stream.set_max_speed(max_speed, unit = Units.NATIVE)Sets the maximum speed of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| max_speed | float | Maximum speed at which any stream action is executed. |
| unit | VelocityUnits | Units of velocity. |
m
stream.set_max_tangential_acceleration(max_tangential_acceleration, unit = Units.NATIVE)Sets the maximum tangential acceleration of the live stream. Converts the units using the first axis of the stream.
Arguments
| Name | Type | Description |
|---|---|---|
| max_tangential_acceleration | float | Maximum tangential acceleration at which any stream action is executed. |
| unit | AccelerationUnits | Units of acceleration. |
m
m
stream.setup_live_composite(*axes)Setup the stream to control the specified axes and to queue actions on the device. Allows use of lockstep axes in a stream.
Arguments
| Name | Type | Description |
|---|---|---|
| *axes | StreamAxisDefinition | Definition of the stream axes. |
m
stream.setup_store(stream_buffer, *axes)Setup the stream to control the specified axes and queue actions into a stream buffer.
Arguments
| Name | Type | Description |
|---|---|---|
| stream_buffer | StreamBuffer | The stream buffer to queue actions in. |
| *axes | int | The axis numbers of the physical axes to setup the stream on. |
m
stream.setup_store_arbitrary_axes(stream_buffer, axes_count)Setup the stream to use a specified number of axes, and to queue actions in a stream buffer. Afterwards, you may call the resulting stream buffer on arbitrary axes. This mode does not allow for unit conversions.
Arguments
| Name | Type | Description |
|---|---|---|
| stream_buffer | StreamBuffer | The stream buffer to queue actions in. |
| axes_count | int | The number of axes in the stream. |
m
stream.setup_store_composite(stream_buffer, *axes)Setup the stream to control the specified axes and queue actions into a stream buffer. Allows use of lockstep axes in a stream.
Arguments
| Name | Type | Description |
|---|---|---|
| stream_buffer | StreamBuffer | The stream buffer to queue actions in. |
| *axes | StreamAxisDefinition | Definition of the stream axes. |
m
m
m
m
stream.wait(time, unit = Units.NATIVE)Wait a specified time.
Arguments
| Name | Type | Description |
|---|---|---|
| time | float | Amount of time to wait. |
| unit | TimeUnits | Units of time. |