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])

Constructor

AxisGroup(axes)
Initializes the group with the axes to be controlled.
Arguments
NameTypeDescription
axes[Axis]Axes of the group.

Properties

p

axes

readonly
axisGroup.axes
[Axis] Axes of the group.

Methods

m

getPosition()

asyncthrows
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
NameTypeDescription
...unit[Units]Units of position. You can specify units once or for each axis separately.
Return Value
[Double] Axes position.
m

home()

asyncthrows
try await axisGroup.home()
Homes the axes.
m

isBusy()

asyncthrows
try await axisGroup.isBusy()
Returns bool indicating whether any of the axes is executing a motion command.
Return Value
Bool True if any of the axes is currently executing a motion command. False otherwise.
m

isHomed()

asyncthrows
try await axisGroup.isHomed()
Returns bool indicating whether all the axes are homed.
Return Value
Bool True if all the axes are homed. False otherwise.
m

moveAbsolute()

asyncthrows
try await axisGroup.moveAbsolute(...position)
Moves the axes to absolute position.
Arguments
NameTypeDescription
...position[Measurement]Position.
m

moveMax()

asyncthrows
try await axisGroup.moveMax()
Moves axes to the maximum position as specified by limit.max.
m

moveMin()

asyncthrows
try await axisGroup.moveMin()
Moves axes to the minimum position as specified by limit.min.
m

moveRelative()

asyncthrows
try await axisGroup.moveRelative(...position)
Move axes to position relative to the current position.
Arguments
NameTypeDescription
...position[Measurement]Position.
m

stop()

asyncthrows
try await axisGroup.stop()
Stops the axes.
m

toString()

throws
try axisGroup.toString()
Returns a string that represents the axes.
Return Value
String A string that represents the axes.
m

waitUntilIdle()

asyncthrows
try await axisGroup.waitUntilIdle()
Waits until all the axes stop moving.