Skip to content

C++

AlertEvent

Alert message received from the device.

To use this type, add #include <zaber/motion/ascii/alert_event.h> to the top of your source code.

axisNumber

P

alertEvent.getAxisNumber()

int Number of the axis which the response applies to. Zero denotes device scope.

data

P

alertEvent.getData()

std::string Response data which varies depending on the request.

deviceAddress

P

alertEvent.getDeviceAddress()

int Number of the device that sent the message.

status

P

alertEvent.getStatus()

std::string The device status contains BUSY when the axis is moving and IDLE otherwise.

warningFlag

P

alertEvent.getWarningFlag()

std::string The warning flag contains the highest priority warning currently active for the device or axis.

AllAxes

Represents all axes of motion associated with a device.

To use this type, add #include <zaber/motion/ascii/all_axes.h> to the top of your source code.

device

P

allAxes.getDevice()

Device Device that controls this axis.

home()

M

allAxes.home(waitUntilIdle = true)
allAxes.home(AllAxes::HomeOptions options)

Homes all axes. Axes return to their homing positions.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

AllAxes::HomeOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

isBusy()

M

allAxes.isBusy()

Returns bool indicating whether any axis is executing a motion command.

Arguments

No arguments

Return Value

bool True if any axis is currently executing a motion command.

isHomed()

M

allAxes.isHomed()

Returns bool indicating whether all axes have position reference and were homed.

Arguments

No arguments

Return Value

bool True if all axes have position reference and were homed.

park()

M

allAxes.park()

Parks the device in anticipation of turning the power off. It can later be powered on, unparked, and moved without first having to home it.

Arguments

No arguments

stop()

M

allAxes.stop(waitUntilIdle = true)
allAxes.stop(AllAxes::StopOptions options)

Stops ongoing axes movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

AllAxes::StopOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

toString()

M

allAxes.toString()

Returns a string that represents the axes.

Arguments

No arguments

Return Value

std::string A string that represents the axes.

unpark()

M

allAxes.unpark()

Unparks the device. The device will now be able to move.

Arguments

No arguments

waitUntilIdle()

M

allAxes.waitUntilIdle(throwErrorOnFault = true)
allAxes.waitUntilIdle(AllAxes::WaitUntilIdleOptions options)

Waits until all axes of device stop moving.

Arguments

Name Type Description
throwErrorOnFault const bool Determines whether to throw error when fault is observed.

AllAxes::WaitUntilIdleOptions

Name Type Default Description
throwErrorOnFault const bool true Determines whether to throw error when fault is observed.

Axis

Represents an axis of motion associated with a device.

To use this type, add #include <zaber/motion/ascii/axis.h> to the top of your source code.

axisNumber

P

axis.getAxisNumber()

int The axis number identifies the axis on the device. The first axis has the number one.

axisType

P

axis.getAxisType()

AxisType Determines the type of an axis and units it accepts.

device

P

axis.getDevice()

Device Device that controls this axis.

identity

P

axis.getIdentity()

AxisIdentity Identity of the axis.

isPeripheral

P

axis.getIsPeripheral()

bool Indicates whether the axis is a peripheral or part of an integrated device.

peripheralId

P

axis.getPeripheralId()

int Unique ID of the peripheral hardware.

peripheralName

P

axis.getPeripheralName()

std::string Name of the peripheral.

settings

P

axis.getSettings()

AxisSettings Settings and properties of this axis.

storage

P

axis.getStorage()

AxisStorage Key-value storage of this axis. Requires at least Firmware 7.30.

warnings

P

axis.getWarnings()

Warnings Warnings and faults of this axis.

genericCommand()

M

axis.genericCommand(command, checkErrors = true, timeout = 0)
axis.genericCommand(command, Axis::GenericCommandOptions options)

Sends a generic ASCII command to this axis. For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
checkErrors const bool Controls whether to throw an exception when the device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Axis::GenericCommandOptions

Name Type Default Description
checkErrors const bool true Controls whether to throw an exception when the device rejects the command.
timeout const int 0 The 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.

genericCommandMultiResponse()

M

axis.genericCommandMultiResponse(command, checkErrors = true, timeout = 0)
axis.genericCommandMultiResponse(command, Axis::GenericCommandMultiResponseOptions options)

Sends a generic ASCII command to this axis and expect multiple responses. Responses are returned in order of arrival. For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
checkErrors const bool Controls whether to throw an exception when a device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Axis::GenericCommandMultiResponseOptions

Name Type Default Description
checkErrors const bool true Controls whether to throw an exception when a device rejects the command.
timeout const int 0 The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

std::vector<Response> All responses to the command.

genericCommandNoResponse()

M

axis.genericCommandNoResponse(command)

Sends a generic ASCII command to this axis without expecting a response and without adding a message ID For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.

getPosition()

M

axis.getPosition(unit = Units::NATIVE)

Returns current axis position.

Arguments

Name Type Description
unit const Units Units of position.

Return Value

double Axis position.

getState()

M

axis.getState()

Returns a serialization of the current axis state that can be saved and reapplied.

Arguments

No arguments

Return Value

std::string A serialization of the current state of the axis.

home()

M

axis.home(waitUntilIdle = true)
axis.home(Axis::HomeOptions options)

Homes axis. Axis returns to its homing position.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

Axis::HomeOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

isBusy()

M

axis.isBusy()

Returns bool indicating whether the axis is executing a motion command.

Arguments

No arguments

Return Value

bool True if the axis is currently executing a motion command.

isHomed()

M

axis.isHomed()

Returns bool indicating whether the axis has position reference and was homed.

Arguments

No arguments

Return Value

bool True if the axis has position reference and was homed.

isParked()

M

axis.isParked()

Returns bool indicating whether the axis is parked or not.

Arguments

No arguments

Return Value

bool True if the axis is currently parked. False otherwise.

moveAbsolute()

M

axis.moveAbsolute(position, unit = Units::NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
axis.moveAbsolute(position, unit, Axis::MoveAbsoluteOptions options)

Move axis to absolute position.

Arguments

Name Type Description
position const double Absolute position.
unit const Units Units of position.
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Axis::MoveAbsoluteOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveMax()

M

axis.moveMax(waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
axis.moveMax(Axis::MoveMaxOptions options)

Moves the axis to the maximum position as specified by limit.max.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Axis::MoveMaxOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveMin()

M

axis.moveMin(waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
axis.moveMin(Axis::MoveMinOptions options)

Moves the axis to the minimum position as specified by limit.min.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Axis::MoveMinOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveRelative()

M

axis.moveRelative(position, unit = Units::NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
axis.moveRelative(position, unit, Axis::MoveRelativeOptions options)

Move axis to position relative to current position.

Arguments

Name Type Description
position const double Relative position.
unit const Units Units of position.
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Axis::MoveRelativeOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveVelocity()

M

axis.moveVelocity(velocity, unit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
axis.moveVelocity(velocity, unit, Axis::MoveVelocityOptions options)

Begins to move axis at specified speed.

Arguments

Name Type Description
velocity const double Movement velocity.
unit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Axis::MoveVelocityOptions

Name Type Default Description
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

park()

M

axis.park()

Parks the axis in anticipation of turning the power off. It can later be powered on, unparked, and moved without first having to home it.

Arguments

No arguments

prepareCommand()

M

axis.prepareCommand(commandTemplate, &...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 axis and this device. For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
commandTemplate const std::string& Template of a command to prepare. Parameters are denoted by question marks.
&...parameters Measurement Variable number of command parameters.

Return Value

std::string Command with converted parameters.

setState()

M

axis.setState(state)

Applies a saved state to an axis.

Arguments

Name Type Description
state const std::string& The state object to apply to this axis.

stop()

M

axis.stop(waitUntilIdle = true)
axis.stop(Axis::StopOptions options)

Stops ongoing axis movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

Axis::StopOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

toString()

M

axis.toString()

Returns a string that represents the axis.

Arguments

No arguments

Return Value

std::string A string that represents the axis.

unpark()

M

axis.unpark()

Unparks axis. Axis will now be able to move.

Arguments

No arguments

waitUntilIdle()

M

axis.waitUntilIdle(throwErrorOnFault = true)
axis.waitUntilIdle(Axis::WaitUntilIdleOptions options)

Waits until axis stops moving.

Arguments

Name Type Description
throwErrorOnFault const bool Determines whether to throw error when fault is observed.

Axis::WaitUntilIdleOptions

Name Type Default Description
throwErrorOnFault const bool true Determines whether to throw error when fault is observed.

AxisDefinition

Defines an axis of the translator.

To use this type, add #include <zaber/motion/gcode/axis_definition.h> to the top of your source code.

microstepResolution

P

axisDefinition.getMicrostepResolution()

int Microstep resolution of the axis. Can be obtained by reading the resolution setting. Leave empty if the axis does not have the setting.

peripheralId

P

axisDefinition.getPeripheralId()

int ID of the peripheral.

AxisIdentity

Representation of data gathered during axis identification.

To use this type, add #include <zaber/motion/ascii/axis_identity.h> to the top of your source code.

axisType

P

axisIdentity.getAxisType()

AxisType Determines the type of an axis and units it accepts.

isModified

P

axisIdentity.getIsModified()

bool The peripheral has hardware modifications.

isPeripheral

P

axisIdentity.getIsPeripheral()

bool Indicates whether the axis is a peripheral or part of an integrated device.

peripheralId

P

axisIdentity.getPeripheralId()

int Unique ID of the peripheral hardware.

peripheralName

P

axisIdentity.getPeripheralName()

std::string Name of the peripheral.

AxisMapping

Maps a translator axis to a Zaber stream axis.

To use this type, add #include <zaber/motion/gcode/axis_mapping.h> to the top of your source code.

axisIndex

P

axisMapping.getAxisIndex()

int Index of the stream axis.

axisLetter

P

axisMapping.getAxisLetter()

std::string Letter of the translator axis (X,Y,Z,A,B,C,E).

AxisSettings

Class providing access to various axis settings and properties.

To use this type, add #include <zaber/motion/ascii/axis_settings.h> to the top of your source code.

canConvertNativeUnits()

M

axisSettings.canConvertNativeUnits(setting)

Indicates if given setting can be converted from and to native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

bool True if unit conversion can be performed.

convertFromNativeUnits()

M

axisSettings.convertFromNativeUnits(setting, value, unit)

Convert arbitrary setting value from Zaber native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting in Zaber native units.
unit const Units Units to convert value to.

Return Value

double Setting value.

convertToNativeUnits()

M

axisSettings.convertToNativeUnits(setting, value, unit)

Convert arbitrary setting value to Zaber native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting in units specified by following argument.
unit const Units Units of the value.

Return Value

double Setting value.

get()

M

axisSettings.get(setting, unit = Units::NATIVE)

Returns any axis setting or property. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
unit const Units Units of setting.

Return Value

double Setting value.

getDefault()

M

axisSettings.getDefault(setting, unit = Units::NATIVE)

Returns the default value of a setting.

Arguments

Name Type Description
setting const std::string& Name of the setting.
unit const Units Units of setting.

Return Value

double Default setting value.

getDefaultString()

M

axisSettings.getDefaultString(setting)

Returns the default value of a setting as a string.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

std::string Default setting value.

getString()

M

axisSettings.getString(setting)

Returns any axis setting or property as a string. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

std::string Setting value.

set()

M

axisSettings.set(setting, value, unit = Units::NATIVE)

Sets any axis setting. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting.
unit const Units Units of setting.

setString()

M

axisSettings.setString(setting, value)

Sets any axis setting as a string. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const std::string& Value of the setting.

AxisStorage

Class providing access to axis storage. Requires at least Firmware 7.30.

To use this type, add #include <zaber/motion/ascii/axis_storage.h> to the top of your source code.

eraseKey()

M

axisStorage.eraseKey(key)

Erases the axis value stored at the provided key.

Arguments

Name Type Description
key const std::string& Key to erase.

Return Value

bool A boolean indicating if the key existed.

getBool()

M

axisStorage.getBool(key)

Gets the value at the provided key interpreted as a boolean.

Arguments

Name Type Description
key const std::string& Key to get the value at.

Return Value

bool Stored value.

getNumber()

M

axisStorage.getNumber(key)

Gets the value at the provided key interpreted as a number.

Arguments

Name Type Description
key const std::string& Key to get the value at.

Return Value

double Stored value.

getString()

M

axisStorage.getString(key, decode = false)
axisStorage.getString(key, AxisStorage::GetStringOptions options)

Gets the axis value stored with the provided key.

Arguments

Name Type Description
key const std::string& Key to read the value of.
decode const bool Whether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true.

AxisStorage::GetStringOptions

Name Type Default Description
decode const bool false Whether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true.

Return Value

std::string Stored value.

keyExists()

M

axisStorage.keyExists(key)

Determines whether a given key exists in axis storage.

Arguments

Name Type Description
key const std::string& Key which existence to determine.

Return Value

bool True indicating that the key exists, false otherwise.

listKeys()

M

axisStorage.listKeys(prefix = "")
axisStorage.listKeys(AxisStorage::ListKeysOptions options)

Lists the axis storage keys matching a given prefix. Omit the prefix to list all the keys.

Arguments

Name Type Description
prefix const std::string& Optional key prefix.

AxisStorage::ListKeysOptions

Name Type Default Description
prefix const std::string& "" Optional key prefix.

Return Value

std::vector<std::string> Storage keys matching the given prefix.

setBool()

M

axisStorage.setBool(key, value)

Sets the value at the provided key to the provided boolean.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const bool Value to set.

setNumber()

M

axisStorage.setNumber(key, value)

Sets the value at the provided key to the provided number.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const double Value to set.

setString()

M

axisStorage.setString(key, value, encode = false)
axisStorage.setString(key, value, AxisStorage::SetStringOptions options)

Sets the axis value stored at the provided key.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const std::string& Value to set.
encode const bool Whether the stored value should be base64 encoded before being stored. This makes the string unreadable to humans using the ASCII protocol, however, values stored this way can be of any length and use non-ASCII and protocol reserved characters.

AxisStorage::SetStringOptions

Name Type Default Description
encode const bool false Whether the stored value should be base64 encoded before being stored. This makes the string unreadable to humans using the ASCII protocol, however, values stored this way can be of any length and use non-ASCII and protocol reserved characters.

AxisTransformation

Represents a transformation of a translator axis.

To use this type, add #include <zaber/motion/gcode/axis_transformation.h> to the top of your source code.

axisLetter

P

axisTransformation.getAxisLetter()

std::string Letter of the translator axis (X,Y,Z,A,B,C,E).

scaling

P

axisTransformation.getScaling()

double Scaling factor.

translation

P

axisTransformation.getTranslation()

Measurement Translation distance.

AxisType

Denotes type of an axis and units it accepts.

To use this type, add #include <zaber/motion/ascii/axis_type.h> to the top of your source code.

Member Numeric value
AxisType::UNKNOWN 0
AxisType::LINEAR 1
AxisType::ROTARY 2

BaseConnection

Class representing access to particular connection (serial port, TCP connection). Unlike Connection, BaseConnection instances are copyable. Additionally, BaseConnection instance does not close the connection upon destruction.

To use this type, add #include <zaber/motion/ascii/base_connection.h> to the top of your source code.

DEFAULT_BAUD_RATE

C

DEFAULT_BAUD_RATE

int Default baud rate for serial connections.

TCP_PORT_CHAIN

C

TCP_PORT_CHAIN

int Commands send over this port are forwarded to the device chain. The bandwidth may be limited as the commands are forwarded over a serial connection.

TCP_PORT_DEVICE_ONLY

C

TCP_PORT_DEVICE_ONLY

int Commands send over this port are processed only by the device and not forwarded to the rest of the chain. Using this port typically makes the communication faster.

checksumEnabled

P

baseConnection.getChecksumEnabled()

bool Controls whether outgoing messages contain checksum.

defaultRequestTimeout

P

baseConnection.getDefaultRequestTimeout()

int The default timeout, in milliseconds, for a device to respond to a request. Setting the timeout to a too low value may cause request timeout exceptions.

interfaceId

P

baseConnection.getInterfaceId()

int The interface ID identifies this Connection instance with the underlying library.

alert

E

baseConnection.alert

Event invoked when an alert is received from a device.

Emitted Data

AlertEvent Alert message received from the device.

disconnected

E

baseConnection.disconnected

Event invoked when connection is interrupted or closed.

Emitted Data

MotionLibException Error that caused disconnection.

unknownResponse

E

baseConnection.unknownResponse

Event invoked when a response from a device cannot be matched to any known request.

Emitted Data

UnknownResponseEvent Reply that could not be matched to a request.

detectDevices()

M

baseConnection.detectDevices(identifyDevices = true)
baseConnection.detectDevices(BaseConnection::DetectDevicesOptions options)

Attempts to detect any devices present on this connection.

Arguments

Name Type Description
identifyDevices const bool Determines whether device identification should be performed as well.

BaseConnection::DetectDevicesOptions

Name Type Default Description
identifyDevices const bool true Determines whether device identification should be performed as well.

Return Value

std::vector<Device> Array of detected devices.

disableAlerts()

M

baseConnection.disableAlerts()

Disables alerts for all devices on the connection. This will change the "comm.alert" setting to 0 on all supported devices.

Arguments

No arguments

enableAlerts()

M

baseConnection.enableAlerts()

Enables alerts for all devices on the connection. This will change the "comm.alert" setting to 1 on all supported devices.

Arguments

No arguments

genericCommand()

M

baseConnection.genericCommand(command, device = 0, axis = 0, checkErrors = true, timeout = 0)
baseConnection.genericCommand(command, BaseConnection::GenericCommandOptions options)

Sends a generic ASCII command to this connection. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
device const int Optional device address to send the command to.
axis const int Optional axis number to send the command to.
checkErrors const bool Controls whether to throw an exception when the device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

BaseConnection::GenericCommandOptions

Name Type Default Description
device const int 0 Optional device address to send the command to.
axis const int 0 Optional axis number to send the command to.
checkErrors const bool true Controls whether to throw an exception when the device rejects the command.
timeout const int 0 The 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.

genericCommandMultiResponse()

M

baseConnection.genericCommandMultiResponse(command, device = 0, axis = 0, checkErrors = true, timeout = 0)
baseConnection.genericCommandMultiResponse(command, BaseConnection::GenericCommandMultiResponseOptions options)

Sends a generic ASCII command to this connection and expect multiple responses, either from one device or from many devices. Responses are returned in order of arrival. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
device const int Optional device address to send the command to.
axis const int Optional axis number to send the command to.
checkErrors const bool Controls whether to throw an exception when a device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

BaseConnection::GenericCommandMultiResponseOptions

Name Type Default Description
device const int 0 Optional device address to send the command to.
axis const int 0 Optional axis number to send the command to.
checkErrors const bool true Controls whether to throw an exception when a device rejects the command.
timeout const int 0 The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

std::vector<Response> All responses to the command.

genericCommandNoResponse()

M

baseConnection.genericCommandNoResponse(command, device = 0, axis = 0)
baseConnection.genericCommandNoResponse(command, BaseConnection::GenericCommandNoResponseOptions options)

Sends a generic ASCII command to this connection without expecting a response and without adding a message ID. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
device const int Optional device address to send the command to. Specifying -1 omits the number completely.
axis const int Optional axis number to send the command to. Specifying -1 omits the number completely.

BaseConnection::GenericCommandNoResponseOptions

Name Type Default Description
device const int 0 Optional device address to send the command to. Specifying -1 omits the number completely.
axis const int 0 Optional axis number to send the command to. Specifying -1 omits the number completely.

getDevice()

M

baseConnection.getDevice(deviceAddress)

Gets a Device class instance which allows you to control a particular device on this connection. Devices are numbered from 1.

Arguments

Name Type Description
deviceAddress const int Address of device intended to control. Address is configured for each device.

Return Value

Device Device instance.

homeAll()

M

baseConnection.homeAll(waitUntilIdle = true)
baseConnection.homeAll(BaseConnection::HomeAllOptions options)

Homes all of the devices on this connection.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether the function should return immediately or wait until the devices are homed.

BaseConnection::HomeAllOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether the function should return immediately or wait until the devices are homed.

Return Value

std::vector<int> The addresses of the devices that were homed by this command.

renumberDevices()

M

baseConnection.renumberDevices(firstAddress = 1)
baseConnection.renumberDevices(BaseConnection::RenumberDevicesOptions options)

Renumbers devices present on this connection. After renumbering, devices need to be identified again.

Arguments

Name Type Description
firstAddress const int This is the address that the device closest to the computer is given. Remaining devices are numbered consecutively.

BaseConnection::RenumberDevicesOptions

Name Type Default Description
firstAddress const int 1 This is the address that the device closest to the computer is given. Remaining devices are numbered consecutively.

Return Value

int Total number of devices that responded to the renumber.

stopAll()

M

baseConnection.stopAll(waitUntilIdle = true)
baseConnection.stopAll(BaseConnection::StopAllOptions options)

Stops all of the devices on this connection.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether the function should return immediately or wait until the devices are stopped.

BaseConnection::StopAllOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether the function should return immediately or wait until the devices are stopped.

Return Value

std::vector<int> The addresses of the devices that were stopped by this command.

toString()

M

baseConnection.toString()

Returns a string that represents the connection.

Arguments

No arguments

Return Value

std::string A string that represents the connection.

BinaryCommandFailedExceptionData

Contains additional data for BinaryCommandFailedException.

To use this type, add #include <zaber/motion/exceptions/binary_command_failed_exception_data.h> to the top of your source code.

responseData

P

binaryCommandFailedExceptionData.getResponseData()

int The response data.

CanSetStateAxisResponse

An object containing any setup issues that will prevent setting a state to a given axis.

To use this type, add #include <zaber/motion/ascii/can_set_state_axis_response.h> to the top of your source code.

axisNumber

P

canSetStateAxisResponse.getAxisNumber()

int The number of the axis that cannot be set.

error

P

canSetStateAxisResponse.getError()

std::string The error blocking applying this state to the given axis.

CanSetStateDeviceResponse

An object containing any setup issues that will prevent setting a state to a given device.

To use this type, add #include <zaber/motion/ascii/can_set_state_device_response.h> to the top of your source code.

axisErrors

P

canSetStateDeviceResponse.getAxisErrors()

std::vector<CanSetStateAxisResponse> A list of errors that block setting state of device's axes.

error

P

canSetStateDeviceResponse.getError()

std::string The error blocking applying this state to the given device.

CommandFailedExceptionData

Contains additional data for CommandFailedException.

To use this type, add #include <zaber/motion/exceptions/command_failed_exception_data.h> to the top of your source code.

replyFlag

P

commandFailedExceptionData.getReplyFlag()

std::string The flags on the reply sent by the device.

responseData

P

commandFailedExceptionData.getResponseData()

std::string The response data.

status

P

commandFailedExceptionData.getStatus()

std::string The current device status.

warningFlag

P

commandFailedExceptionData.getWarningFlag()

std::string The current warning flag on the device.

CommandTooLongExceptionData

Information describing why the command could not fit.

To use this type, add #include <zaber/motion/exceptions/command_too_long_exception_data.h> to the top of your source code.

fit

P

commandTooLongExceptionData.getFit()

std::string The part of the command that could be successfully fit in the space provided by the protocol.

packetSize

P

commandTooLongExceptionData.getPacketSize()

int The length of the ascii string that can be written to a single line.

packetsMax

P

commandTooLongExceptionData.getPacketsMax()

int The number of lines a command can be split over using continuations.

remainder

P

commandTooLongExceptionData.getRemainder()

std::string The part of the command that could not fit within the space provided.

Connection

Class representing access to particular connection (serial port, TCP connection).

To use this type, add #include <zaber/motion/ascii/connection.h> to the top of your source code.

alert

E

connection.alert

Event invoked when an alert is received from a device.

Emitted Data

AlertEvent Alert message received from the device.

disconnected

E

connection.disconnected

Event invoked when connection is interrupted or closed.

Emitted Data

MotionLibException Error that caused disconnection.

unknownResponse

E

connection.unknownResponse

Event invoked when a response from a device cannot be matched to any known request.

Emitted Data

UnknownResponseEvent Reply that could not be matched to a request.

close()

M

connection.close()

Close the connection.

Arguments

No arguments

openCustom()

S

Connection.openCustom(transport)

Opens a connection using a custom transport.

Arguments

Name Type Description
transport const Transport& The custom connection transport.

Return Value

Connection An object representing the connection.

openIot()

S

Connection.openIot(cloudId, token = "unauthenticated", connectionName = "", realm = "", api = "https://api.zaber.io")
Connection.openIot(cloudId, Connection::OpenIotOptions options)

Opens a secured connection to a cloud connected device chain. Use this method to connect to devices on your account.

Arguments

Name Type Description
cloudId const std::string& The cloud ID to connect to.
token const std::string& The token to authenticate with. By default the connection will be unauthenticated.
connectionName const std::string& The name of the connection to open. Can be left empty to default to the only connection present. Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
realm const std::string& The realm to connect to. Can be left empty for the default account realm.
api const std::string& The URL of the API to receive connection info from.

Connection::OpenIotOptions

Name Type Default Description
token const std::string& "unauthenticated" The token to authenticate with. By default the connection will be unauthenticated.
connectionName const std::string& "" The name of the connection to open. Can be left empty to default to the only connection present. Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.
realm const std::string& "" The realm to connect to. Can be left empty for the default account realm.
api const std::string& "https://api.zaber.io" The URL of the API to receive connection info from.

Return Value

Connection An object representing the connection.

openNetworkShare()

S

Connection.openNetworkShare(hostName, port, connectionName = "")

Opens a connection to Zaber Launcher in your Local Area Network. The connection is not secured.

Arguments

Name Type Description
hostName const std::string& Hostname or IP address.
port const int Port number.
connectionName const std::string& The name of the connection to open. Can be left empty to default to the only connection present. Otherwise, use serial port name for serial port connection or hostname:port for TCP connection.

Return Value

Connection An object representing the connection.

openSerialPort()

S

Connection.openSerialPort(portName, baudRate = DEFAULT_BAUD_RATE, direct = false)
Connection.openSerialPort(portName, Connection::OpenSerialPortOptions options)

Opens a serial port, if Zaber Launcher controls the port, the port will be opened through Zaber Launcher. Zaber Launcher allows sharing of the port between multiple applications, If port sharing is not desirable, use the direct parameter.

Arguments

Name Type Description
portName const std::string& Name of the port to open.
baudRate const int Optional baud rate (defaults to 115200).
direct const bool If true will connect to the serial port directly, failing if the connection is already opened by a message router instance.

Connection::OpenSerialPortOptions

Name Type Default Description
baudRate const int DEFAULT_BAUD_RATE Optional baud rate (defaults to 115200).
direct const bool false If true will connect to the serial port directly, failing if the connection is already opened by a message router instance.

Return Value

Connection An object representing the port.

openTcp()

S

Connection.openTcp(hostName, port = TCP_PORT_CHAIN)

Opens a TCP connection.

Arguments

Name Type Description
hostName const std::string& Hostname or IP address.
port const int Optional port number (defaults to 55550).

Return Value

Connection An object representing the connection.

ConversionFactor

Represents unit conversion factor for a single dimension.

To use this type, add #include <zaber/motion/ascii/conversion_factor.h> to the top of your source code.

setting

P

conversionFactor.getSetting()

std::string Setting representing the dimension.

unit

P

conversionFactor.getUnit()

Units Units of the value.

value

P

conversionFactor.getValue()

double Value representing 1 native device unit in specified real-word units.

Device

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

To use this type, add #include <zaber/motion/ascii/device.h> to the top of your source code.

allAxes

P

device.getAllAxes()

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

axisCount

P

device.getAxisCount()

int Number of axes this device has.

connection

P

device.getConnection()

Connection Connection of this device.

deviceAddress

P

device.getDeviceAddress()

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

deviceId

P

device.getDeviceId()

int Unique ID of the device hardware.

firmwareVersion

P

device.getFirmwareVersion()

FirmwareVersion Version of the firmware.

identity

P

device.getIdentity()

DeviceIdentity Identity of the device.

io

P

device.getIo()

DeviceIO I/O channels of this device.

isIdentified

P

device.getIsIdentified()

bool Indicates whether or not the device has been identified.

isIntegrated

P

device.getIsIntegrated()

bool The device is an integrated product.

name

P

device.getName()

std::string Name of the product.

oscilloscope

P

device.getOscilloscope()

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

serialNumber

P

device.getSerialNumber()

unsigned int Serial number of the device.

settings

P

device.getSettings()

DeviceSettings Settings and properties of this device.

storage

P

device.getStorage()

DeviceStorage Key-value storage of this device.

warnings

P

device.getWarnings()

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

genericCommand()

M

device.genericCommand(command, axis = 0, checkErrors = true, timeout = 0)
device.genericCommand(command, Device::GenericCommandOptions options)

Sends a generic ASCII command to this device. For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
command const std::string& Command and its parameters.
axis const int Optional axis number to send the command to.
checkErrors const bool Controls whether to throw an exception when the device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Device::GenericCommandOptions

Name Type Default Description
axis const int 0 Optional axis number to send the command to.
checkErrors const bool true Controls whether to throw an exception when the device rejects the command.
timeout const int 0 The 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.

genericCommandMultiResponse()

M

device.genericCommandMultiResponse(command, axis = 0, checkErrors = true, timeout = 0)
device.genericCommandMultiResponse(command, Device::GenericCommandMultiResponseOptions options)

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

Name Type Description
command const std::string& Command and its parameters.
axis const int Optional axis number to send the command to.
checkErrors const bool Controls whether to throw an exception when a device rejects the command.
timeout const int The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Device::GenericCommandMultiResponseOptions

Name Type Default Description
axis const int 0 Optional axis number to send the command to.
checkErrors const bool true Controls whether to throw an exception when a device rejects the command.
timeout const int 0 The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

std::vector<Response> All responses to the command.

genericCommandNoResponse()

M

device.genericCommandNoResponse(command, axis = 0)
device.genericCommandNoResponse(command, Device::GenericCommandNoResponseOptions options)

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

Name Type Description
command const std::string& Command and its parameters.
axis const int Optional axis number to send the command to. Specifying -1 omits the number completely.

Device::GenericCommandNoResponseOptions

Name Type Default Description
axis const int 0 Optional axis number to send the command to. Specifying -1 omits the number completely.

getAxis()

M

device.getAxis(axisNumber)

Gets an Axis class instance which allows you to control a particular axis on this device. Axes are numbered from 1.

Arguments

Name Type Description
axisNumber const int Number of axis intended to control.

Return Value

Axis Axis instance.

getLockstep()

M

device.getLockstep(lockstepGroupId)

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

Name Type Description
lockstepGroupId const int The ID of the lockstep group to control. Lockstep group IDs start at one.

Return Value

Lockstep Lockstep instance.

getState()

M

device.getState()

Returns a serialization of the current device state that can be saved and reapplied.

Arguments

No arguments

Return Value

std::string A serialization of the current state of the device.

getStream()

M

device.getStream(streamId)

Gets a Stream class instance which allows you to control a particular stream on the device.

Arguments

Name Type Description
streamId const int The ID of the stream to control. Stream IDs start at one.

Return Value

Stream Stream instance.

getStreamBuffer()

M

device.getStreamBuffer(streamBufferId)

Gets a StreamBuffer class instance which is a handle for a stream buffer on the device.

Arguments

Name Type Description
streamBufferId const int The ID of the stream buffer to control. Stream buffer IDs start at one.

Return Value

StreamBuffer StreamBuffer instance.

identify()

M

device.identify()

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

No arguments

Return Value

DeviceIdentity Device identification data.

prepareCommand()

M

device.prepareCommand(commandTemplate, &...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. For more information refer to: ASCII Protocol Manual.

Arguments

Name Type Description
commandTemplate const std::string& Template of a command to prepare. Parameters are denoted by question marks.
&...parameters Measurement Variable number of command parameters.

Return Value

std::string Command with converted parameters.

setState()

M

device.setState(state, deviceOnly = false)
device.setState(state, Device::SetStateOptions options)

Applies a saved state to an axis.

Arguments

Name Type Description
state const std::string& The state object to apply to this axis.
deviceOnly const bool If true, only device scope settings and features will be set.

Device::SetStateOptions

Name Type Default Description
deviceOnly const bool false If true, only device scope settings and features will be set.

toString()

M

device.toString()

Returns a string that represents the device.

Arguments

No arguments

Return Value

std::string A string that represents the device.

DeviceAddressConflictExceptionData

Contains additional data for DeviceAddressConflictException.

To use this type, add #include <zaber/motion/exceptions/device_address_conflict_exception_data.h> to the top of your source code.

deviceAddresses

P

deviceAddressConflictExceptionData.getDeviceAddresses()

std::vector<int> The full list of detected device addresses.

DeviceDbFailedExceptionData

Contains additional data for a DeviceDbFailedException.

To use this type, add #include <zaber/motion/exceptions/device_db_failed_exception_data.h> to the top of your source code.

code

P

deviceDbFailedExceptionData.getCode()

std::string Code describing type of the error.

DeviceDbSourceType

Type of source of Device DB data.

To use this type, add #include <zaber/motion/device_db_source_type.h> to the top of your source code.

Member Numeric value
DeviceDbSourceType::WEB_SERVICE 0
DeviceDbSourceType::FILE 1

DeviceDefinition

Holds information about device and its axes for purpose of a translator.

To use this type, add #include <zaber/motion/gcode/device_definition.h> to the top of your source code.

axes

P

deviceDefinition.getAxes()

std::vector<AxisDefinition> Applicable axes of the device.

deviceId

P

deviceDefinition.getDeviceId()

int Device ID of the controller. Can be obtained from device settings.

maxSpeed

P

deviceDefinition.getMaxSpeed()

Measurement The smallest of each axis' maxspeed setting value. This value becomes the traverse rate of the translator.

DeviceIdentity

Representation of data gathered during device identification.

To use this type, add #include <zaber/motion/ascii/device_identity.h> to the top of your source code.

axisCount

P

deviceIdentity.getAxisCount()

int Number of axes this device has.

deviceId

P

deviceIdentity.getDeviceId()

int Unique ID of the device hardware.

firmwareVersion

P

deviceIdentity.getFirmwareVersion()

FirmwareVersion Version of the firmware.

isIntegrated

P

deviceIdentity.getIsIntegrated()

bool The device is an integrated product.

isModified

P

deviceIdentity.getIsModified()

bool The device has hardware modifications.

name

P

deviceIdentity.getName()

std::string Name of the product.

serialNumber

P

deviceIdentity.getSerialNumber()

unsigned int Serial number of the device.

DeviceIO

Class providing access to the I/O channels of the device.

To use this type, add #include <zaber/motion/ascii/device_io.h> to the top of your source code.

getAllAnalogInputs()

M

deviceIO.getAllAnalogInputs()

Returns the current values of all analog input channels.

Arguments

No arguments

Return Value

std::vector<double> Measurements of the voltage present on the input channels.

getAllAnalogOutputs()

M

deviceIO.getAllAnalogOutputs()

Returns the current values of all analog output channels.

Arguments

No arguments

Return Value

std::vector<double> Measurements of voltage that the output channels are conducting.

getAllDigitalInputs()

M

deviceIO.getAllDigitalInputs()

Returns the current values of all digital input channels.

Arguments

No arguments

Return Value

std::vector<bool> True if voltage is present on the input channel and false otherwise.

getAllDigitalOutputs()

M

deviceIO.getAllDigitalOutputs()

Returns the current values of all digital output channels.

Arguments

No arguments

Return Value

std::vector<bool> True if the output channel is conducting and false otherwise.

getAnalogInput()

M

deviceIO.getAnalogInput(channelNumber)

Returns the current value of the specified analog input channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.

Return Value

double A measurementsof the voltage present on the input channel.

getAnalogOutput()

M

deviceIO.getAnalogOutput(channelNumber)

Returns the current values of the specified analog output channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.

Return Value

double A measurement of voltage that the output channel is conducting.

getChannelsInfo()

M

deviceIO.getChannelsInfo()

Returns the number of I/O channels the device has.

Arguments

No arguments

Return Value

DeviceIOInfo An object containing the number of I/O channels the device has.

getDigitalInput()

M

deviceIO.getDigitalInput(channelNumber)

Returns the current value of the specified digital input channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.

Return Value

bool True if voltage is present on the input channel and false otherwise.

getDigitalOutput()

M

deviceIO.getDigitalOutput(channelNumber)

Returns the current value of the specified digital output channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.

Return Value

bool True if the output channel is conducting and false otherwise.

setAllAnalogOutputs()

M

deviceIO.setAllAnalogOutputs(values)

Sets values for all analog output channels.

Arguments

Name Type Description
values const std::vector<double>& Voltage values to set the output channels to.

setAllDigitalOutputs()

M

deviceIO.setAllDigitalOutputs(values)

Sets values for all digital output channels.

Arguments

Name Type Description
values const std::vector<bool>& True to set the output channel to conducting and false to turn it off.

setAnalogOutput()

M

deviceIO.setAnalogOutput(channelNumber, value)

Sets value for the specified analog output channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.
value const double Value to set the output channel voltage to.

setDigitalOutput()

M

deviceIO.setDigitalOutput(channelNumber, value)

Sets value for the specified digital output channel.

Arguments

Name Type Description
channelNumber const int Channel number starting at 1.
value const bool True to set the output channel to conducting and false to turn it off.

DeviceIOInfo

Class representing information on the I/O channels of the device.

To use this type, add #include <zaber/motion/ascii/device_io_info.h> to the top of your source code.

numberAnalogInputs

P

deviceIOInfo.getNumberAnalogInputs()

int Number of analog input channels.

numberAnalogOutputs

P

deviceIOInfo.getNumberAnalogOutputs()

int Number of analog output channels.

numberDigitalInputs

P

deviceIOInfo.getNumberDigitalInputs()

int Number of digital input channels.

numberDigitalOutputs

P

deviceIOInfo.getNumberDigitalOutputs()

int Number of digital output channels.

DeviceSettings

Class providing access to various device settings and properties.

To use this type, add #include <zaber/motion/ascii/device_settings.h> to the top of your source code.

canConvertNativeUnits()

M

deviceSettings.canConvertNativeUnits(setting)

Indicates if given setting can be converted from and to native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

bool True if unit conversion can be performed.

convertFromNativeUnits()

M

deviceSettings.convertFromNativeUnits(setting, value, unit)

Convert arbitrary setting value from Zaber native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting in Zaber native units.
unit const Units Units to convert value to.

Return Value

double Setting value.

convertToNativeUnits()

M

deviceSettings.convertToNativeUnits(setting, value, unit)

Convert arbitrary setting value to Zaber native units.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting in units specified by following argument.
unit const Units Units of the value.

Return Value

double Setting value.

get()

M

deviceSettings.get(setting, unit = Units::NATIVE)

Returns any device setting or property. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
unit const Units Units of setting.

Return Value

double Setting value.

getDefault()

M

deviceSettings.getDefault(setting, unit = Units::NATIVE)

Returns the default value of a setting.

Arguments

Name Type Description
setting const std::string& Name of the setting.
unit const Units Units of setting.

Return Value

double Default setting value.

getDefaultString()

M

deviceSettings.getDefaultString(setting)

Returns the default value of a setting as a string.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

std::string Default setting value.

getString()

M

deviceSettings.getString(setting)

Returns any device setting or property as a string. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.

Return Value

std::string Setting value.

set()

M

deviceSettings.set(setting, value, unit = Units::NATIVE)

Sets any device setting. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const double Value of the setting.
unit const Units Units of setting.

setString()

M

deviceSettings.setString(setting, value)

Sets any device setting as a string. For more information refer to the ASCII Protocol Manual.

Arguments

Name Type Description
setting const std::string& Name of the setting.
value const std::string& Value of the setting.

DeviceStorage

Class providing access to device storage. Requires at least Firmware 7.30.

To use this type, add #include <zaber/motion/ascii/device_storage.h> to the top of your source code.

eraseKey()

M

deviceStorage.eraseKey(key)

Erases the device value stored at the provided key.

Arguments

Name Type Description
key const std::string& Key to erase.

Return Value

bool A boolean indicating if the key existed.

getBool()

M

deviceStorage.getBool(key)

Gets the value at the provided key interpreted as a boolean.

Arguments

Name Type Description
key const std::string& Key to get the value at.

Return Value

bool Stored value.

getNumber()

M

deviceStorage.getNumber(key)

Gets the value at the provided key interpreted as a number.

Arguments

Name Type Description
key const std::string& Key to get the value at.

Return Value

double Stored value.

getString()

M

deviceStorage.getString(key, decode = false)
deviceStorage.getString(key, DeviceStorage::GetStringOptions options)

Gets the device value stored with the provided key.

Arguments

Name Type Description
key const std::string& Key to read the value of.
decode const bool Whether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true.

DeviceStorage::GetStringOptions

Name Type Default Description
decode const bool false Whether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true.

Return Value

std::string Stored value.

keyExists()

M

deviceStorage.keyExists(key)

Determines whether a given key exists in device storage.

Arguments

Name Type Description
key const std::string& Key which existence to determine.

Return Value

bool True indicating that the key exists, false otherwise.

listKeys()

M

deviceStorage.listKeys(prefix = "")
deviceStorage.listKeys(DeviceStorage::ListKeysOptions options)

Lists the device storage keys matching a given prefix. Omit the prefix to list all the keys.

Arguments

Name Type Description
prefix const std::string& Optional key prefix.

DeviceStorage::ListKeysOptions

Name Type Default Description
prefix const std::string& "" Optional key prefix.

Return Value

std::vector<std::string> Storage keys matching the given prefix.

setBool()

M

deviceStorage.setBool(key, value)

Sets the value at the provided key to the provided boolean.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const bool Value to set.

setNumber()

M

deviceStorage.setNumber(key, value)

Sets the value at the provided key to the provided number.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const double Value to set.

setString()

M

deviceStorage.setString(key, value, encode = false)
deviceStorage.setString(key, value, DeviceStorage::SetStringOptions options)

Sets the device value stored at the provided key.

Arguments

Name Type Description
key const std::string& Key to set the value at.
value const std::string& Value to set.
encode const bool Whether the stored value should be base64 encoded before being stored. This makes the string unreadable to humans using the ASCII protocol, however, values stored this way can be of any length and use non-ASCII and protocol reserved characters.

DeviceStorage::SetStringOptions

Name Type Default Description
encode const bool false Whether the stored value should be base64 encoded before being stored. This makes the string unreadable to humans using the ASCII protocol, however, values stored this way can be of any length and use non-ASCII and protocol reserved characters.

FirmwareVersion

Class representing version of firmware in the controller.

To use this type, add #include <zaber/motion/firmware_version.h> to the top of your source code.

build

P

firmwareVersion.getBuild()

int Build version number.

major

P

firmwareVersion.getMajor()

int Major version number.

minor

P

firmwareVersion.getMinor()

int Minor version number.

GCodeExecutionExceptionData

Contains additional data for GCodeExecutionException.

To use this type, add #include <zaber/motion/exceptions/g_code_execution_exception_data.h> to the top of your source code.

fromBlock

P

gCodeExecutionExceptionData.getFromBlock()

int The index in the block string that caused the exception.

toBlock

P

gCodeExecutionExceptionData.getToBlock()

int The end index in the block string that caused the exception. The end index is exclusive.

GCodeSyntaxExceptionData

Contains additional data for GCodeSyntaxException.

To use this type, add #include <zaber/motion/exceptions/g_code_syntax_exception_data.h> to the top of your source code.

fromBlock

P

gCodeSyntaxExceptionData.getFromBlock()

int The index in the block string that caused the exception.

toBlock

P

gCodeSyntaxExceptionData.getToBlock()

int The end index in the block string that caused the exception. The end index is exclusive.

InvalidPacketExceptionData

Contains additional data for the InvalidPacketException.

To use this type, add #include <zaber/motion/exceptions/invalid_packet_exception_data.h> to the top of your source code.

packet

P

invalidPacketExceptionData.getPacket()

std::string The invalid packet that caused the exception.

reason

P

invalidPacketExceptionData.getReason()

std::string The reason for the exception.

InvalidResponseExceptionData

Contains additional data for InvalidResponseException.

To use this type, add #include <zaber/motion/exceptions/invalid_response_exception_data.h> to the top of your source code.

response

P

invalidResponseExceptionData.getResponse()

std::string The response data.

Library

Access class to general library information and configuration.

To use this type, add #include <zaber/motion/library.h> to the top of your source code.

disableDeviceDbStore()

S

Library.disableDeviceDbStore()

Disables Device DB store.

Arguments

No arguments

enableDeviceDbStore()

S

Library.enableDeviceDbStore(storeLocation = "")

Enables Device DB store. The store uses filesystem to save information obtained from the Device DB. The stored data are later used instead of the Device DB.

Arguments

Name Type Description
storeLocation const std::string& Specifies relative or absolute path of the folder used by the store. If left empty defaults to a folder in user home directory. Must be accessible by the process.

setDeviceDbSource()

S

Library.setDeviceDbSource(sourceType, urlOrFilePath = "")

Sets source of Device DB data. Allows selection of a web service or a local file.

Arguments

Name Type Description
sourceType const DeviceDbSourceType Source type.
urlOrFilePath const std::string& URL of the web service or path to the local file. Leave empty for the default URL of Zaber web service.

setLogOutput()

S

Library.setLogOutput(mode, filePath = "")

Sets library logging output.

Arguments

Name Type Description
mode const LogOutputMode Logging output mode.
filePath const std::string& Path of the file to open.

Lockstep

Represents a lockstep group with this ID on a device. A lockstep group is a movement synchronized pair of axes on a device. Requires at least Firmware 6.15 or 7.11.

To use this type, add #include <zaber/motion/ascii/lockstep.h> to the top of your source code.

device

P

lockstep.getDevice()

Device Device that controls this lockstep group.

lockstepGroupId

P

lockstep.getLockstepGroupId()

int The number that identifies the lockstep group on the device.

disable()

M

lockstep.disable()

Disable the lockstep group.

Arguments

No arguments

enable()

M

lockstep.enable(&...axes)

Activate the lockstep group on the axes specified.

Arguments

Name Type Description
&...axes int The numbers of axes in the lockstep group.

getAxes()

M

Obsolete: Use GetAxisNumbers instead.

lockstep.getAxes()

Gets the axes of the lockstep group.

Arguments

No arguments

Return Value

LockstepAxes LockstepAxes instance which contains the axes numbers of the lockstep group.

getAxisNumbers()

M

lockstep.getAxisNumbers()

Gets the axis numbers of the lockstep group.

Arguments

No arguments

Return Value

std::vector<int> Axis numbers in order specified when enabling lockstep.

getOffsets()

M

lockstep.getOffsets(unit = Units::NATIVE)

Gets the initial offsets of secondary axes of an enabled lockstep group.

Arguments

Name Type Description
unit const Units Units of position.

Return Value

std::vector<double> Initial offset for each axis of the lockstep group.

getTwists()

M

lockstep.getTwists(unit = Units::NATIVE)

Gets the twists of secondary axes of an enabled lockstep group.

Arguments

Name Type Description
unit const Units Units of position.

Return Value

std::vector<double> Difference between the initial offset and the actual offset for each axis of the lockstep group.

home()

M

lockstep.home(waitUntilIdle = true)
lockstep.home(Lockstep::HomeOptions options)

Retracts the axes of the lockstep group until a home associated with an individual axis is detected.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

Lockstep::HomeOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

isBusy()

M

lockstep.isBusy()

Returns bool indicating whether the lockstep group is executing a motion command.

Arguments

No arguments

Return Value

bool True if the axes are currently executing a motion command.

isEnabled()

M

lockstep.isEnabled()

Checks if the lockstep group is currently enabled on the device.

Arguments

No arguments

Return Value

bool True if a lockstep group with this ID is enabled on the device.

moveAbsolute()

M

lockstep.moveAbsolute(position, unit = Units::NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
lockstep.moveAbsolute(position, unit, Lockstep::MoveAbsoluteOptions options)

Move the first axis of the lockstep group to an absolute position. The other axes in the lockstep group maintain their offsets throughout movement.

Arguments

Name Type Description
position const double Absolute position.
unit const Units Units of position.
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Lockstep::MoveAbsoluteOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveMax()

M

lockstep.moveMax(waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
lockstep.moveMax(Lockstep::MoveMaxOptions options)

Moves the axes to the maximum valid position. The axes in the lockstep group maintain their offsets throughout movement. Respects lim.max for all axes in the group.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Lockstep::MoveMaxOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveMin()

M

lockstep.moveMin(waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
lockstep.moveMin(Lockstep::MoveMinOptions options)

Moves the axes to the minimum valid position. The axes in the lockstep group maintain their offsets throughout movement. Respects lim.min for all axes in the group.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Lockstep::MoveMinOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveRelative()

M

lockstep.moveRelative(position, unit = Units::NATIVE, waitUntilIdle = true, velocity = 0, velocityUnit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
lockstep.moveRelative(position, unit, Lockstep::MoveRelativeOptions options)

Move the first axis of the lockstep group to a position relative to its current position. The other axes in the lockstep group maintain their offsets throughout movement.

Arguments

Name Type Description
position const double Relative position.
unit const Units Units of position.
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.
velocity const double Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Lockstep::MoveRelativeOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.
velocity const double 0 Movement velocity. Default value of 0 indicates that the maxspeed setting is used instead.
velocityUnit const Units Units::NATIVE Units of velocity.
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

moveVelocity()

M

lockstep.moveVelocity(velocity, unit = Units::NATIVE, acceleration = 0, accelerationUnit = Units::NATIVE)
lockstep.moveVelocity(velocity, unit, Lockstep::MoveVelocityOptions options)

Moves the first axis of the lockstep group at the specified speed. The other axes in the lockstep group maintain their offsets throughout movement.

Arguments

Name Type Description
velocity const double Movement velocity.
unit const Units Units of velocity.
acceleration const double Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units of acceleration.

Lockstep::MoveVelocityOptions

Name Type Default Description
acceleration const double 0 Movement acceleration. Default value of 0 indicates that the accel setting is used instead.
accelerationUnit const Units Units::NATIVE Units of acceleration.

stop()

M

lockstep.stop(waitUntilIdle = true)
lockstep.stop(Lockstep::StopOptions options)

Stops ongoing lockstep group movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether function should return after the movement is finished or just started.

Lockstep::StopOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether function should return after the movement is finished or just started.

toString()

M

lockstep.toString()

Returns a string which represents the enabled lockstep group.

Arguments

No arguments

Return Value

std::string String which represents the enabled lockstep group.

waitUntilIdle()

M

lockstep.waitUntilIdle(throwErrorOnFault = true)
lockstep.waitUntilIdle(Lockstep::WaitUntilIdleOptions options)

Waits until the lockstep group stops moving.

Arguments

Name Type Description
throwErrorOnFault const bool Determines whether to throw error when fault is observed.

Lockstep::WaitUntilIdleOptions

Name Type Default Description
throwErrorOnFault const bool true Determines whether to throw error when fault is observed.

LockstepAxes

The axis numbers of a lockstep group.

To use this type, add #include <zaber/motion/ascii/lockstep_axes.h> to the top of your source code.

axis1

P

lockstepAxes.getAxis1()

int The axis number used to set the first axis.

axis2

P

lockstepAxes.getAxis2()

int The axis number used to set the second axis.

axis3

P

lockstepAxes.getAxis3()

int The axis number used to set the third axis.

axis4

P

lockstepAxes.getAxis4()

int The axis number used to set the fourth axis.

LogOutputMode

Mode of logging output of the library.

To use this type, add #include <zaber/motion/log_output_mode.h> to the top of your source code.

Member Numeric value
LogOutputMode::OFF 0
LogOutputMode::STDOUT 1
LogOutputMode::STDERR 2
LogOutputMode::FILE 3

Measurement

Represents a numerical value with optional units specified.

To use this type, add #include <zaber/motion/measurement.h> to the top of your source code.

unit

P

measurement.getUnit()

Units Optional units of the measurement.

value

P

measurement.getValue()

double Value of the measurement.

MessageType

Denotes type of the response message. For more information refer to: ASCII Protocol Manual.

To use this type, add #include <zaber/motion/ascii/message_type.h> to the top of your source code.

Member Numeric value
MessageType::REPLY 0
MessageType::INFO 1
MessageType::ALERT 2

MotionLibException

Exception originating in the library.

To use this type, add #include <zaber/motion/motion_lib_exception.h> to the top of your source code.

details

P

motionLibException.getDetails()

ExceptionData Additional data for a given exception subclass. The structure of this data is different for each subclass and some subclasses may not even have this property. See the list of available subclasses below for more details.

message

P

motionLibException.getMessage()

std::string Error message of the exception.

toString()

M

motionLibException.toString()

Returns a string that represents the exception.

Arguments

No arguments

Return Value

std::string A string that represents the exception.

Below are the subclasses of MotionLibException:

Exception Description
BinaryCommandFailedException Thrown when a device rejects a binary command with an error.

Details: BinaryCommandFailedExceptionData
CommandFailedException Thrown when a device rejects a command.

Details: CommandFailedExceptionData
CommandPreemptedException Thrown when a movement command gets preempted by another command.
CommandTooLongException Thrown when a command is too long to be written by the ASCII protocol, even when continued across multiple lines.

Details: CommandTooLongExceptionData
ConnectionClosedException Thrown when attempting to communicate on a closed connection.
ConnectionFailedException Thrown when a connection breaks during a request.
ConversionFailedException Thrown when a value cannot be converted using the provided units.
DeviceAddressConflictException Thrown when there is a conflict in device numbers preventing unique addressing.

Details: DeviceAddressConflictExceptionData
DeviceBusyException Thrown when a requested operation fails because the device is currently busy.
DeviceDbFailedException Thrown when device information cannot be retrieved from the device database.

Details: DeviceDbFailedExceptionData
DeviceFailedException Thrown when a device registers fatal failure. Contact support if you observe this exception.
DeviceNotIdentifiedException Thrown when attempting an operation that requires an identified device.
GCodeExecutionException Thrown when a block of G-Code cannot be executed.

Details: GCodeExecutionExceptionData
GCodeSyntaxException Thrown when a block of G-Code cannot be parsed.

Details: GCodeSyntaxExceptionData
InternalErrorException Used for internal error handling. Please report an issue if observed.
InvalidArgumentException Thrown when a function is called with invalid values.
InvalidDataException Thrown when incoming device data cannot be parsed as expected.
InvalidOperationException Thrown when operation cannot be performed at given time or context.
InvalidPacketException Thrown when a packet from a device cannot be parsed.

Details: InvalidPacketExceptionData
InvalidParkStateException Thrown when a device is unable to park.
InvalidResponseException Thrown when a device sends a response with unexpected type or data.

Details: InvalidResponseExceptionData
IoChannelOutOfRangeException Thrown when a device IO operation cannot be performed because the provided channel is not valid.
IoFailedException Thrown when the library cannot perform an operation on a file.
LockstepEnabledException Thrown when an operation cannot be performed because lockstep motion is enabled.
LockstepNotEnabledException Thrown when an operation cannot be performed because lockstep motion is not enabled.
MovementFailedException Thrown when a device registers a fault during movement.

Details: MovementFailedExceptionData
MovementInterruptedException Thrown when ongoing movement is interrupted by another command or user input.

Details: MovementInterruptedExceptionData
NoDeviceFoundException Thrown when no devices can be found on a connection.
NoValueForKeyException Thrown when trying to access a key that has not been set.
NotSupportedException Thrown when a device does not support a requested command or setting.
OsFailedException Thrown when an operation fails due to underlying operating system error.
OutOfRequestIdsException Thrown when the library is overwhelmed with too many simultaneous requests.
RequestTimeoutException Thrown when a device does not respond to a request in time.
SerialPortBusyException Thrown when a serial port cannot be opened because it is in use by another application.
SetDeviceStateFailedException Thrown when a device cannot be set to the supplied state.

Details: SetDeviceStateExceptionData
SetPeripheralStateFailedException Thrown when an axis cannot be set to the supplied state.

Details: SetPeripheralStateExceptionData
SettingNotFoundException Thrown when a get or a set command cannot be found for a setting.
StreamExecutionException Thrown when a streamed motion fails.

Details: StreamExecutionExceptionData
StreamModeException Thrown when an operation is not supported by a mode the stream is currently set up in.
StreamMovementFailedException Thrown when a device registers a fault during streamed movement.

Details: StreamMovementFailedExceptionData
StreamMovementInterruptedException Thrown when ongoing stream movement is interrupted by another command or user input.

Details: StreamMovementInterruptedExceptionData
StreamSetupFailedException Thrown when setting up a stream fails.
TransportAlreadyUsedException Thrown when a transport has already been used to open another connection.
UnknownRequestException Used for internal error handling. Indicates mixed library binary files. Reinstall the library.

MovementFailedExceptionData

Contains additional data for MovementFailedException.

To use this type, add #include <zaber/motion/exceptions/movement_failed_exception_data.h> to the top of your source code.

reason

P

movementFailedExceptionData.getReason()

std::string The reason for the Exception.

warnings

P

movementFailedExceptionData.getWarnings()

std::vector<std::string> The full list of warnings.

MovementInterruptedExceptionData

Contains additional data for MovementInterruptedException.

To use this type, add #include <zaber/motion/exceptions/movement_interrupted_exception_data.h> to the top of your source code.

reason

P

movementInterruptedExceptionData.getReason()

std::string The reason for the Exception.

warnings

P

movementInterruptedExceptionData.getWarnings()

std::vector<std::string> The full list of warnings.

OfflineTranslator

Represents an offline G-Code translator. It allows to translate G-Code blocks to Zaber ASCII protocol stream commands. This translator does not need a connected device to perform translation. Requires at least Firmware 7.11.

To use this type, add #include <zaber/motion/gcode/offline_translator.h> to the top of your source code.

coordinateSystem

P

offlineTranslator.getCoordinateSystem()

std::string Current coordinate system.

translatorId

P

offlineTranslator.getTranslatorId()

int The ID of the translator that serves to identify native resources.

flush()

M

offlineTranslator.flush()

Flushes the remaining stream commands waiting in optimization buffer. The flush is also performed by M2 and M30 codes.

Arguments

No arguments

Return Value

std::vector<std::string> The remaining stream commands.

getAxisCoordinateSystemOffset()

M

offlineTranslator.getAxisCoordinateSystemOffset(coordinateSystem, axis, unit)

Gets offset of an axis in a given coordinate system.

Arguments

Name Type Description
coordinateSystem const std::string& Coordinate system (e.g. G54).
axis const std::string& Letter of the axis.
unit const Units Units of position.

Return Value

double Offset in translator units of the axis.

getAxisPosition()

M

offlineTranslator.getAxisPosition(axis, unit)

Gets position of translator's axis. This method does not query device but returns value from translator's state.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
unit const Units Units of position.

Return Value

double Position of translator's axis.

resetAfterStreamError()

M

offlineTranslator.resetAfterStreamError()

Resets internal state after device rejected generated command. Axis positions become uninitialized.

Arguments

No arguments

setAxisHomePosition()

M

offlineTranslator.setAxisHomePosition(axis, position, unit)

Sets the home position of translator's axis. This position is used by G28.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The home position.
unit const Units Units of position.

setAxisPosition()

M

offlineTranslator.setAxisPosition(axis, position, unit)

Sets position of translator's axis. Use this method to set position after performing movement outside of the translator. This method does not cause any movement.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The position.
unit const Units Units of position.

setAxisSecondaryHomePosition()

M

offlineTranslator.setAxisSecondaryHomePosition(axis, position, unit)

Sets the secondary home position of translator's axis. This position is used by G30.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The home position.
unit const Units Units of position.

setFeedRateOverride()

M

offlineTranslator.setFeedRateOverride(coefficient)

Allows to scale feed rate of the translated code by a coefficient.

Arguments

Name Type Description
coefficient const double Coefficient of the original feed rate.

setTraverseRate()

M

offlineTranslator.setTraverseRate(traverseRate, unit)

Sets the speed at which the device moves when traversing (G0).

Arguments

Name Type Description
traverseRate const double The traverse rate.
unit const Units Units of the traverse rate.

setup()

S

OfflineTranslator.setup(definition, config = TranslatorConfig::getEmpty())

Sets up translator from provided device definition and configuration.

Arguments

Name Type Description
definition const DeviceDefinition& Definition of device and its peripherals. The definition must match a device that later performs the commands.
config const TranslatorConfig& Configuration of the translator.

Return Value

OfflineTranslator New instance of translator.

setupFromDevice()

S

OfflineTranslator.setupFromDevice(device, axes, config = TranslatorConfig::getEmpty())

Sets up an offline translator from provided device, axes, and configuration.

Arguments

Name Type Description
device const Device& Device that later performs the command streaming.
axes const std::vector<int>& Axis numbers that are later used to setup the stream. For a lockstep group specify only the first axis of the group.
config const TranslatorConfig& Configuration of the translator.

Return Value

OfflineTranslator New instance of translator.

translate()

M

offlineTranslator.translate(block)

Translates a single block (line) of G-code.

Arguments

Name Type Description
block const std::string& Block (line) of G-code.

Return Value

TranslateResult Result of translation containing the stream commands.

Oscilloscope

Provides a convenient way to control the oscilloscope data recording feature of some devices. The oscilloscope can record the values of some settings over time at high resolution. Requires at least Firmware 7.00.

To use this type, add #include <zaber/motion/ascii/oscilloscope.h> to the top of your source code.

device

P

oscilloscope.getDevice()

Device Device that this Oscilloscope measures.

addChannel()

M

oscilloscope.addChannel(axis, setting)

Select a setting to be recorded.

Arguments

Name Type Description
axis const int The 1-based index of the axis to record the value from.
setting const std::string& The name of a setting to record.

clear()

M

oscilloscope.clear()

Clear the list of channels to record.

Arguments

No arguments

getBufferSize()

M

oscilloscope.getBufferSize()

Get the number of samples that can be recorded per channel given the current number of channels added.

Arguments

No arguments

Return Value

int Number of samples that will be recorded per channel with the current channels. Zero if none have been added.

getDelay()

M

oscilloscope.getDelay(unit = Units::NATIVE)

Get the delay before oscilloscope recording starts.

Arguments

Name Type Description
unit const Units Unit of measure to represent the delay in.

Return Value

double The current start delay in the selected time units.

getMaxBufferSize()

M

oscilloscope.getMaxBufferSize()

Get the maximum number of samples that can be recorded per Oscilloscope channel.

Arguments

No arguments

Return Value

int The maximum number of samples that can be recorded per Oscilloscope channel.

getMaxChannels()

M

oscilloscope.getMaxChannels()

Get the maximum number of channels that can be recorded.

Arguments

No arguments

Return Value

int The maximum number of channels that can be added to an Oscilloscope recording.

getTimebase()

M

oscilloscope.getTimebase(unit = Units::NATIVE)

Get the current sampling interval.

Arguments

Name Type Description
unit const Units Unit of measure to represent the timebase in.

Return Value

double The current sampling interval in the selected time units.

read()

M

oscilloscope.read()

Reads the last-recorded data from the oscilloscope. Will block until any in-progress recording completes.

Arguments

No arguments

Return Value

std::vector<OscilloscopeData> Array of recorded channel data arrays, in the order added.

setDelay()

M

oscilloscope.setDelay(interval, unit = Units::NATIVE)

Set the sampling start delay.

Arguments

Name Type Description
interval const double Delay time between triggering a recording and the first data point being recorded.
unit const Units Unit of measure the delay is represented in.

setTimebase()

M

oscilloscope.setTimebase(interval, unit = Units::NATIVE)

Set the sampling interval.

Arguments

Name Type Description
interval const double Sample interval for the next oscilloscope recording. Minimum value is 100µs.
unit const Units Unit of measure the timebase is represented in.

start()

M

oscilloscope.start(captureLength = 0)

Trigger data recording.

Arguments

Name Type Description
captureLength const int Optional number of samples to record per channel. If left empty, the device records samples until the buffer fills.

stop()

M

oscilloscope.stop()

End data recording if currently in progress.

Arguments

No arguments

OscilloscopeCaptureProperties

The public properties of one channel of recorded oscilloscope data.

To use this type, add #include <zaber/motion/ascii/oscilloscope_capture_properties.h> to the top of your source code.

axisNumber

P

oscilloscopeCaptureProperties.getAxisNumber()

int The number of the axis the data was recorded from, or 0 for the controller.

setting

P

oscilloscopeCaptureProperties.getSetting()

std::string The name of the recorded setting.

OscilloscopeData

Contains a block of contiguous recorded data for one channel of the device's oscilloscope.

To use this type, add #include <zaber/motion/ascii/oscilloscope_data.h> to the top of your source code.

axisNumber

P

oscilloscopeData.getAxisNumber()

int The number of the axis the data was recorded from, or 0 for the controller.

dataId

P

oscilloscopeData.getDataId()

int Unique ID for this block of recorded data.

setting

P

oscilloscopeData.getSetting()

std::string The name of the recorded setting.

getData()

M

oscilloscopeData.getData(unit = Units::NATIVE)

Get the recorded data as an array of doubles.

Arguments

Name Type Description
unit const Units Unit of measure to convert the data to.

Return Value

std::vector<double> The recorded data for one oscilloscope channel, converted to the units specified.

getDelay()

M

oscilloscopeData.getDelay(unit = Units::NATIVE)

Get the user-specified time period between receipt of the start command and the first data point. Under some circumstances, the actual delay may be different - call GetSampleTime(0) to get the effective delay.

Arguments

Name Type Description
unit const Units Unit of measure to represent the delay in.

Return Value

double The delay setting at the time the data was recorded.

getSampleTime()

M

oscilloscopeData.getSampleTime(index, unit = Units::NATIVE)

Calculate the time a sample was recorded, relative to when the recording was triggered.

Arguments

Name Type Description
index const int 0-based index of the sample to calculate the time of.
unit const Units Unit of measure to represent the calculated time in.

Return Value

double The calculated time offset of the data sample at the given index.

getTimebase()

M

oscilloscopeData.getTimebase(unit = Units::NATIVE)

Get the sample interval that this data was recorded with.

Arguments

Name Type Description
unit const Units Unit of measure to represent the timebase in.

Return Value

double The timebase setting at the time the data was recorded.

ParamsetInfo

The raw parameters currently saved to a given paramset.

To use this type, add #include <zaber/motion/ascii/paramset_info.h> to the top of your source code.

params

P

paramsetInfo.getParams()

std::vector<ServoTuningParam> The raw tuning parameters of this device.

type

P

paramsetInfo.getType()

std::string The tuning algorithm used for this axis.

version

P

paramsetInfo.getVersion()

int The version of the tuning algorithm used for this axis.

PidTuning

The tuning of this axis represented by PID parameters.

To use this type, add #include <zaber/motion/ascii/pid_tuning.h> to the top of your source code.

d

P

pidTuning.getD()

double The derivative tuning argument.

fc

P

pidTuning.getFc()

double The frequency cutoff for the tuning.

i

P

pidTuning.getI()

double The integral tuning argument.

p

P

pidTuning.getP()

double The positional tuning argument.

type

P

pidTuning.getType()

std::string The tuning algorithm used to tune this axis.

version

P

pidTuning.getVersion()

int The version of the tuning algorithm used to tune this axis.

Response

Response message from the device.

To use this type, add #include <zaber/motion/ascii/response.h> to the top of your source code.

axisNumber

P

response.getAxisNumber()

int Number of the axis which the response applies to. Zero denotes device scope.

data

P

response.getData()

std::string Response data which varies depending on the request.

deviceAddress

P

response.getDeviceAddress()

int Number of the device that sent the message.

messageType

P

response.getMessageType()

MessageType Type of the reply received.

replyFlag

P

response.getReplyFlag()

std::string The reply flag indicates if the request was accepted (OK) or rejected (RJ).

status

P

response.getStatus()

std::string The device status contains BUSY when the axis is moving and IDLE otherwise.

warningFlag

P

response.getWarningFlag()

std::string The warning flag contains the highest priority warning currently active for the device or axis.

RotationDirection

Direction of rotation.

To use this type, add #include <zaber/motion/rotation_direction.h> to the top of your source code.

Member Numeric value
RotationDirection::CLOCKWISE 0
RotationDirection::COUNTERCLOCKWISE 1
RotationDirection::CW 0
RotationDirection::CCW 1

ServoTuner

Exposes the capabilities to inspect and edit an axis' servo tuning. Requires at least Firmware 6.25 or 7.00.

To use this type, add #include <zaber/motion/ascii/servo_tuner.h> to the top of your source code.

ServoTuner()

Constructor

new ServoTuner(axis)

Creates instance of ServoTuner for the given axis.

Arguments

Name Type Description
axis Axis The axis that will be tuned.

axis

P

servoTuner.getAxis()

Axis The axis that will be tuned.

getPidTuning()

M

servoTuner.getPidTuning(paramset)

Gets the PID representation of this paramset's servo tuning.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to get tuning for.

Return Value

PidTuning The PID representation of the current tuning.

getSimpleTuningParamDefinitions()

M

servoTuner.getSimpleTuningParamDefinitions()

Gets the parameters that are required to tune this device.

Arguments

No arguments

Return Value

std::vector<SimpleTuningParamDefinition> The tuning parameters.

getStartupParamset()

M

servoTuner.getStartupParamset()

Get the paramset that this device uses by default when it starts up.

Arguments

No arguments

Return Value

ServoTuningParamset The paramset used at when the device restarts.

getTuning()

M

servoTuner.getTuning(paramset)

Get the full set of tuning parameters used by the firmware driving this axis.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to get tuning for.

Return Value

ParamsetInfo The raw representation of the current tuning.

loadParamset()

M

servoTuner.loadParamset(toParamset, fromParamset)

Load the values from one paramset into another.

Arguments

Name Type Description
toParamset const ServoTuningParamset The paramset to load into.
fromParamset const ServoTuningParamset The paramset to load from.

setPidTuning()

M

servoTuner.setPidTuning(paramset, p, i, d, fc)

Sets the tuning of a paramset using the PID method.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to get tuning for.
p const double The proportional gain. Must be in units of N/m.
i const double The integral gain. Must be in units of N/m⋅s.
d const double The derivative gain. Must be in units of N⋅s/m.
fc const double The cutoff frequency. Must be in units of Hz.

Return Value

PidTuning The PID representation of the current tuning after your changes have been applied.

setSimpleTuning()

M

servoTuner.setSimpleTuning(paramset, tuningParams, loadMass, carriageMass = -1.0)
servoTuner.setSimpleTuning(paramset, tuningParams, loadMass, ServoTuner::SetSimpleTuningOptions options)

Set the tuning of this device using the simple input method.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to set tuning for.
tuningParams const std::vector<ServoTuningParam>& The params used to tune this device. To get what parameters are expected, call GetSimpleTuningParamList. All values must be between 0 and 1.
loadMass const double The mass loaded on the stage (excluding the mass of the carriage itself) in kg.
carriageMass const double The mass of the carriage in kg. If this value is not set the default carriage mass is used.

ServoTuner::SetSimpleTuningOptions

Name Type Default Description
carriageMass const double -1.0 The mass of the carriage in kg. If this value is not set the default carriage mass is used.

setStartupParamset()

M

servoTuner.setStartupParamset(paramset)

Set the paramset that this device uses by default when it starts up.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to use at startup.

setTuning()

M

servoTuner.setTuning(paramset, tuningParams)

Set individual tuning parameters. Only use this method if you have a strong understanding of Zaber specific tuning parameters.

Arguments

Name Type Description
paramset const ServoTuningParamset The paramset to set tuning of.
tuningParams const std::vector<ServoTuningParam>& The params to set.

ServoTuningParam

A parameter used to establish the servo tuning of an axis.

To use this type, add #include <zaber/motion/ascii/servo_tuning_param.h> to the top of your source code.

name

P

servoTuningParam.getName()

std::string The name of the parameter to set.

value

P

servoTuningParam.getValue()

double The value to use for this parameter.

ServoTuningParamset

Servo Tuning Parameter Set to target.

To use this type, add #include <zaber/motion/ascii/servo_tuning_paramset.h> to the top of your source code.

Member Numeric value
ServoTuningParamset::LIVE 0
ServoTuningParamset::P_1 1
ServoTuningParamset::P_2 2
ServoTuningParamset::P_3 3
ServoTuningParamset::P_4 4
ServoTuningParamset::P_5 5
ServoTuningParamset::P_6 6
ServoTuningParamset::P_7 7
ServoTuningParamset::P_8 8
ServoTuningParamset::P_9 9
ServoTuningParamset::STAGING 10
ServoTuningParamset::DEFAULT 11

SetDeviceStateExceptionData

Contains additional data for a SetDeviceStateFailedException.

To use this type, add #include <zaber/motion/exceptions/set_device_state_exception_data.h> to the top of your source code.

peripherals

P

setDeviceStateExceptionData.getPeripherals()

std::vector<SetPeripheralStateExceptionData> Errors for any peripherals that could not be set.

servoTuning

P

setDeviceStateExceptionData.getServoTuning()

std::string The reason servo tuning could not be set.

settings

P

setDeviceStateExceptionData.getSettings()

std::vector<std::string> A list of settings which could not be set.

storage

P

setDeviceStateExceptionData.getStorage()

std::vector<std::string> The reasons storage could not be set.

storedPositions

P

setDeviceStateExceptionData.getStoredPositions()

std::vector<std::string> The reasons stored positions could not be set.

streamBuffers

P

setDeviceStateExceptionData.getStreamBuffers()

std::vector<std::string> The reason the stream buffers could not be set.

triggers

P

setDeviceStateExceptionData.getTriggers()

std::vector<std::string> The reason the triggers could not be set.

SetPeripheralStateExceptionData

Contains additional data for a SetPeripheralStateFailedException.

To use this type, add #include <zaber/motion/exceptions/set_peripheral_state_exception_data.h> to the top of your source code.

axisNumber

P

setPeripheralStateExceptionData.getAxisNumber()

int The number of axis where the exception originated.

servoTuning

P

setPeripheralStateExceptionData.getServoTuning()

std::string The reason servo tuning could not be set.

settings

P

setPeripheralStateExceptionData.getSettings()

std::vector<std::string> A list of settings which could not be set.

storage

P

setPeripheralStateExceptionData.getStorage()

std::vector<std::string> The reasons storage could not be set.

storedPositions

P

setPeripheralStateExceptionData.getStoredPositions()

std::vector<std::string> The reasons stored positions could not be set.

SettingConstants

Named constants for all Zaber ASCII protocol settings. For more information please refer to the ASCII Protocol Manual.

To use this type, add #include <zaber/motion/ascii/setting_constants.h> to the top of your source code.

Constant Value
SettingConstants::ACCEL accel
SettingConstants::CALIBRATION_TYPE calibration.type
SettingConstants::CLOOP_CONTINUOUS_ENABLE cloop.continuous.enable
SettingConstants::CLOOP_COUNTS cloop.counts
SettingConstants::CLOOP_DISPLACE_TOLERANCE cloop.displace.tolerance
SettingConstants::CLOOP_DURATION_MAX cloop.duration.max
SettingConstants::CLOOP_ENABLE cloop.enable
SettingConstants::CLOOP_MODE cloop.mode
SettingConstants::CLOOP_RECOVERY_ENABLE cloop.recovery.enable
SettingConstants::CLOOP_SERVO_ENABLE cloop.servo.enable
SettingConstants::CLOOP_SETTLE_PERIOD cloop.settle.period
SettingConstants::CLOOP_SETTLE_TOLERANCE cloop.settle.tolerance
SettingConstants::CLOOP_STALL_ACTION cloop.stall.action
SettingConstants::CLOOP_STALL_DETECT_MODE cloop.stall.detect.mode
SettingConstants::CLOOP_STALL_TOLERANCE cloop.stall.tolerance
SettingConstants::CLOOP_STALLTIMEOUT cloop.stalltimeout
SettingConstants::CLOOP_STEPS cloop.steps
SettingConstants::CLOOP_TIMEOUT cloop.timeout
SettingConstants::COMM_ADDRESS comm.address
SettingConstants::COMM_ALERT comm.alert
SettingConstants::COMM_CHECKSUM comm.checksum
SettingConstants::COMM_COMMAND_PACKETS_MAX comm.command.packets.max
SettingConstants::COMM_EN_IPV_4_ADDRESS comm.en.ipv4.address
SettingConstants::COMM_EN_IPV_4_DHCP_ENABLED comm.en.ipv4.dhcp.enabled
SettingConstants::COMM_EN_IPV_4_GATEWAY comm.en.ipv4.gateway
SettingConstants::COMM_EN_IPV_4_NETMASK comm.en.ipv4.netmask
SettingConstants::COMM_EN_MAC comm.en.mac
SettingConstants::COMM_EN_MDNS_ENABLE comm.en.mdns.enable
SettingConstants::COMM_NEXT_OWNER comm.next.owner
SettingConstants::COMM_PACKET_SIZE_MAX comm.packet.size.max
SettingConstants::COMM_PROTOCOL comm.protocol
SettingConstants::COMM_RS_232_BAUD comm.rs232.baud
SettingConstants::COMM_RS_232_PROTOCOL comm.rs232.protocol
SettingConstants::COMM_RS_485_BAUD comm.rs485.baud
SettingConstants::COMM_RS_485_ENABLE comm.rs485.enable
SettingConstants::COMM_RS_485_PROTOCOL comm.rs485.protocol
SettingConstants::COMM_USB_PROTOCOL comm.usb.protocol
SettingConstants::COMM_WORD_SIZE_MAX comm.word.size.max
SettingConstants::DEVICE_HW_MODIFIED device.hw.modified
SettingConstants::DEVICE_ID device.id
SettingConstants::DEVICE_ID_LEGACY deviceid
SettingConstants::DRIVER_CURRENT_CONTINUOUS driver.current.continuous
SettingConstants::DRIVER_CURRENT_CONTINUOUS_MAX driver.current.continuous.max
SettingConstants::DRIVER_CURRENT_HOLD driver.current.hold
SettingConstants::DRIVER_CURRENT_MAX driver.current.max
SettingConstants::DRIVER_CURRENT_OVERDRIVE driver.current.overdrive
SettingConstants::DRIVER_CURRENT_OVERDRIVE_DURATION driver.current.overdrive.duration
SettingConstants::DRIVER_CURRENT_OVERDRIVE_MAX driver.current.overdrive.max
SettingConstants::DRIVER_CURRENT_RUN driver.current.run
SettingConstants::DRIVER_CURRENT_SERVO driver.current.servo
SettingConstants::DRIVER_DIR driver.dir
SettingConstants::DRIVER_ENABLED driver.enabled
SettingConstants::DRIVER_I_2_T_MEASURED driver.i2t.measured
SettingConstants::DRIVER_TEMPERATURE driver.temperature
SettingConstants::ENCODER_1_COUNT encoder.1.count
SettingConstants::ENCODER_1_COUNT_CAL encoder.1.count.cal
SettingConstants::ENCODER_1_DIR encoder.1.dir
SettingConstants::ENCODER_1_FAULT_TYPE encoder.1.fault.type
SettingConstants::ENCODER_1_FILTER encoder.1.filter
SettingConstants::ENCODER_1_INDEX_MODE encoder.1.index.mode
SettingConstants::ENCODER_1_MODE encoder.1.mode
SettingConstants::ENCODER_1_POS encoder.1.pos
SettingConstants::ENCODER_1_POS_ERROR encoder.1.pos.error
SettingConstants::ENCODER_1_RATIO_DIV encoder.1.ratio.div
SettingConstants::ENCODER_1_RATIO_MULT encoder.1.ratio.mult
SettingConstants::ENCODER_1_REF_PHASE encoder.1.ref.phase
SettingConstants::ENCODER_1_TYPE encoder.1.type
SettingConstants::ENCODER_2_COS encoder.2.cos
SettingConstants::ENCODER_2_COS_DC encoder.2.cos.dc
SettingConstants::ENCODER_2_COS_DC_TUNE encoder.2.cos.dc.tune
SettingConstants::ENCODER_2_COS_GAIN encoder.2.cos.gain
SettingConstants::ENCODER_2_COS_GAIN_TUNE encoder.2.cos.gain.tune
SettingConstants::ENCODER_2_COUNT encoder.2.count
SettingConstants::ENCODER_2_COUNT_CAL encoder.2.count.cal
SettingConstants::ENCODER_2_DIR encoder.2.dir
SettingConstants::ENCODER_2_FAULT_TYPE encoder.2.fault.type
SettingConstants::ENCODER_2_FILTER encoder.2.filter
SettingConstants::ENCODER_2_INDEX_MODE encoder.2.index.mode
SettingConstants::ENCODER_2_INTERPOLATION encoder.2.interpolation
SettingConstants::ENCODER_2_MODE encoder.2.mode
SettingConstants::ENCODER_2_OUT_ENABLE encoder.2.out.enable
SettingConstants::ENCODER_2_OUT_INTERPOLATION encoder.2.out.interpolation
SettingConstants::ENCODER_2_OUT_WIDTH encoder.2.out.width
SettingConstants::ENCODER_2_POS encoder.2.pos
SettingConstants::ENCODER_2_POS_ERROR encoder.2.pos.error
SettingConstants::ENCODER_2_RATIO_DIV encoder.2.ratio.div
SettingConstants::ENCODER_2_RATIO_MULT encoder.2.ratio.mult
SettingConstants::ENCODER_2_SIGNAL_MIN encoder.2.signal.min
SettingConstants::ENCODER_2_SIN encoder.2.sin
SettingConstants::ENCODER_2_SIN_DC encoder.2.sin.dc
SettingConstants::ENCODER_2_SIN_DC_TUNE encoder.2.sin.dc.tune
SettingConstants::ENCODER_2_SIN_GAIN encoder.2.sin.gain
SettingConstants::ENCODER_2_SIN_GAIN_TUNE encoder.2.sin.gain.tune
SettingConstants::ENCODER_2_TYPE encoder.2.type
SettingConstants::ENCODER_COUNT encoder.count
SettingConstants::ENCODER_COUNT_CAL encoder.count.cal
SettingConstants::ENCODER_COUNT_CALIBRATED encoder.count.calibrated
SettingConstants::ENCODER_DIR encoder.dir
SettingConstants::ENCODER_ERROR encoder.error
SettingConstants::ENCODER_FAULT_TYPE encoder.fault.type
SettingConstants::ENCODER_FILTER encoder.filter
SettingConstants::ENCODER_INDEX_COUNT encoder.index.count
SettingConstants::ENCODER_INDEX_MODE encoder.index.mode
SettingConstants::ENCODER_INDEX_PHASE encoder.index.phase
SettingConstants::ENCODER_MODE encoder.mode
SettingConstants::ENCODER_PORT_DEFAULT encoder.port.default
SettingConstants::ENCODER_POS encoder.pos
SettingConstants::ENCODER_POS_ERROR encoder.pos.error
SettingConstants::ENCODER_RATIO_DIV encoder.ratio.div
SettingConstants::ENCODER_RATIO_MULT encoder.ratio.mult
SettingConstants::ENCODER_VEL encoder.vel
SettingConstants::FILTER_HOLDERID filter.holderid
SettingConstants::FORCE_AVERAGE force.average
SettingConstants::FORCE_MAX force.max
SettingConstants::ICTRL_ADVANCE_A ictrl.advance.a
SettingConstants::ICTRL_ADVANCE_OFFSET ictrl.advance.offset
SettingConstants::ICTRL_AFCFF_INDUCTANCE ictrl.afcff.inductance
SettingConstants::ICTRL_AFCFF_KE ictrl.afcff.ke
SettingConstants::ICTRL_AFCFF_KI ictrl.afcff.ki
SettingConstants::ICTRL_AFCFF_MAX ictrl.afcff.max
SettingConstants::ICTRL_AFCFF_SS ictrl.afcff.ss
SettingConstants::ICTRL_AFCFF_SS_MAX ictrl.afcff.ss.max
SettingConstants::ICTRL_DELAY ictrl.delay
SettingConstants::ICTRL_FF_KD ictrl.ff.kd
SettingConstants::ICTRL_FF_KP ictrl.ff.kp
SettingConstants::ICTRL_GAIN_COLDMULT ictrl.gain.coldmult
SettingConstants::ICTRL_PERIOD ictrl.period
SettingConstants::ICTRL_PI_KI ictrl.pi.ki
SettingConstants::ICTRL_PI_KP ictrl.pi.kp
SettingConstants::ICTRL_TYPE ictrl.type
SettingConstants::IO_DI_PORT io.di.port
SettingConstants::IO_DO_PORT io.do.port
SettingConstants::JOY_DEBUG joy.debug
SettingConstants::KNOB_DIR knob.dir
SettingConstants::KNOB_DISTANCE knob.distance
SettingConstants::KNOB_ENABLE knob.enable
SettingConstants::KNOB_FORCE knob.force
SettingConstants::KNOB_FORCEPROFILE knob.forceprofile
SettingConstants::KNOB_MAXSPEED knob.maxspeed
SettingConstants::KNOB_MODE knob.mode
SettingConstants::KNOB_SPEEDPROFILE knob.speedprofile
SettingConstants::LAMP_CURRENT lamp.current
SettingConstants::LAMP_CURRENT_MAX lamp.current.max
SettingConstants::LAMP_FLUX lamp.flux
SettingConstants::LAMP_FLUX_MAX lamp.flux.max
SettingConstants::LAMP_STATUS lamp.status
SettingConstants::LAMP_TEMPERATURE lamp.temperature
SettingConstants::LAMP_WAVELENGTH_FWHM lamp.wavelength.fwhm
SettingConstants::LAMP_WAVELENGTH_PEAK lamp.wavelength.peak
SettingConstants::LIMIT_APPROACH_ACCEL limit.approach.accel
SettingConstants::LIMIT_APPROACH_MAXSPEED limit.approach.maxspeed
SettingConstants::LIMIT_AWAY_ACTION limit.away.action
SettingConstants::LIMIT_AWAY_EDGE limit.away.edge
SettingConstants::LIMIT_AWAY_OFFSET limit.away.offset
SettingConstants::LIMIT_AWAY_POS limit.away.pos
SettingConstants::LIMIT_AWAY_POSUPDATE limit.away.posupdate
SettingConstants::LIMIT_AWAY_PRESET limit.away.preset
SettingConstants::LIMIT_AWAY_SOURCE limit.away.source
SettingConstants::LIMIT_AWAY_STATE limit.away.state
SettingConstants::LIMIT_AWAY_TRIGGERED limit.away.triggered
SettingConstants::LIMIT_AWAY_TUNE limit.away.tune
SettingConstants::LIMIT_AWAY_TYPE limit.away.type
SettingConstants::LIMIT_AWAY_WIDTH limit.away.width
SettingConstants::LIMIT_C_ACTION limit.c.action
SettingConstants::LIMIT_C_EDGE limit.c.edge
SettingConstants::LIMIT_C_OFFSET limit.c.offset
SettingConstants::LIMIT_C_POS limit.c.pos
SettingConstants::LIMIT_C_POSUPDATE limit.c.posupdate
SettingConstants::LIMIT_C_PRESET limit.c.preset
SettingConstants::LIMIT_C_SOURCE limit.c.source
SettingConstants::LIMIT_C_STATE limit.c.state
SettingConstants::LIMIT_C_TRIGGERED limit.c.triggered
SettingConstants::LIMIT_C_TUNE limit.c.tune
SettingConstants::LIMIT_C_TYPE limit.c.type
SettingConstants::LIMIT_C_WIDTH limit.c.width
SettingConstants::LIMIT_CYCLE_DIST limit.cycle.dist
SettingConstants::LIMIT_D_ACTION limit.d.action
SettingConstants::LIMIT_D_EDGE limit.d.edge
SettingConstants::LIMIT_D_POS limit.d.pos
SettingConstants::LIMIT_D_POSUPDATE limit.d.posupdate
SettingConstants::LIMIT_D_PRESET limit.d.preset
SettingConstants::LIMIT_D_STATE limit.d.state
SettingConstants::LIMIT_D_TRIGGERED limit.d.triggered
SettingConstants::LIMIT_D_TYPE limit.d.type
SettingConstants::LIMIT_DETECT_DECELONLY limit.detect.decelonly
SettingConstants::LIMIT_DETECT_MAXSPEED limit.detect.maxspeed
SettingConstants::LIMIT_HOME_ACTION limit.home.action
SettingConstants::LIMIT_HOME_BIDIRECTIONAL limit.home.bidirectional
SettingConstants::LIMIT_HOME_EDGE limit.home.edge
SettingConstants::LIMIT_HOME_OFFSET limit.home.offset
SettingConstants::LIMIT_HOME_POS limit.home.pos
SettingConstants::LIMIT_HOME_POSUPDATE limit.home.posupdate
SettingConstants::LIMIT_HOME_PRESET limit.home.preset
SettingConstants::LIMIT_HOME_SOURCE limit.home.source
SettingConstants::LIMIT_HOME_STATE limit.home.state
SettingConstants::LIMIT_HOME_TRIGGERED limit.home.triggered
SettingConstants::LIMIT_HOME_TUNE limit.home.tune
SettingConstants::LIMIT_HOME_TYPE limit.home.type
SettingConstants::LIMIT_HOME_WIDTH limit.home.width
SettingConstants::LIMIT_MAX limit.max
SettingConstants::LIMIT_MIN limit.min
SettingConstants::LIMIT_RANGE_MODE limit.range.mode
SettingConstants::LIMIT_REF_PHASE limit.ref.phase
SettingConstants::LIMIT_REF_PHASE_MEASURED limit.ref.phase.measured
SettingConstants::LIMIT_START_POS limit.start.pos
SettingConstants::LIMIT_SWAPINPUTS limit.swapinputs
SettingConstants::LOCKSTEP_NUMGROUPS lockstep.numgroups
SettingConstants::LOCKSTEP_TOLERANCE lockstep.tolerance
SettingConstants::MAXSPEED maxspeed
SettingConstants::MOTION_ACCEL_RAMPTIME motion.accel.ramptime
SettingConstants::MOTION_ACCELONLY motion.accelonly
SettingConstants::MOTION_BUSY motion.busy
SettingConstants::MOTION_DECELONLY motion.decelonly
SettingConstants::MOTION_INDEX_DIST motion.index.dist
SettingConstants::MOTION_INDEX_NUM motion.index.num
SettingConstants::MOTOR_CURRENT_CONTINUOUS_MAX motor.current.continuous.max
SettingConstants::MOTOR_CURRENT_MAX motor.current.max
SettingConstants::MOTOR_CURRENT_OVERDRIVE_DURATION motor.current.overdrive.duration
SettingConstants::MOTOR_CURRENT_OVERDRIVE_MAX motor.current.overdrive.max
SettingConstants::MOTOR_I_2_T_MEASURED motor.i2t.measured
SettingConstants::MOTOR_INDUCTANCE motor.inductance
SettingConstants::MOTOR_KE motor.ke
SettingConstants::MOTOR_PHASE motor.phase
SettingConstants::MOTOR_PHASE_RATIO_DIV_1 motor.phase.ratio.div1
SettingConstants::MOTOR_PHASE_RATIO_DIV_2 motor.phase.ratio.div2
SettingConstants::MOTOR_PHASE_RATIO_MULT motor.phase.ratio.mult
SettingConstants::MOTOR_RESISTANCE motor.resistance
SettingConstants::PARKING_STATE parking.state
SettingConstants::PERIPHERAL_HW_MODIFIED peripheral.hw.modified
SettingConstants::PERIPHERAL_ID peripheral.id
SettingConstants::PERIPHERAL_ID_LEGACY peripheralid
SettingConstants::PERIPHERAL_ID_PENDING peripheral.id.pending
SettingConstants::PERIPHERAL_SERIAL peripheral.serial
SettingConstants::PERIPHERAL_SERIAL_PENDING peripheral.serial.pending
SettingConstants::POS pos
SettingConstants::RESOLUTION resolution
SettingConstants::SCOPE_CHANNEL_SIZE scope.channel.size
SettingConstants::SCOPE_CHANNEL_SIZE_MAX scope.channel.size.max
SettingConstants::SCOPE_DELAY scope.delay
SettingConstants::SCOPE_NUMCHANNELS scope.numchannels
SettingConstants::SCOPE_TIMEBASE scope.timebase
SettingConstants::STREAM_NUMBUFS stream.numbufs
SettingConstants::STREAM_NUMSTREAMS stream.numstreams
SettingConstants::SYSTEM_ACCESS system.access
SettingConstants::SYSTEM_AXISCOUNT system.axiscount
SettingConstants::SYSTEM_CURRENT system.current
SettingConstants::SYSTEM_CURRENT_MAX system.current.max
SettingConstants::SYSTEM_LED_ENABLE system.led.enable
SettingConstants::SYSTEM_SERIAL system.serial
SettingConstants::SYSTEM_TEMPERATURE system.temperature
SettingConstants::SYSTEM_VOLTAGE system.voltage
SettingConstants::TRIGGER_NUMACTIONS trigger.numactions
SettingConstants::TRIGGER_NUMTRIGGERS trigger.numtriggers
SettingConstants::USER_DATA_0 user.data.0
SettingConstants::USER_DATA_1 user.data.1
SettingConstants::USER_DATA_10 user.data.10
SettingConstants::USER_DATA_11 user.data.11
SettingConstants::USER_DATA_12 user.data.12
SettingConstants::USER_DATA_13 user.data.13
SettingConstants::USER_DATA_14 user.data.14
SettingConstants::USER_DATA_15 user.data.15
SettingConstants::USER_DATA_2 user.data.2
SettingConstants::USER_DATA_3 user.data.3
SettingConstants::USER_DATA_4 user.data.4
SettingConstants::USER_DATA_5 user.data.5
SettingConstants::USER_DATA_6 user.data.6
SettingConstants::USER_DATA_7 user.data.7
SettingConstants::USER_DATA_8 user.data.8
SettingConstants::USER_DATA_9 user.data.9
SettingConstants::USER_VDATA_0 user.vdata.0
SettingConstants::USER_VDATA_1 user.vdata.1
SettingConstants::USER_VDATA_2 user.vdata.2
SettingConstants::USER_VDATA_3 user.vdata.3
SettingConstants::VEL vel
SettingConstants::VERSION version
SettingConstants::VERSION_BUILD version.build
SettingConstants::VIRTUAL_NUMVIRTUAL virtual.numvirtual

SimpleTuningParamDefinition

Information about a parameter used for the simple tuning method.

To use this type, add #include <zaber/motion/ascii/simple_tuning_param_definition.h> to the top of your source code.

dataType

P

simpleTuningParamDefinition.getDataType()

std::string How this parameter will be parsed by the tuner.

maxLabel

P

simpleTuningParamDefinition.getMaxLabel()

std::string The human readable description of the effect of a higher value on this setting.

minLabel

P

simpleTuningParamDefinition.getMinLabel()

std::string The human readable description of the effect of a lower value on this setting.

name

P

simpleTuningParamDefinition.getName()

std::string The name of the parameter.

Stream

A handle for a stream with this ID 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.

To use this type, add #include <zaber/motion/ascii/stream.h> to the top of your source code.

axes

P

stream.getAxes()

std::vector<StreamAxisDefinition> An array of axes definitions the stream is set up to control.

device

P

stream.getDevice()

Device Device that controls this stream.

mode

P

stream.getMode()

StreamMode Current mode of the stream.

streamId

P

stream.getStreamId()

int The number that identifies the stream on the device.

arcAbsolute()

M

stream.arcAbsolute(rotationDirection, centerX, centerY, endX, endY)

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
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimensions of the position of the center of the circle on which the arc exists.
centerY const Measurement& The second dimensions of the position of the center of the circle on which the arc exists.
endX const Measurement& The first dimensions of the end position of the arc.
endY const Measurement& The second dimensions of the end position of the arc.

arcAbsoluteOn()

M

stream.arcAbsoluteOn(targetAxesIndices, rotationDirection, centerX, centerY, endX, endY)

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
targetAxesIndices const std::vector<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.
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimensions of the position of the center of the circle on which the arc exists.
centerY const Measurement& The second dimensions of the position of the center of the circle on which the arc exists.
endX const Measurement& The first dimensions of the end position of the arc.
endY const Measurement& The second dimensions of the end position of the arc.

arcRelative()

M

stream.arcRelative(rotationDirection, centerX, centerY, endX, endY)

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
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimensions of the position of the center of the circle on which the arc exists.
centerY const Measurement& The second dimensions of the position of the center of the circle on which the arc exists.
endX const Measurement& The first dimensions of the end position of the arc.
endY const Measurement& The second dimensions of the end position of the arc.

arcRelativeOn()

M

stream.arcRelativeOn(targetAxesIndices, rotationDirection, centerX, centerY, endX, endY)

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
targetAxesIndices const std::vector<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.
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimensions of the position of the center of the circle on which the arc exists.
centerY const Measurement& The second dimensions of the position of the center of the circle on which the arc exists.
endX const Measurement& The first dimensions of the end position of the arc.
endY const Measurement& The second dimensions of the end position of the arc.

call()

M

stream.call(streamBuffer)

Append the actions in a stream buffer to the queue.

Arguments

Name Type Description
streamBuffer const StreamBuffer& The stream buffer to call.

checkDisabled()

M

stream.checkDisabled()

Queries the stream status from the device and returns boolean indicating whether the stream is disabled. Useful to determine if streaming was interrupted by other movements.

Arguments

No arguments

Return Value

bool True if the stream is disabled.

circleAbsolute()

M

stream.circleAbsolute(rotationDirection, centerX, centerY)

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
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimension of the position of the center of the circle.
centerY const Measurement& The second dimension of the position of the center of the circle.

circleAbsoluteOn()

M

stream.circleAbsoluteOn(targetAxesIndices, rotationDirection, centerX, centerY)

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
targetAxesIndices const std::vector<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.
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimension of the position of the center of the circle.
centerY const Measurement& The second dimension of the position of the center of the circle.

circleRelative()

M

stream.circleRelative(rotationDirection, centerX, centerY)

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
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimension of the position of the center of the circle.
centerY const Measurement& The second dimension of the position of the center of the circle.

circleRelativeOn()

M

stream.circleRelativeOn(targetAxesIndices, rotationDirection, centerX, centerY)

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
targetAxesIndices const std::vector<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.
rotationDirection const RotationDirection The direction of the rotation.
centerX const Measurement& The first dimension of the position of the center of the circle.
centerY const Measurement& The second dimension of the position of the center of the circle.

cork()

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.

Arguments

No arguments

disable()

M

stream.disable()

Disable the stream. If the stream is not setup, this command does nothing. Once disabled, the stream will no longer accept stream commands. The stream will process the rest of the commands in the queue until it is empty.

Arguments

No arguments

genericCommand()

M

stream.genericCommand(command)

Sends a generic ASCII command to the stream. Keeps resending the command while the device rejects with AGAIN reason.

Arguments

Name Type Description
command const std::string& Command and its parameters.

genericCommandBatch()

M

stream.genericCommandBatch(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 const std::vector<std::string>& Array of commands.

getMaxCentripetalAcceleration()

M

stream.getMaxCentripetalAcceleration(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 const Units Units of acceleration.

Return Value

double The maximum centripetal acceleration of the live stream.

getMaxSpeed()

M

stream.getMaxSpeed(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 const Units Units of velocity.

Return Value

double The maximum speed of the stream.

getMaxTangentialAcceleration()

M

stream.getMaxTangentialAcceleration(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 const Units Units of acceleration.

Return Value

double The maximum tangential acceleration of the live stream.

isBusy()

M

stream.isBusy()

Returns a boolean value indicating whether the live stream is executing a queued action.

Arguments

No arguments

Return Value

bool True if the stream is executing a queued action.

lineAbsolute()

M

stream.lineAbsolute(&...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.

lineAbsoluteOn()

M

stream.lineAbsoluteOn(targetAxesIndices, 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
targetAxesIndices const std::vector<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 const std::vector<Measurement>& Positions for the axes to move to, relative to their home positions.

lineRelative()

M

stream.lineRelative(&...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.

lineRelativeOn()

M

stream.lineRelativeOn(targetAxesIndices, 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
targetAxesIndices const std::vector<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 const std::vector<Measurement>& Positions for the axes to move to, relative to their positions before movement.

setAllAnalogOutputs()

M

stream.setAllAnalogOutputs(values)

Sets values for all analog output channels.

Arguments

Name Type Description
values const std::vector<double>& Voltage values to set the output channels to.

setAllDigitalOutputs()

M

stream.setAllDigitalOutputs(values)

Sets values for all digital output channels.

Arguments

Name Type Description
values const std::vector<bool>& True to set the output channel to conducting and false to turn it off.

setAnalogOutput()

M

stream.setAnalogOutput(channelNumber, value)

Set the value of an analog output channel.

Arguments

Name Type Description
channelNumber const int The number of the analog output channel. Channel numbers are numbered from one.
value const double The value to set the channel to, in volts.

setDigitalOutput()

M

stream.setDigitalOutput(channelNumber, value)

Set the value of a digital output channel.

Arguments

Name Type Description
channelNumber const int The number of the digital output channel. Channel numbers are numbered from one.
value const bool The value to set the channel to.

setMaxCentripetalAcceleration()

M

stream.setMaxCentripetalAcceleration(maxCentripetalAcceleration, 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
maxCentripetalAcceleration const double Maximum centripetal acceleration at which any stream action is executed.
unit const Units Units of acceleration.

setMaxSpeed()

M

stream.setMaxSpeed(maxSpeed, 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
maxSpeed const double Maximum speed at which any stream action is executed.
unit const Units Units of velocity.

setMaxTangentialAcceleration()

M

stream.setMaxTangentialAcceleration(maxTangentialAcceleration, 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
maxTangentialAcceleration const double Maximum tangential acceleration at which any stream action is executed.
unit const Units Units of acceleration.

setupLive()

M

stream.setupLive(&...axes)

Setup the stream to control the specified axes and to queue actions on the device.

Arguments

Name Type Description
&...axes int Numbers of physical axes to setup the stream on.

setupLiveComposite()

M

stream.setupLiveComposite(&...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.

setupStore()

M

stream.setupStore(streamBuffer, &...axes)

Setup the stream to control the specified axes and queue actions into a stream buffer.

Arguments

Name Type Description
streamBuffer const StreamBuffer& The stream buffer to queue actions in.
&...axes int Numbers of physical axes to setup the stream on.

setupStoreArbitraryAxes()

M

stream.setupStoreArbitraryAxes(streamBuffer, axesCount)

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
streamBuffer const StreamBuffer& The stream buffer to queue actions in.
axesCount const int The number of axes in the stream.

setupStoreComposite()

M

stream.setupStoreComposite(streamBuffer, &...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
streamBuffer const StreamBuffer& The stream buffer to queue actions in.
&...axes StreamAxisDefinition Definition of the stream axes.

toggleDigitalOutput()

M

stream.toggleDigitalOutput(channelNumber)

Toggle the value of a digital output channel.

Arguments

Name Type Description
channelNumber const int The number of the digital output channel. Channel numbers are numbered from one.

toString()

M

stream.toString()

Returns a string which represents the stream.

Arguments

No arguments

Return Value

std::string String which represents the stream.

uncork()

M

stream.uncork()

Uncork the front of the queue, unblocking command execution. You can only uncork an idle live stream that is corked.

Arguments

No arguments

wait()

M

stream.wait(time, unit = Units::NATIVE)

Wait a specified time.

Arguments

Name Type Description
time const double Amount of time to wait.
unit const Units Units of time.

waitAnalogInput()

M

stream.waitAnalogInput(channelNumber, condition, value)

Wait for the value of a analog input channel to reach a condition concerning a given value.

Arguments

Name Type Description
channelNumber const int The number of the analog input channel. Channel numbers are numbered from one.
condition const std::string& A condition (e.g. <, <=, ==, !=).
value const double The value that the condition concerns, in volts.

waitDigitalInput()

M

stream.waitDigitalInput(channelNumber, value)

Wait for a digital input channel to reach a given value.

Arguments

Name Type Description
channelNumber const int The number of the digital input channel. Channel numbers are numbered from one.
value const bool The value that the stream should wait for.

waitUntilIdle()

M

stream.waitUntilIdle(throwErrorOnFault = true)
stream.waitUntilIdle(Stream::WaitUntilIdleOptions options)

Waits until the live stream executes all queued actions.

Arguments

Name Type Description
throwErrorOnFault const bool Determines whether to throw error when fault is observed.

Stream::WaitUntilIdleOptions

Name Type Default Description
throwErrorOnFault const bool true Determines whether to throw error when fault is observed.

StreamAxisDefinition

Defines an axis of the stream.

To use this type, add #include <zaber/motion/ascii/stream_axis_definition.h> to the top of your source code.

axisNumber

P

streamAxisDefinition.getAxisNumber()

int Number of a physical axis or a lockstep group.

axisType

P

streamAxisDefinition.getAxisType()

StreamAxisType Defines the type of the axis.

StreamAxisType

Denotes type of the stream axis.

To use this type, add #include <zaber/motion/ascii/stream_axis_type.h> to the top of your source code.

Member Numeric value
StreamAxisType::PHYSICAL 0
StreamAxisType::LOCKSTEP 1

StreamBuffer

Represents a stream buffer with this ID on a device. A stream buffer is a place to store a queue of stream actions.

To use this type, add #include <zaber/motion/ascii/stream_buffer.h> to the top of your source code.

bufferId

P

streamBuffer.getBufferId()

int The number identifying the buffer on the device.

device

P

streamBuffer.getDevice()

Device The Device this buffer exists on.

erase()

M

streamBuffer.erase()

Erase the contents of the buffer. This method fails if there is a stream writing to the buffer.

Arguments

No arguments

getContent()

M

streamBuffer.getContent()

Get the buffer contents as an array of strings.

Arguments

No arguments

Return Value

std::vector<std::string> A string array containing all the stream commands stored in the buffer.

StreamExecutionExceptionData

Contains additional data for StreamExecutionException.

To use this type, add #include <zaber/motion/exceptions/stream_execution_exception_data.h> to the top of your source code.

errorFlag

P

streamExecutionExceptionData.getErrorFlag()

std::string The error flag that caused the exception.

reason

P

streamExecutionExceptionData.getReason()

std::string The reason for the exception.

StreamMode

Mode of a stream.

To use this type, add #include <zaber/motion/ascii/stream_mode.h> to the top of your source code.

Member Numeric value
StreamMode::DISABLED 0
StreamMode::STORE 1
StreamMode::STORE_ARBITRARY_AXES 2
StreamMode::LIVE 3

StreamMovementFailedExceptionData

Contains additional data for StreamMovementFailedException.

To use this type, add #include <zaber/motion/exceptions/stream_movement_failed_exception_data.h> to the top of your source code.

reason

P

streamMovementFailedExceptionData.getReason()

std::string The reason for the Exception.

warnings

P

streamMovementFailedExceptionData.getWarnings()

std::vector<std::string> The full list of warnings.

StreamMovementInterruptedExceptionData

Contains additional data for StreamMovementInterruptedException.

To use this type, add #include <zaber/motion/exceptions/stream_movement_interrupted_exception_data.h> to the top of your source code.

reason

P

streamMovementInterruptedExceptionData.getReason()

std::string The reason for the Exception.

warnings

P

streamMovementInterruptedExceptionData.getWarnings()

std::vector<std::string> The full list of warnings.

Tools

Class providing various utility functions.

To use this type, add #include <zaber/motion/tools.h> to the top of your source code.

getMessageRouterPipePath()

S

Tools.getMessageRouterPipePath()

Returns path of message router named pipe on Windows or file path of unix domain socket on UNIX.

Arguments

No arguments

Return Value

std::string Path of message router's named pipe or unix domain socket.

listSerialPorts()

S

Tools.listSerialPorts()

Lists all serial ports on the computer.

Arguments

No arguments

Return Value

std::vector<std::string> Array of serial port names.

TranslateMessage

Represents a message from translator regarding a block translation.

To use this type, add #include <zaber/motion/gcode/translate_message.h> to the top of your source code.

fromBlock

P

translateMessage.getFromBlock()

int The index in the block string that the message regards to.

message

P

translateMessage.getMessage()

std::string The message describing an occurrence.

toBlock

P

translateMessage.getToBlock()

int The end index in the block string that the message regards to. The end index is exclusive.

TranslateResult

Represents a result of a G-code block translation.

To use this type, add #include <zaber/motion/gcode/translate_result.h> to the top of your source code.

commands

P

translateResult.getCommands()

std::vector<std::string> Stream commands resulting from the block.

warnings

P

translateResult.getWarnings()

std::vector<TranslateMessage> Messages informing about unsupported codes and features.

Translator

Represents a live G-Code translator. It allows to stream G-Code blocks to a connected device. It requires a stream to be setup on the device. Requires at least Firmware 7.11.

To use this type, add #include <zaber/motion/gcode/translator.h> to the top of your source code.

coordinateSystem

P

translator.getCoordinateSystem()

std::string Current coordinate system.

translatorId

P

translator.getTranslatorId()

int The ID of the translator that serves to identify native resources.

flush()

M

translator.flush(waitUntilIdle = true)
translator.flush(Translator::FlushOptions options)

Flushes the remaining stream commands waiting in optimization buffer into the underlying stream. The flush is also performed by M2 and M30 codes.

Arguments

Name Type Description
waitUntilIdle const bool Determines whether to wait for the stream to finish all the movements.

Translator::FlushOptions

Name Type Default Description
waitUntilIdle const bool true Determines whether to wait for the stream to finish all the movements.

Return Value

std::vector<std::string> The remaining stream commands.

getAxisCoordinateSystemOffset()

M

translator.getAxisCoordinateSystemOffset(coordinateSystem, axis, unit)

Gets offset of an axis in a given coordinate system.

Arguments

Name Type Description
coordinateSystem const std::string& Coordinate system (e.g. G54).
axis const std::string& Letter of the axis.
unit const Units Units of position.

Return Value

double Offset in translator units of the axis.

getAxisPosition()

M

translator.getAxisPosition(axis, unit)

Gets position of translator's axis. This method does not query device but returns value from translator's state.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
unit const Units Units of position.

Return Value

double Position of translator's axis.

resetAfterStreamError()

M

translator.resetAfterStreamError()

Resets internal state after device rejected generated command. Axis positions become uninitialized.

Arguments

No arguments

resetPosition()

M

translator.resetPosition()

Resets position of the translator from the underlying stream. Call this method after performing a movement outside of translator.

Arguments

No arguments

setAxisHomePosition()

M

translator.setAxisHomePosition(axis, position, unit)

Sets the home position of translator's axis. This position is used by G28.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The home position.
unit const Units Units of position.

setAxisPosition()

M

translator.setAxisPosition(axis, position, unit)

Sets position of translator's axis. Use this method to set position after performing movement outside of the translator. This method does not cause any movement.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The position.
unit const Units Units of position.

setAxisSecondaryHomePosition()

M

translator.setAxisSecondaryHomePosition(axis, position, unit)

Sets the secondary home position of translator's axis. This position is used by G30.

Arguments

Name Type Description
axis const std::string& Letter of the axis.
position const double The home position.
unit const Units Units of position.

setFeedRateOverride()

M

translator.setFeedRateOverride(coefficient)

Allows to scale feed rate of the translated code by a coefficient.

Arguments

Name Type Description
coefficient const double Coefficient of the original feed rate.

setTraverseRate()

M

translator.setTraverseRate(traverseRate, unit)

Sets the speed at which the device moves when traversing (G0).

Arguments

Name Type Description
traverseRate const double The traverse rate.
unit const Units Units of the traverse rate.

setup()

S

Translator.setup(stream, config = TranslatorConfig::getEmpty())

Sets up the translator on top of a provided stream.

Arguments

Name Type Description
stream const Stream& The stream to setup the translator on. The stream must be already setup in a live or a store mode.
config const TranslatorConfig& Configuration of the translator.

Return Value

Translator New instance of translator.

translate()

M

translator.translate(block)

Translates a single block (line) of G-code. The commands are queued in the underlying stream to ensure smooth continues movement. Returning of this method indicates that the commands are queued (not necessarily executed).

Arguments

Name Type Description
block const std::string& Block (line) of G-code.

Return Value

TranslateResult Result of translation containing the commands sent to the device.

TranslatorConfig

Configuration of a translator.

To use this type, add #include <zaber/motion/gcode/translator_config.h> to the top of your source code.

axisMappings

P

translatorConfig.getAxisMappings()

std::vector<AxisMapping> Optional custom mapping of translator axes to stream axes.

axisTransformations

P

translatorConfig.getAxisTransformations()

std::vector<AxisTransformation> Optional transformation of axes.

Transport

Connection transport backend allowing to carry Zaber ASCII protocol over arbitrary protocols. Can only be used with a single connection.

To use this type, add #include <zaber/motion/ascii/transport.h> to the top of your source code.

transportId

P

transport.getTransportId()

int The transport ID identifies this transport instance with the underlying library.

close()

M

transport.close()

Closes the transport. Also closes the connection using the transport.

Arguments

No arguments

closeWithError()

M

transport.closeWithError(errorMessage)

Closes the transport with error. Also closes the connection using the transport propagating the error.

Arguments

Name Type Description
errorMessage const std::string& Error to be propagated.

open()

S

Transport.open()

Creates new instance allowing to read/write messages from/to a single connection.

Arguments

No arguments

Return Value

Transport New instance of transport.

read()

M

transport.read()

Reads a single message generated by the connection. The message is a request for the device. Read should be called continuously in a loop to ensure all generated messages are processed. Subsequent read call confirms that previous message was delivered to the device.

Arguments

No arguments

Return Value

std::string Message generated by the connection.

write()

M

transport.write(message)

Writes a single message to the connection. The message will be processed as a reply from the device.

Arguments

Name Type Description
message const std::string& Single message of Zaber ASCII protocol.

Units

Represents all units available across the library.


Native

Constant Unit
Units::NATIVE Device native units

Length

Constant Unit
Units::LENGTH_METRES Metres
Units::LENGTH_CENTIMETRES Centimetres
Units::LENGTH_MILLIMETRES Millimetres
Units::LENGTH_MICROMETRES Micrometres
Units::LENGTH_NANOMETRES Nanometres
Units::LENGTH_INCHES Inches

Velocity

Constant Unit
Units::VELOCITY_METRES_PER_SECOND Metres per second
Units::VELOCITY_CENTIMETRES_PER_SECOND Centimetres per second
Units::VELOCITY_MILLIMETRES_PER_SECOND Millimetres per second
Units::VELOCITY_MICROMETRES_PER_SECOND Micrometres per second
Units::VELOCITY_NANOMETRES_PER_SECOND Nanometres per second
Units::VELOCITY_INCHES_PER_SECOND Inches per second

Acceleration

Constant Unit
Units::ACCELERATION_METRES_PER_SECOND_SQUARED Metres per second squared
Units::ACCELERATION_CENTIMETRES_PER_SECOND_SQUARED Centimetres per second squared
Units::ACCELERATION_MILLIMETRES_PER_SECOND_SQUARED Millimetres per second squared
Units::ACCELERATION_MICROMETRES_PER_SECOND_SQUARED Micrometres per second squared
Units::ACCELERATION_NANOMETRES_PER_SECOND_SQUARED Nanometres per second squared
Units::ACCELERATION_INCHES_PER_SECOND_SQUARED Inches per second squared

Angle

Constant Unit
Units::ANGLE_DEGREES Degrees
Units::ANGLE_RADIANS Radians

Angular Velocity

Constant Unit
Units::ANGULAR_VELOCITY_DEGREES_PER_SECOND Degrees per second
Units::ANGULAR_VELOCITY_RADIANS_PER_SECOND Radians per second

Angular Acceleration

Constant Unit
Units::ANGULAR_ACCELERATION_DEGREES_PER_SECOND_SQUARED Degrees per second squared
Units::ANGULAR_ACCELERATION_RADIANS_PER_SECOND_SQUARED Radians per second squared

AC Electric Current

Constant Unit
Units::AC_ELECTRIC_CURRENT_AMPERES_PEAK Amperes peak
Units::AC_ELECTRIC_CURRENT_AMPERES_RMS Amperes RMS

Percent

Constant Unit
Units::PERCENT_PERCENT Percent

DC Electric Current

Constant Unit
Units::DC_ELECTRIC_CURRENT_AMPERES Amperes

Force

Constant Unit
Units::FORCE_NEWTONS Newtons
Units::FORCE_MILLINEWTONS Millinewtons
Units::FORCE_POUNDS_FORCE Pounds-force
Units::FORCE_KILONEWTONS Kilonewtons

Time

Constant Unit
Units::TIME_SECONDS Seconds
Units::TIME_MILLISECONDS Milliseconds
Units::TIME_MICROSECONDS Microseconds

Torque

Constant Unit
Units::TORQUE_NEWTON_METRES Newton metres
Units::TORQUE_NEWTON_CENTIMETRES Newton centimetres
Units::TORQUE_POUND_FORCE_FEET Pound-force-feet
Units::TORQUE_OUNCE_FORCE_INCHES Ounce-force-inches

Inertia

Constant Unit
Units::INERTIA_GRAMS Grams
Units::INERTIA_KILOGRAMS Kilograms
Units::INERTIA_MILLIGRAMS Milligrams
Units::INERTIA_POUNDS Pounds
Units::INERTIA_OUNCES Ounces

Rotational Inertia

Constant Unit
Units::ROTATIONAL_INERTIA_GRAM_SQUARE_METRE Gram-square metre
Units::ROTATIONAL_INERTIA_KILOGRAM_SQUARE_METRE Kilogram-square metre
Units::ROTATIONAL_INERTIA_POUND_SQUARE_FEET Pound-square-feet

Force Constant

Constant Unit
Units::FORCE_CONSTANT_NEWTONS_PER_AMP Newtons per amp
Units::FORCE_CONSTANT_MILLINEWTONS_PER_AMP Millinewtons per amp
Units::FORCE_CONSTANT_KILONEWTONS_PER_AMP Kilonewtons per amp
Units::FORCE_CONSTANT_POUNDS_FORCE_PER_AMP Pounds-force per amp

Torque Constant

Constant Unit
Units::TORQUE_CONSTANT_NEWTON_METRES_PER_AMP Newton metres per amp
Units::TORQUE_CONSTANT_MILLINEWTON_METRES_PER_AMP Millinewton metres per amp
Units::TORQUE_CONSTANT_KILONEWTON_METRES_PER_AMP Kilonewton metres per amp
Units::TORQUE_CONSTANT_POUND_FORCE_FEET_PER_AMP Pound-force-feet per amp

Voltage

Constant Unit
Units::VOLTAGE_VOLTS Volts
Units::VOLTAGE_MILLIVOLTS Millivolts
Units::VOLTAGE_MICROVOLTS Microvolts

Current Controller Proportional Gain

Constant Unit
Units::CURRENT_CONTROLLER_PROPORTIONAL_GAIN_VOLTS_PER_AMP Volts per amp
Units::CURRENT_CONTROLLER_PROPORTIONAL_GAIN_MILLIVOLTS_PER_AMP Millivolts per amp
Units::CURRENT_CONTROLLER_PROPORTIONAL_GAIN_MICROVOLTS_PER_AMP Microvolts per amp

Current Controller Integral Gain

Constant Unit
Units::CURRENT_CONTROLLER_INTEGRAL_GAIN_VOLTS_PER_AMP_PER_SECOND Volts per amp per second
Units::CURRENT_CONTROLLER_INTEGRAL_GAIN_MILLIVOLTS_PER_AMP_PER_SECOND Millivolts per amp per second
Units::CURRENT_CONTROLLER_INTEGRAL_GAIN_MICROVOLTS_PER_AMP_PER_SECOND Microvolts per amp per second

Current Controller Derivative Gain

Constant Unit
Units::CURRENT_CONTROLLER_DERIVATIVE_GAIN_VOLTS_SECOND_PER_AMP Volts second per amp
Units::CURRENT_CONTROLLER_DERIVATIVE_GAIN_MILLIVOLTS_SECOND_PER_AMP Millivolts second per amp
Units::CURRENT_CONTROLLER_DERIVATIVE_GAIN_MICROVOLTS_SECOND_PER_AMP Microvolts second per amp

Resistance

Constant Unit
Units::RESISTANCE_KILOOHMS Kiloohms
Units::RESISTANCE_OHMS Ohms
Units::RESISTANCE_MILLIOHMS Milliohms
Units::RESISTANCE_MICROOHMS Microohms
Units::RESISTANCE_NANOOHMS Nanoohms

Inductance

Constant Unit
Units::INDUCTANCE_HENRIES Henries
Units::INDUCTANCE_MILLIHENRIES Millihenries
Units::INDUCTANCE_MICROHENRIES Microhenries
Units::INDUCTANCE_NANOHENRIES Nanohenries

Voltage Constant

Constant Unit
Units::VOLTAGE_CONSTANT_VOLT_SECONDS_PER_RADIAN Volt seconds per radian
Units::VOLTAGE_CONSTANT_MILLIVOLT_SECONDS_PER_RADIAN Millivolt seconds per radian
Units::VOLTAGE_CONSTANT_MICROVOLT_SECONDS_PER_RADIAN Microvolt seconds per radian

UnknownResponseEvent

Reply that could not be matched to a request.

To use this type, add #include <zaber/motion/ascii/unknown_response_event.h> to the top of your source code.

axisNumber

P

unknownResponseEvent.getAxisNumber()

int Number of the axis which the response applies to. Zero denotes device scope.

data

P

unknownResponseEvent.getData()

std::string Response data which varies depending on the request.

deviceAddress

P

unknownResponseEvent.getDeviceAddress()

int Number of the device that sent the message.

messageType

P

unknownResponseEvent.getMessageType()

MessageType Type of the reply received.

replyFlag

P

unknownResponseEvent.getReplyFlag()

std::string The reply flag indicates if the request was accepted (OK) or rejected (RJ).

status

P

unknownResponseEvent.getStatus()

std::string The device status contains BUSY when the axis is moving and IDLE otherwise.

warningFlag

P

unknownResponseEvent.getWarningFlag()

std::string The warning flag contains the highest priority warning currently active for the device or axis.

WarningFlags

Warning flag constants that indicate whether any device fault or warning is active. For more information please refer to the ASCII Protocol Manual.

To use this type, add #include <zaber/motion/ascii/warning_flags.h> to the top of your source code.

Constant Value
WarningFlags::ANALOG_ENCODER_SYNC_ERROR FA
WarningFlags::CONTROLLER_TEMPERATURE_HIGH WT
WarningFlags::CRITICAL_SYSTEM_ERROR FF
WarningFlags::CURRENT_INRUSH_ERROR FC
WarningFlags::DEVICE_NOT_HOMED WH
WarningFlags::DISPLACED_WHEN_STATIONARY WM
WarningFlags::DRIVER_DISABLED FD
WarningFlags::DRIVER_DISABLED_NO_FAULT FO
WarningFlags::ENCODER_ERROR FQ
WarningFlags::EXCESSIVE_TWIST FT
WarningFlags::FIRMWARE_UPDATE_MODE NB
WarningFlags::HARDWARE_EMERGENCY_STOP FH
WarningFlags::INDEX_ERROR FI
WarningFlags::INTERPOLATED_PATH_DEVIATION FP
WarningFlags::INVALID_CALIBRATION_TYPE WP
WarningFlags::JOYSTICK_CALIBRATING NJ
WarningFlags::LIMIT_ERROR FE
WarningFlags::MANUAL_CONTROL NC
WarningFlags::MOTOR_TEMPERATURE_ERROR FM
WarningFlags::MOVEMENT_INTERRUPTED NI
WarningFlags::NO_REFERENCE_POSITION WR
WarningFlags::OVERDRIVE_LIMIT_EXCEEDED FR
WarningFlags::OVERVOLTAGE_OR_UNDERVOLTAGE FV
WarningFlags::PERIPHERAL_INACTIVE FZ
WarningFlags::PERIPHERAL_NOT_SUPPORTED FN
WarningFlags::SETTING_UPDATE_PENDING NU
WarningFlags::STALLED_AND_STOPPED FS
WarningFlags::STALLED_WITH_RECOVERY WS
WarningFlags::STREAM_BOUNDS_ERROR FB
WarningFlags::STREAM_DISCONTINUITY ND
WarningFlags::UNEXPECTED_LIMIT_TRIGGER WL
WarningFlags::VALUE_ROUNDED NR
WarningFlags::VALUE_TRUNCATED NT
WarningFlags::VOLTAGE_OUT_OF_RANGE WV

Warnings

Class used to check and reset warnings and faults on device or axis.

To use this type, add #include <zaber/motion/ascii/warnings.h> to the top of your source code.

clearFlags()

M

warnings.clearFlags()

Clears (acknowledges) current warnings and faults on axis or device and returns them.

Arguments

No arguments

Return Value

std::unordered_set<std::string> Warnings and faults before clearing. Refer to WarningFlags to check a particular flag.

getFlags()

M

warnings.getFlags()

Returns current warnings and faults on axis or device.

Arguments

No arguments

Return Value

std::unordered_set<std::string> Retrieved warnings and faults. Refer to WarningFlags to check a particular flag.