API Reference v9.2.0
AxisGroupclass
Module: ZaberMotionAscii
Groups multiple axes across devices into a single group to allow for simultaneous movement. Note that the movement is not coordinated and trajectory is inconsistent and not repeatable between calls. Make sure that any possible trajectory is clear of potential obstacles. The movement methods return after all the axes finish the movement successfully or throw an error as soon as possible.
The following example illustrates how you can obtain an instance of this type:
import ZaberMotionAscii
let connection = try await Connection.openSerialPort(portName: "COM3")
let device = try connection.getDevice(deviceAddress: 1)
let axis = try device.getAxis(axisNumber: 1)
let axisGroup = AxisGroup(axes: [axis])Index
pProperties
Constructor
AxisGroup(axes)Initializes the group with the axes to be controlled.
Arguments
| Name | Type | Description |
|---|---|---|
| axes | [Axis] | Axes of the group. |
Properties
p
Methods
m
try await axisGroup.getPosition(...unit)Returns current axes position. The positions are requested sequentially. The result position may not be accurate if the axes are moving.
Arguments
| Name | Type | Description |
|---|---|---|
| ...unit | [Units] | Units of position. You can specify units once or for each axis separately. |
Return Value
[Double] Axes position.m
m
m
try await axisGroup.moveAbsolute(...position)Moves the axes to absolute position.
Arguments
| Name | Type | Description |
|---|---|---|
| ...position | [Measurement] | Position. |
m
m
m
try await axisGroup.moveRelative(...position)Move axes to position relative to the current position.
Arguments
| Name | Type | Description |
|---|---|---|
| ...position | [Measurement] | Position. |
m