Skip to content

JavaScript

AlertEvent

Alert message received from the device.

To use this type, add const { ascii: { AlertEvent } } = require('@zaber/motion'); to the top of your source code.

axisNumber

P

alertEvent.axisNumber

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

data

P

alertEvent.data

string Response data which varies depending on the request.

deviceAddress

P

alertEvent.deviceAddress

number Number of the device that sent the message.

status

P

alertEvent.status

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

warningFlag

P

alertEvent.warningFlag

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 const { ascii: { AllAxes } } = require('@zaber/motion'); to the top of your source code.

device

P

allAxes.device

Device Device that controls this axis.

home()

Async M

await allAxes.home(waitUntilIdle = true)

Homes all axes. Axes return to their homing positions.

Arguments

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

isBusy()

Async M

await allAxes.isBusy()

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

Arguments

No arguments

Return Value

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

park()

Async M

await 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()

Async M

await allAxes.stop(waitUntilIdle = true)

Stops ongoing axes movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle boolean 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

string A string that represents the axes.

unpark()

Async M

await allAxes.unpark()

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

Arguments

No arguments

waitUntilIdle()

Async M

await allAxes.waitUntilIdle(throwErrorOnFault = true)

Waits until all axes of device stop moving.

Arguments

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

Axis

Represents an axis of motion associated with a device.

To use this type, add const { ascii: { Axis } } = require('@zaber/motion'); to the top of your source code.

axisNumber

P

axis.axisNumber

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

axisType

P

axis.axisType

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

device

P

axis.device

Device Device that controls this axis.

identity

P

axis.identity

AxisIdentity Identity of the axis.

isPeripheral

P

axis.isPeripheral

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

peripheralId

P

axis.peripheralId

number Unique ID of the peripheral hardware.

peripheralName

P

axis.peripheralName

string Name of the peripheral.

settings

P

axis.settings

AxisSettings Settings and properties of this axis.

warnings

P

axis.warnings

Warnings Warnings and faults of this axis.

genericCommand()

Async M

await axis.genericCommand(command, checkErrors = true, timeout = 0)

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

Arguments

Name Type Description
command string Command and its parameters.
checkErrors boolean Controls whether to throw an exception when the device rejects the command.
timeout number 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()

Async M

await axis.genericCommandMultiResponse(command, checkErrors = true, timeout = 0)

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 string Command and its parameters.
checkErrors boolean Controls whether to throw an exception when a device rejects the command.
timeout number The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

Response[] All responses to the command.

genericCommandNoResponse()

Async M

await 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 string Command and its parameters.

getPosition()

Async M

await axis.getPosition(unit = Units.NATIVE)

Returns current axis position.

Arguments

Name Type Description
unit Length | Angle | Native Units of position.

Return Value

number Axis position.

home()

Async M

await axis.home(waitUntilIdle = true)

Homes axis. Axis returns to its homing position.

Arguments

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

isBusy()

Async M

await axis.isBusy()

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

Arguments

No arguments

Return Value

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

isParked()

Async M

await axis.isParked()

Returns bool indicating whether the axis is parked or not.

Arguments

No arguments

Return Value

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

moveAbsolute()

Async M

await axis.moveAbsolute(position, unit = Units.NATIVE, waitUntilIdle = true)

Move axis to absolute position.

Arguments

Name Type Description
position number Absolute position.
unit Length | Angle | Native Units of position.
waitUntilIdle boolean Determines whether function should return after the movement is finished or just started.

moveMax()

Async M

await axis.moveMax(waitUntilIdle = true)

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

Arguments

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

moveMin()

Async M

await axis.moveMin(waitUntilIdle = true)

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

Arguments

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

moveRelative()

Async M

await axis.moveRelative(position, unit = Units.NATIVE, waitUntilIdle = true)

Move axis to position relative to current position.

Arguments

Name Type Description
position number Relative position.
unit Length | Angle | Native Units of position.
waitUntilIdle boolean Determines whether function should return after the movement is finished or just started.

moveVelocity()

Async M

await axis.moveVelocity(velocity, unit = Units.NATIVE)

Begins to move axis at specified speed.

Arguments

Name Type Description
velocity number Movement velocity.
unit Velocity | AngularVelocity | Native Units of velocity.

park()

Async M

await 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 string Template of a command to prepare. Parameters are denoted by question marks.
...parameters Measurement[] Variable number of command parameters.

Return Value

string Command with converted parameters.

stop()

Async M

await axis.stop(waitUntilIdle = true)

Stops ongoing axis movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle boolean 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

string A string that represents the axis.

unpark()

Async M

await axis.unpark()

Unparks axis. Axis will now be able to move.

Arguments

No arguments

waitUntilIdle()

Async M

await axis.waitUntilIdle(throwErrorOnFault = true)

Waits until axis stops moving.

Arguments

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

AxisIdentity

Representation of data gathered during axis identification.

To use this type, add const { ascii: { AxisIdentity } } = require('@zaber/motion'); to the top of your source code.

axisType

P

axisIdentity.axisType

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

isPeripheral

P

axisIdentity.isPeripheral

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

peripheralId

P

axisIdentity.peripheralId

number Unique ID of the peripheral hardware.

peripheralName

P

axisIdentity.peripheralName

string Name of the peripheral.

AxisSettings

Class providing access to various axis settings and properties.

To use this type, add const { ascii: { AxisSettings } } = require('@zaber/motion'); to the top of your source code.

convertFromNativeUnits()

M

axisSettings.convertFromNativeUnits(setting, value, unit)

Convert arbitrary setting value from Zaber native units.

Arguments

Name Type Description
setting string Name of the setting.
value number Value of the setting in Zaber native units.
unit Units Units to convert value to.

Return Value

number Setting value.

convertToNativeUnits()

M

axisSettings.convertToNativeUnits(setting, value, unit)

Convert arbitrary setting value to Zaber native units.

Arguments

Name Type Description
setting string Name of the setting.
value number Value of the setting in units specified by following argument.
unit Units Units of the value.

Return Value

number Setting value.

get()

Async M

await 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 string Name of the setting.
unit Units Units of setting.

Return Value

number Setting value.

set()

Async M

await 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 string Name of the setting.
value number Value of the setting.
unit Units Units of setting.

AxisType

Denotes type of an axis and units it accepts.

To use this type, add const { ascii: { AxisType } } = require('@zaber/motion'); to the top of your source code.

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

BinaryCommandFailedExceptionData

Contains additional data for BinaryCommandFailedException.

To use this type, add const { BinaryCommandFailedExceptionData } = require('@zaber/motion'); to the top of your source code.

responseData

P

binaryCommandFailedExceptionData.responseData

number The response data.

CommandFailedExceptionData

Contains additional data for CommandFailedException.

To use this type, add const { CommandFailedExceptionData } = require('@zaber/motion'); to the top of your source code.

replyFlag

P

commandFailedExceptionData.replyFlag

string The flags on the reply sent by the device.

responseData

P

commandFailedExceptionData.responseData

string The response data.

status

P

commandFailedExceptionData.status

string The current device status.

warningFlag

P

commandFailedExceptionData.warningFlag

string The current warning flag on the device.

Connection

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

To use this type, add const { ascii: { Connection } } = require('@zaber/motion'); to the top of your source code.

checksumEnabled

P

connection.checksumEnabled

boolean Controls whether outgoing messages contain checksum.

defaultRequestTimeout

P

connection.defaultRequestTimeout

number 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

connection.interfaceId

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

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

Async M

await connection.close()

Close the connection.

Arguments

No arguments

detectDevices()

Async M

await connection.detectDevices(identifyDevices = true)

Attempts to detect any devices present on this connection.

Arguments

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

Return Value

Device[] Array of detected devices.

genericCommand()

Async M

await connection.genericCommand(command, device = 0, axis = 0, checkErrors = true, timeout = 0)

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

Arguments

Name Type Description
command string Command and its parameters.
device number Optional device address to send the command to.
axis number Optional axis number to send the command to.
checkErrors boolean Controls whether to throw an exception when the device rejects the command.
timeout number 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()

Async M

await connection.genericCommandMultiResponse(command, device = 0, axis = 0, checkErrors = true, timeout = 0)

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 string Command and its parameters.
device number Optional device address to send the command to.
axis number Optional axis number to send the command to.
checkErrors boolean Controls whether to throw an exception when a device rejects the command.
timeout number The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

Response[] All responses to the command.

genericCommandNoResponse()

Async M

await connection.genericCommandNoResponse(command, device = 0, axis = 0)

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 string Command and its parameters.
device number Optional device address to send the command to.
axis number Optional axis number to send the command to.

getDevice()

M

connection.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 number Address of device intended to control. Address is configured for each device.

Return Value

Device Device instance.

homeAll()

Async M

await connection.homeAll(waitUntilIdle = true)

Homes all of the devices on this connection.

Arguments

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

Return Value

number[] The addresses of the devices that were homed by this command.

openCustom()

Async S

await Connection.openCustom(transport)

Opens a connection using a custom transport.

Arguments

Name Type Description
transport Transport The custom connection transport.

Return Value

Connection An object representing the connection.

openSerialPort()

Async S

await Connection.openSerialPort(portName, baudRate = Connection.DEFAULT_BAUD_RATE)

Opens a serial port.

Arguments

Name Type Description
portName string Name of the port to open.
baudRate number Optional baud rate (defaults to 115200).

Return Value

Connection An object representing the port.

openTcp()

Async S

await Connection.openTcp(hostName, port)

Opens a TCP connection.

Arguments

Name Type Description
hostName string Hostname or IP address.
port number Port number.

Return Value

Connection An object representing the connection.

renumberDevices()

Async M

await connection.renumberDevices(firstAddress = 1)

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

Arguments

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

Return Value

number Total number of devices that responded to the renumber.

stopAll()

Async M

await connection.stopAll(waitUntilIdle = true)

Stops all of the devices on this connection.

Arguments

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

Return Value

number[] The addresses of the devices that were stopped by this command.

toString()

M

connection.toString()

Returns a string that represents the connection.

Arguments

No arguments

Return Value

string A string that represents the connection.

Device

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

To use this type, add const { ascii: { Device } } = require('@zaber/motion'); to the top of your source code.

allAxes

P

device.allAxes

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

axisCount

P

device.axisCount

number Number of axes this device has.

connection

P

device.connection

Connection Connection of this device.

deviceAddress

P

device.deviceAddress

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

deviceId

P

device.deviceId

number Unique ID of the device hardware.

firmwareVersion

P

device.firmwareVersion

FirmwareVersion Version of the firmware.

identity

P

device.identity

DeviceIdentity Identity of the device.

io

P

device.io

DeviceIO I/O channels of this device.

isIdentified

P

device.isIdentified

boolean Indicates whether or not the device has been identified.

name

P

device.name

string Name of the product.

serialNumber

P

device.serialNumber

number Serial number of the device.

settings

P

device.settings

DeviceSettings Settings and properties of this device.

warnings

P

device.warnings

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

genericCommand()

Async M

await device.genericCommand(command, axis = 0, checkErrors = true, timeout = 0)

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

Arguments

Name Type Description
command string Command and its parameters.
axis number Optional axis number to send the command to.
checkErrors boolean Controls whether to throw an exception when the device rejects the command.
timeout number 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()

Async M

await device.genericCommandMultiResponse(command, axis = 0, checkErrors = true, timeout = 0)

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 string Command and its parameters.
axis number Optional axis number to send the command to.
checkErrors boolean Controls whether to throw an exception when a device rejects the command.
timeout number The timeout, in milliseconds, for a device to respond to the command. Overrides the connection default request timeout.

Return Value

Response[] All responses to the command.

genericCommandNoResponse()

Async M

await device.genericCommandNoResponse(command, axis = 0)

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 string Command and its parameters.
axis number Optional axis number to send the command to.

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 number 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.

Arguments

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

Return Value

Lockstep Lockstep instance.

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 number 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 number The ID of the stream buffer to control. Stream buffer IDs start at one.

Return Value

StreamBuffer StreamBuffer instance.

identify()

Async M

await 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 string Template of a command to prepare. Parameters are denoted by question marks.
...parameters Measurement[] Variable number of command parameters.

Return Value

string Command with converted parameters.

toString()

M

device.toString()

Returns a string that represents the device.

Arguments

No arguments

Return Value

string A string that represents the device.

DeviceAddressConflictExceptionData

Contains additional data for DeviceAddressConflictException.

To use this type, add const { DeviceAddressConflictExceptionData } = require('@zaber/motion'); to the top of your source code.

deviceAddresses

P

deviceAddressConflictExceptionData.deviceAddresses

number[] The full list of detected device addresses.

DeviceDbSourceType

Type of source of Device DB data.

To use this type, add const { DeviceDbSourceType } = require('@zaber/motion'); to the top of your source code.

Member Numeric value
DeviceDbSourceType.WEB_SERVICE 0
DeviceDbSourceType.FILE 1

DeviceIdentity

Representation of data gathered during device identification.

To use this type, add const { ascii: { DeviceIdentity } } = require('@zaber/motion'); to the top of your source code.

axisCount

P

deviceIdentity.axisCount

number Number of axes this device has.

deviceId

P

deviceIdentity.deviceId

number Unique ID of the device hardware.

firmwareVersion

P

deviceIdentity.firmwareVersion

FirmwareVersion Version of the firmware.

name

P

deviceIdentity.name

string Name of the product.

serialNumber

P

deviceIdentity.serialNumber

number Serial number of the device.

DeviceIO

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

To use this type, add const { ascii: { DeviceIO } } = require('@zaber/motion'); to the top of your source code.

getAllAnalogInputs()

Async M

await deviceIO.getAllAnalogInputs()

Returns the current values of all analog input channels.

Arguments

No arguments

Return Value

number[] Measurements of the voltage present on the input channels.

getAllAnalogOutputs()

Async M

await deviceIO.getAllAnalogOutputs()

Returns the current values of all analog output channels.

Arguments

No arguments

Return Value

number[] Measurements of voltage that the output channels are conducting.

getAllDigitalInputs()

Async M

await deviceIO.getAllDigitalInputs()

Returns the current values of all digital input channels.

Arguments

No arguments

Return Value

boolean[] True if voltage is present on the input channel and false otherwise.

getAllDigitalOutputs()

Async M

await deviceIO.getAllDigitalOutputs()

Returns the current values of all digital output channels.

Arguments

No arguments

Return Value

boolean[] True if the output channel is conducting and false otherwise.

getAnalogInput()

Async M

await deviceIO.getAnalogInput(channelNumber)

Returns the current value of the specified analog input channel.

Arguments

Name Type Description
channelNumber number Channel number starting at 1.

Return Value

number A measurementsof the voltage present on the input channel.

getAnalogOutput()

Async M

await deviceIO.getAnalogOutput(channelNumber)

Returns the current values of the specified analog output channel.

Arguments

Name Type Description
channelNumber number Channel number starting at 1.

Return Value

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

getChannelsInfo()

Async M

await 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()

Async M

await deviceIO.getDigitalInput(channelNumber)

Returns the current value of the specified digital input channel.

Arguments

Name Type Description
channelNumber number Channel number starting at 1.

Return Value

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

getDigitalOutput()

Async M

await deviceIO.getDigitalOutput(channelNumber)

Returns the current value of the specified digital output channel.

Arguments

Name Type Description
channelNumber number Channel number starting at 1.

Return Value

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

setAllAnalogOutputs()

Async M

await deviceIO.setAllAnalogOutputs(values)

Sets values for all analog output channels.

Arguments

Name Type Description
values number[] Voltage values to set the output channels to.

setAllDigitalOutputs()

Async M

await deviceIO.setAllDigitalOutputs(values)

Sets values for all digital output channels.

Arguments

Name Type Description
values boolean[] True to set the output channel to conducting and false to turn it off.

setAnalogOutput()

Async M

await deviceIO.setAnalogOutput(channelNumber, value)

Sets value for the specified analog output channel.

Arguments

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

setDigitalOutput()

Async M

await deviceIO.setDigitalOutput(channelNumber, value)

Sets value for the specified digital output channel.

Arguments

Name Type Description
channelNumber number Channel number starting at 1.
value boolean 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 const { ascii: { DeviceIOInfo } } = require('@zaber/motion'); to the top of your source code.

numberAnalogInputs

P

deviceIOInfo.numberAnalogInputs

number Number of analog input channels.

numberAnalogOutputs

P

deviceIOInfo.numberAnalogOutputs

number Number of analog output channels.

numberDigitalInputs

P

deviceIOInfo.numberDigitalInputs

number Number of digital input channels.

numberDigitalOutputs

P

deviceIOInfo.numberDigitalOutputs

number Number of digital output channels.

DeviceSettings

Class providing access to various device settings and properties.

To use this type, add const { ascii: { DeviceSettings } } = require('@zaber/motion'); to the top of your source code.

convertFromNativeUnits()

M

deviceSettings.convertFromNativeUnits(setting, value, unit)

Convert arbitrary setting value from Zaber native units.

Arguments

Name Type Description
setting string Name of the setting.
value number Value of the setting in Zaber native units.
unit Units Units to convert value to.

Return Value

number Setting value.

convertToNativeUnits()

M

deviceSettings.convertToNativeUnits(setting, value, unit)

Convert arbitrary setting value to Zaber native units.

Arguments

Name Type Description
setting string Name of the setting.
value number Value of the setting in units specified by following argument.
unit Units Units of the value.

Return Value

number Setting value.

get()

Async M

await 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 string Name of the setting.
unit Units Units of setting.

Return Value

number Setting value.

set()

Async M

await 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 string Name of the setting.
value number Value of the setting.
unit Units Units of setting.

FirmwareVersion

Class representing version of firmware in the controller.

To use this type, add const { FirmwareVersion } = require('@zaber/motion'); to the top of your source code.

build

P

firmwareVersion.build

number Build version number.

major

P

firmwareVersion.major

number Major version number.

minor

P

firmwareVersion.minor

number Minor version number.

InvalidPacketExceptionData

Contains additional data for the InvalidPacketException.

To use this type, add const { InvalidPacketExceptionData } = require('@zaber/motion'); to the top of your source code.

packet

P

invalidPacketExceptionData.packet

string The invalid packet that caused the exception.

reason

P

invalidPacketExceptionData.reason

string The reason for the exception.

InvalidResponseExceptionData

Contains additional data for InvalidResponseException.

To use this type, add const { InvalidResponseExceptionData } = require('@zaber/motion'); to the top of your source code.

response

P

invalidResponseExceptionData.response

string The response data.

Library

Access class to general library information and configuration.

To use this type, add const { Library } = require('@zaber/motion'); 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 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 DeviceDbSourceType Source type.
urlOrFilePath 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 LogOutputMode Logging output mode.
filePath 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.

To use this type, add const { ascii: { Lockstep } } = require('@zaber/motion'); to the top of your source code.

device

P

lockstep.device

Device Device that controls this lockstep group.

lockstepGroupId

P

lockstep.lockstepGroupId

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

disable()

Async M

await lockstep.disable()

Disable the lockstep group.

Arguments

No arguments

enable()

Async M

await lockstep.enable(...axes)

Activate the lockstep group on the axes specified.

Arguments

Name Type Description
...axes number[] The numbers of axes in the lockstep group.

getAxes()

Async M

Obsolete: Use GetAxisNumbers instead.

await 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()

Async M

await lockstep.getAxisNumbers()

Gets the axis numbers of the lockstep group.

Arguments

No arguments

Return Value

number[] Axis numbers in order specified when enabling lockstep.

getOffsets()

Async M

await lockstep.getOffsets(unit = Units.NATIVE)

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

Arguments

Name Type Description
unit Length | Angle | Native Units of position.

Return Value

number[] Initial offset for each axis of the lockstep group.

getTwists()

Async M

await lockstep.getTwists(unit = Units.NATIVE)

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

Arguments

Name Type Description
unit Length | Angle | Native Units of position.

Return Value

number[] Difference between the initial offset and the actual offset for each axis of the lockstep group.

home()

Async M

await lockstep.home(waitUntilIdle = true)

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

Arguments

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

isBusy()

Async M

await lockstep.isBusy()

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

Arguments

No arguments

Return Value

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

isEnabled()

Async M

await lockstep.isEnabled()

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

Arguments

No arguments

Return Value

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

moveAbsolute()

Async M

await lockstep.moveAbsolute(position, unit = Units.NATIVE, waitUntilIdle = true)

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 number Absolute position.
unit Length | Angle | Native Units of position.
waitUntilIdle boolean Determines whether function should return after the movement is finished or just started.

moveMax()

Async M

await lockstep.moveMax(waitUntilIdle = true)

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 boolean Determines whether function should return after the movement is finished or just started.

moveMin()

Async M

await lockstep.moveMin(waitUntilIdle = true)

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 boolean Determines whether function should return after the movement is finished or just started.

moveRelative()

Async M

await lockstep.moveRelative(position, unit = Units.NATIVE, waitUntilIdle = true)

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 number Relative position.
unit Length | Angle | Native Units of position.
waitUntilIdle boolean Determines whether function should return after the movement is finished or just started.

moveVelocity()

Async M

await lockstep.moveVelocity(velocity, unit = Units.NATIVE)

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 number Movement velocity.
unit Velocity | AngularVelocity | Native Units of velocity.

stop()

Async M

await lockstep.stop(waitUntilIdle = true)

Stops ongoing lockstep group movement. Decelerates until zero speed.

Arguments

Name Type Description
waitUntilIdle boolean 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

string String which represents the enabled lockstep group.

waitUntilIdle()

Async M

await lockstep.waitUntilIdle(throwErrorOnFault = true)

Waits until the lockstep group stops moving.

Arguments

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

LockstepAxes

The axis numbers of a lockstep group.

To use this type, add const { ascii: { LockstepAxes } } = require('@zaber/motion'); to the top of your source code.

axis1

P

lockstepAxes.axis1

number The axis number used to set the first axis.

axis2

P

lockstepAxes.axis2

number The axis number used to set the second axis.

axis3

P

lockstepAxes.axis3

number The axis number used to set the third axis.

axis4

P

lockstepAxes.axis4

number The axis number used to set the fourth axis.

LogOutputMode

Mode of logging output of the library.

To use this type, add const { LogOutputMode } = require('@zaber/motion'); 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 const { Measurement } = require('@zaber/motion'); to the top of your source code.

unit

P

measurement.unit

Units Optional units of the measurement.

value

P

measurement.value

number Value of the measurement.

MessageType

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

To use this type, add const { ascii: { MessageType } } = require('@zaber/motion'); 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 const { MotionLibException } = require('@zaber/motion'); to the top of your source code.

details

P

motionLibException.details

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.message

string Error message of the exception.

toString()

M

motionLibException.toString()

Returns a string that represents the exception.

Arguments

No arguments

Return Value

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.
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.
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.
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.
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.
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.
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 const { MovementFailedExceptionData } = require('@zaber/motion'); to the top of your source code.

reason

P

movementFailedExceptionData.reason

string The reason for the Exception.

warnings

P

movementFailedExceptionData.warnings

string[] The full list of warnings.

MovementInterruptedExceptionData

Contains additional data for MovementInterruptedException.

To use this type, add const { MovementInterruptedExceptionData } = require('@zaber/motion'); to the top of your source code.

reason

P

movementInterruptedExceptionData.reason

string The reason for the Exception.

warnings

P

movementInterruptedExceptionData.warnings

string[] The full list of warnings.

Response

Response message from the device.

To use this type, add const { ascii: { Response } } = require('@zaber/motion'); to the top of your source code.

axisNumber

P

response.axisNumber

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

data

P

response.data

string Response data which varies depending on the request.

deviceAddress

P

response.deviceAddress

number Number of the device that sent the message.

messageType

P

response.messageType

MessageType Type of the reply received.

replyFlag

P

response.replyFlag

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

status

P

response.status

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

warningFlag

P

response.warningFlag

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 const { RotationDirection } = require('@zaber/motion'); to the top of your source code.

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

SettingConstants

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

To use this type, add const { ascii: { SettingConstants } } = require('@zaber/motion'); 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_SETTLE_PERIOD cloop.settle.period
SettingConstants.CLOOP_SETTLE_TOLERANCE cloop.settle.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_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.DEVICEID deviceid
SettingConstants.DRIVER_CURRENT_HOLD driver.current.hold
SettingConstants.DRIVER_CURRENT_MAX driver.current.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_TEMPERATURE driver.temperature
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_POS encoder.pos
SettingConstants.ENCODER_POS_ERROR encoder.pos.error
SettingConstants.FILTER_HOLDERID filter.holderid
SettingConstants.FORCE_AVERAGE force.average
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_POS limit.away.pos
SettingConstants.LIMIT_AWAY_POSUPDATE limit.away.posupdate
SettingConstants.LIMIT_AWAY_PRESET limit.away.preset
SettingConstants.LIMIT_AWAY_STATE limit.away.state
SettingConstants.LIMIT_AWAY_TRIGGERED limit.away.triggered
SettingConstants.LIMIT_AWAY_TYPE limit.away.type
SettingConstants.LIMIT_C_ACTION limit.c.action
SettingConstants.LIMIT_C_EDGE limit.c.edge
SettingConstants.LIMIT_C_POS limit.c.pos
SettingConstants.LIMIT_C_POSUPDATE limit.c.posupdate
SettingConstants.LIMIT_C_PRESET limit.c.preset
SettingConstants.LIMIT_C_STATE limit.c.state
SettingConstants.LIMIT_C_TRIGGERED limit.c.triggered
SettingConstants.LIMIT_C_TYPE limit.c.type
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_EDGE limit.home.edge
SettingConstants.LIMIT_HOME_POS limit.home.pos
SettingConstants.LIMIT_HOME_POSUPDATE limit.home.posupdate
SettingConstants.LIMIT_HOME_PRESET limit.home.preset
SettingConstants.LIMIT_HOME_STATE limit.home.state
SettingConstants.LIMIT_HOME_TRIGGERED limit.home.triggered
SettingConstants.LIMIT_HOME_TYPE limit.home.type
SettingConstants.LIMIT_MAX limit.max
SettingConstants.LIMIT_MIN limit.min
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_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_MAX motor.current.max
SettingConstants.PARKING_STATE parking.state
SettingConstants.PERIPHERAL_ID peripheral.id
SettingConstants.PERIPHERAL_ID_PENDING peripheral.id.pending
SettingConstants.PERIPHERAL_SERIAL peripheral.serial
SettingConstants.PERIPHERAL_SERIAL_PENDING peripheral.serial.pending
SettingConstants.PERIPHERALID peripheralid
SettingConstants.POS pos
SettingConstants.RESOLUTION resolution
SettingConstants.SCOPE_DELAY scope.delay
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_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.VEL vel
SettingConstants.VERSION version
SettingConstants.VERSION_BUILD version.build
SettingConstants.VIRTUAL_NUMVIRTUAL virtual.numvirtual

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 const { ascii: { Stream } } = require('@zaber/motion'); to the top of your source code.

axes

P

stream.axes

StreamAxisDefinition[] An array of axes definitions the stream is set up to control.

device

P

stream.device

Device Device that controls this stream.

mode

P

stream.mode

StreamMode Current mode of the stream.

streamId

P

stream.streamId

number The number that identifies the stream on the device.

arcAbsolute()

Async M

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

arcAbsoluteOn()

Async M

await 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.

Arguments

Name Type Description
targetAxesIndices number[] 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 RotationDirection The direction of the rotation.
centerX Measurement The first dimensions of the position of the center of the circle on which the arc exists.
centerY Measurement The second dimensions of the position of the center of the circle on which the arc exists.
endX Measurement The first dimensions of the end position of the arc.
endY Measurement The second dimensions of the end position of the arc.

arcRelative()

Async M

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

arcRelativeOn()

Async M

await 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.

Arguments

Name Type Description
targetAxesIndices number[] 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 RotationDirection The direction of the rotation.
centerX Measurement The first dimensions of the position of the center of the circle on which the arc exists.
centerY Measurement The second dimensions of the position of the center of the circle on which the arc exists.
endX Measurement The first dimensions of the end position of the arc.
endY Measurement The second dimensions of the end position of the arc.

call()

Async M

await stream.call(streamBuffer)

Append the actions in a stream buffer to the queue.

Arguments

Name Type Description
streamBuffer StreamBuffer The stream buffer to call.

circleAbsolute()

Async M

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

circleAbsoluteOn()

Async M

await 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.

Arguments

Name Type Description
targetAxesIndices number[] 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 RotationDirection The direction of the rotation.
centerX Measurement The first dimension of the position of the center of the circle.
centerY Measurement The second dimension of the position of the center of the circle.

circleRelative()

Async M

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

circleRelativeOn()

Async M

await 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.

Arguments

Name Type Description
targetAxesIndices number[] 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 RotationDirection The direction of the rotation.
centerX Measurement The first dimension of the position of the center of the circle.
centerY Measurement The second dimension of the position of the center of the circle.

cork()

Async M

await 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()

Async M

await 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

getMaxCentripetalAcceleration()

Async M

await 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 Acceleration | Native Units of acceleration.

Return Value

number The maximum centripetal acceleration of the live stream.

getMaxSpeed()

Async M

await 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 Velocity | AngularVelocity | Native Units of velocity.

Return Value

number The maximum speed of the stream.

getMaxTangentialAcceleration()

Async M

await 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 Acceleration | Native Units of acceleration.

Return Value

number The maximum tangential acceleration of the live stream.

isBusy()

Async M

await stream.isBusy()

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

Arguments

No arguments

Return Value

boolean True if the stream is executing a queued action.

lineAbsolute()

Async M

await 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()

Async M

await stream.lineAbsoluteOn(targetAxesIndices, endpoint)

Queue an absolute line movement in the stream, targeting a subset of the stream axes.

Arguments

Name Type Description
targetAxesIndices number[] 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 Measurement[] Positions for the axes to move to, relative to their home positions.

lineRelative()

Async M

await 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()

Async M

await stream.lineRelativeOn(targetAxesIndices, endpoint)

Queue a relative line movement in the stream, targeting a subset of the stream axes.

Arguments

Name Type Description
targetAxesIndices number[] 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 Measurement[] Positions for the axes to move to, relative to their positions before movement.

setAnalogOutput()

Async M

await stream.setAnalogOutput(channelNumber, value)

Set the value of an analog output channel.

Arguments

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

setDigitalOutput()

Async M

await stream.setDigitalOutput(channelNumber, value)

Set the value of a digital output channel.

Arguments

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

setMaxCentripetalAcceleration()

Async M

await 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 number Maximum centripetal acceleration at which any stream action is executed.
unit Acceleration | Native Units of acceleration.

setMaxSpeed()

Async M

await 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 number Maximum speed at which any stream action is executed.
unit Velocity | AngularVelocity | Native Units of velocity.

setMaxTangentialAcceleration()

Async M

await 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 number Maximum tangential acceleration at which any stream action is executed.
unit Acceleration | Native Units of acceleration.

setupLive()

Async M

await stream.setupLive(...axes)

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

Arguments

Name Type Description
...axes number[] Numbers of physical axes to setup the stream on.

setupLiveComposite()

Async M

await 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()

Async M

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

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

Arguments

Name Type Description
streamBuffer StreamBuffer The stream buffer to queue actions in.
...axes number[] Numbers of physical axes to setup the stream on.

setupStoreArbitraryAxes()

Async M

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

setupStoreComposite()

Async M

await 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 StreamBuffer The stream buffer to queue actions in.
...axes StreamAxisDefinition[] Definition of the stream axes.

toggleDigitalOutput()

Async M

await stream.toggleDigitalOutput(channelNumber)

Toggle the value of a digital output channel.

Arguments

Name Type Description
channelNumber number 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

string String which represents the stream.

uncork()

Async M

await 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()

Async M

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

Wait a specified time.

Arguments

Name Type Description
time number Amount of time to wait.
unit Time | Native Units of time.

waitAnalogInput()

Async M

await 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 number The number of the analog input channel. Channel numbers are numbered from one.
condition string A condition (e.g. <, <=, ==, !=).
value number The value that the condition concerns, in volts.

waitDigitalInput()

Async M

await stream.waitDigitalInput(channelNumber, value)

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

Arguments

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

waitUntilIdle()

Async M

await stream.waitUntilIdle(throwErrorOnFault = true)

Waits until the live stream executes all queued actions.

Arguments

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

StreamAxisDefinition

Defines an axis of the stream.

To use this type, add const { ascii: { StreamAxisDefinition } } = require('@zaber/motion'); to the top of your source code.

axisNumber

P

streamAxisDefinition.axisNumber

number Number of a physical axis or a lockstep group.

axisType

P

streamAxisDefinition.axisType

StreamAxisType Defines the type of the axis.

StreamAxisType

Denotes type of the stream axis.

To use this type, add const { ascii: { StreamAxisType } } = require('@zaber/motion'); 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 const { ascii: { StreamBuffer } } = require('@zaber/motion'); to the top of your source code.

bufferId

P

streamBuffer.bufferId

number The number identifying the buffer on the device.

device

P

streamBuffer.device

Device The Device this buffer exists on.

erase()

Async M

await streamBuffer.erase()

Erase the contents of the buffer.

Arguments

No arguments

getContent()

Async M

await streamBuffer.getContent()

Get the buffer contents as an array of strings.

Arguments

No arguments

Return Value

string[] A string array containing all the stream commands stored in the buffer.

StreamExecutionExceptionData

Contains additional data for StreamExecutionException.

To use this type, add const { StreamExecutionExceptionData } = require('@zaber/motion'); to the top of your source code.

errorFlag

P

streamExecutionExceptionData.errorFlag

string The error flag that caused the exception.

reason

P

streamExecutionExceptionData.reason

string The reason for the exception.

StreamMode

Mode of a stream.

To use this type, add const { ascii: { StreamMode } } = require('@zaber/motion'); 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 const { StreamMovementFailedExceptionData } = require('@zaber/motion'); to the top of your source code.

reason

P

streamMovementFailedExceptionData.reason

string The reason for the Exception.

warnings

P

streamMovementFailedExceptionData.warnings

string[] The full list of warnings.

StreamMovementInterruptedExceptionData

Contains additional data for StreamMovementInterruptedException.

To use this type, add const { StreamMovementInterruptedExceptionData } = require('@zaber/motion'); to the top of your source code.

reason

P

streamMovementInterruptedExceptionData.reason

string The reason for the Exception.

warnings

P

streamMovementInterruptedExceptionData.warnings

string[] The full list of warnings.

Tools

Class providing various utility functions.

To use this type, add const { Tools } = require('@zaber/motion'); to the top of your source code.

listSerialPorts()

Async S

await Tools.listSerialPorts()

Lists all serial ports on the computer.

Arguments

No arguments

Return Value

string[] Array of serial port names.

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 const { ascii: { Transport } } = require('@zaber/motion'); to the top of your source code.

transportId

P

transport.transportId

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

close()

Async M

await transport.close()

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

Arguments

No arguments

closeWithError()

Async M

await transport.closeWithError(errorMessage)

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

Arguments

Name Type Description
errorMessage 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()

Async M

await 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

string Message generated by the connection.

write()

Async M

await 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 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
Length.METRES Metres
Length.m Metres
Length.CENTIMETRES Centimetres
Length.cm Centimetres
Length.MILLIMETRES Millimetres
Length.mm Millimetres
Length.MICROMETRES Micrometres
Length['µm'] Micrometres
Length.NANOMETRES Nanometres
Length.nm Nanometres
Length.INCHES Inches
Length.in Inches

Velocity

Constant Unit
Velocity.METRES_PER_SECOND Metres per second
Velocity['m/s'] Metres per second
Velocity.CENTIMETRES_PER_SECOND Centimetres per second
Velocity['cm/s'] Centimetres per second
Velocity.MILLIMETRES_PER_SECOND Millimetres per second
Velocity['mm/s'] Millimetres per second
Velocity.MICROMETRES_PER_SECOND Micrometres per second
Velocity['µm/s'] Micrometres per second
Velocity.NANOMETRES_PER_SECOND Nanometres per second
Velocity['nm/s'] Nanometres per second
Velocity.INCHES_PER_SECOND Inches per second
Velocity['in/s'] Inches per second

Acceleration

Constant Unit
Acceleration.METRES_PER_SECOND_SQUARED Metres per second squared
Acceleration['m/s²'] Metres per second squared
Acceleration.CENTIMETRES_PER_SECOND_SQUARED Centimetres per second squared
Acceleration['cm/s²'] Centimetres per second squared
Acceleration.MILLIMETRES_PER_SECOND_SQUARED Millimetres per second squared
Acceleration['mm/s²'] Millimetres per second squared
Acceleration.MICROMETRES_PER_SECOND_SQUARED Micrometres per second squared
Acceleration['µm/s²'] Micrometres per second squared
Acceleration.NANOMETRES_PER_SECOND_SQUARED Nanometres per second squared
Acceleration['nm/s²'] Nanometres per second squared
Acceleration.INCHES_PER_SECOND_SQUARED Inches per second squared
Acceleration['in/s²'] Inches per second squared

Angle

Constant Unit
Angle.DEGREES Degrees
Angle['°'] Degrees
Angle.RADIANS Radians
Angle.rad Radians

Angular Velocity

Constant Unit
AngularVelocity.DEGREES_PER_SECOND Degrees per second
AngularVelocity['°/s'] Degrees per second
AngularVelocity.RADIANS_PER_SECOND Radians per second
AngularVelocity['rad/s'] Radians per second

Angular Acceleration

Constant Unit
AngularAcceleration.DEGREES_PER_SECOND_SQUARED Degrees per second squared
AngularAcceleration['°/s²'] Degrees per second squared
AngularAcceleration.RADIANS_PER_SECOND_SQUARED Radians per second squared
AngularAcceleration['rad/s²'] Radians per second squared

AC Electric Current

Constant Unit
ACElectricCurrent.AMPERES_PEAK Amperes peak
ACElectricCurrent['A(peak)'] Amperes peak
ACElectricCurrent.AMPERES_RMS Amperes RMS
ACElectricCurrent['A(RMS)'] Amperes RMS

Percent

Constant Unit
Percent.PERCENT Percent
Percent['%'] Percent

DC Electric Current

Constant Unit
DCElectricCurrent.AMPERES Amperes
DCElectricCurrent.A Amperes

Force

Constant Unit
Force.NEWTONS Newtons
Force.N Newtons
Force.MILLINEWTONS Millinewtons
Force.mN Millinewtons
Force.POUNDS_FORCE Pounds-force
Force.lbf Pounds-force
Force.KILONEWTONS Kilonewtons
Force.kN Kilonewtons

Time

Constant Unit
Time.SECONDS Seconds
Time.s Seconds
Time.MILLISECONDS Milliseconds
Time.ms Milliseconds
Time.MICROSECONDS Microseconds
Time['µs'] Microseconds

Torque

Constant Unit
Torque.NEWTON_METRES Newton metres
Torque['N⋅m'] Newton metres
Torque.NEWTON_CENTIMETRES Newton centimetres
Torque['N⋅cm'] Newton centimetres
Torque.POUND_FORCE_FEET Pound-force-feet
Torque['lbf⋅ft'] Pound-force-feet
Torque.OUNCE_FORCE_INCHES Ounce-force-inches
Torque['ozf⋅in'] Ounce-force-inches

Inertia

Constant Unit
Inertia.GRAMS Grams
Inertia.g Grams
Inertia.KILOGRAMS Kilograms
Inertia.kg Kilograms
Inertia.MILLIGRAMS Milligrams
Inertia.mg Milligrams
Inertia.POUNDS Pounds
Inertia.lb Pounds
Inertia.OUNCES Ounces
Inertia.oz Ounces

Rotational Inertia

Constant Unit
RotationalInertia.GRAM_SQUARE_METRE Gram-square metre
RotationalInertia['g⋅m²'] Gram-square metre
RotationalInertia.KILOGRAM_SQUARE_METRE Kilogram-square metre
RotationalInertia['kg⋅m²'] Kilogram-square metre
RotationalInertia.POUND_SQUARE_FEET Pound-square-feet
RotationalInertia['lb⋅ft²'] Pound-square-feet

Force Constant

Constant Unit
ForceConstant.NEWTONS_PER_AMP Newtons per amp
ForceConstant['N/A'] Newtons per amp
ForceConstant.MILLINEWTONS_PER_AMP Millinewtons per amp
ForceConstant['mN/A'] Millinewtons per amp
ForceConstant.KILONEWTONS_PER_AMP Kilonewtons per amp
ForceConstant['kN/A'] Kilonewtons per amp
ForceConstant.POUNDS_FORCE_PER_AMP Pounds-force per amp
ForceConstant['lbf/A'] Pounds-force per amp

Torque Constant

Constant Unit
TorqueConstant.NEWTON_METRES_PER_AMP Newton metres per amp
TorqueConstant['N⋅m/A'] Newton metres per amp
TorqueConstant.MILLINEWTON_METRES_PER_AMP Millinewton metres per amp
TorqueConstant['mN⋅m/A'] Millinewton metres per amp
TorqueConstant.KILONEWTON_METRES_PER_AMP Kilonewton metres per amp
TorqueConstant['kN⋅m/A'] Kilonewton metres per amp
TorqueConstant.POUND_FORCE_FEET_PER_AMP Pound-force-feet per amp
TorqueConstant['lbf⋅ft/A'] Pound-force-feet per amp

UnknownResponseEvent

Reply that could not be matched to a request.

To use this type, add const { ascii: { UnknownResponseEvent } } = require('@zaber/motion'); to the top of your source code.

axisNumber

P

unknownResponseEvent.axisNumber

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

data

P

unknownResponseEvent.data

string Response data which varies depending on the request.

deviceAddress

P

unknownResponseEvent.deviceAddress

number Number of the device that sent the message.

messageType

P

unknownResponseEvent.messageType

MessageType Type of the reply received.

replyFlag

P

unknownResponseEvent.replyFlag

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

status

P

unknownResponseEvent.status

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

warningFlag

P

unknownResponseEvent.warningFlag

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 const { ascii: { WarningFlags } } = require('@zaber/motion'); 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.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.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 const { ascii: { Warnings } } = require('@zaber/motion'); to the top of your source code.

clearFlags()

Async M

await warnings.clearFlags()

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

Arguments

No arguments

Return Value

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

getFlags()

Async M

await warnings.getFlags()

Returns current warnings and faults on axis or device.

Arguments

No arguments

Return Value

Set<string> Retrieved warnings and faults. Refer to WarningFlags to check a particular flag.