API Reference v9.2.0

AxisSettingsclass

Module: ZaberMotionAscii

Class providing access to various axis settings and properties.

The following example illustrates how you can obtain an instance of this type:

import ZaberMotionAscii

let connection = try await Connection.openSerialPort(portName: "COM3")
let device = try connection.getDevice(deviceAddress: 1)
let axis = try device.getAxis(axisNumber: 1)
let axisSettings = axis.settings

Methods

m

canConvertNativeUnits()

throws
try axisSettings.canConvertNativeUnits(setting)
Indicates if given setting can be converted from and to native units.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
Bool True if unit conversion can be performed.
m

convertFromNativeUnits()

throws
try axisSettings.convertFromNativeUnits(setting, value, unit)
Convert arbitrary setting value from Zaber native units.
Arguments
NameTypeDescription
settingStringName of the setting.
valueDoubleValue of the setting in Zaber native units.
unitUnitsUnits to convert value to.
Return Value
Double Setting value.
m

convertToNativeUnits()

throws
try axisSettings.convertToNativeUnits(setting, value, unit, round = false)
Convert arbitrary setting value to Zaber native units.
Arguments
NameTypeDescription
settingStringName of the setting.
valueDoubleValue of the setting in units specified by following argument.
unitUnitsUnits of the value.
roundBoolIf true, round the result to the device's native decimal places.
Return Value
Double Setting value.
m

get()

asyncthrows
try await axisSettings.get(setting, unit = Units.native)
Returns any axis setting or property. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
unitUnitsUnits of setting.
Return Value
Double Setting value.
m

getBool()

asyncthrows
try await axisSettings.getBool(setting)
Returns any axis setting or property as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
Bool Setting value.
m

getDefault()

throws
try axisSettings.getDefault(setting, unit = Units.native)
Returns the default value of a setting.
Arguments
NameTypeDescription
settingStringName of the setting.
unitUnitsUnits of setting.
Return Value
Double Default setting value.
m

getDefaultBool()

throws
try axisSettings.getDefaultBool(setting)
Returns the default value of a setting as a boolean.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
Bool Default setting value.
m

getDefaultInt()

throws
try axisSettings.getDefaultInt(setting)
Returns the default value of a setting as an integer.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
Int64 Default setting value.
m

getDefaultString()

throws
try axisSettings.getDefaultString(setting)
Returns the default value of a setting as a string.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
String Default setting value.
m

getInt()

asyncthrows
try await axisSettings.getInt(setting)
Returns any axis setting or property as an integer. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
Int64 Setting value.
m

getMany()

asyncthrows
try await axisSettings.getMany(...axisSettings)
Gets many setting values in as few requests as possible.
Arguments
NameTypeDescription
...axisSettings[GetAxisSetting]The settings to read.
Return Value
[GetAxisSettingResult] The setting values read.
m

getManyTyped()

asyncthrows
try await axisSettings.getManyTyped(...axisSettings)
Returns many axis settings or properties in their native types in as few requests as possible. Note that specifying units will always return floating point values, even for settings that are natively integers. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
...axisSettings[GetAxisSetting]The settings to read.
Return Value
[GetAxisSettingTypedResult] The setting values read.
m

getString()

asyncthrows
try await axisSettings.getString(setting)
Returns any axis setting or property as a string. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
String Setting value.
m

getSynchronized()

asyncthrows
try await axisSettings.getSynchronized(...axisSettings)
Gets many setting values in the same tick, ensuring their values are synchronized. Requires at least Firmware 7.35.
Arguments
NameTypeDescription
...axisSettings[GetAxisSetting]The settings to read.
Return Value
[GetAxisSettingResult] The setting values read.
m

getTyped()

asyncthrows
try await axisSettings.getTyped(setting, unit = Units.native)
Returns any axis setting or property in its native type. Note that specifying units will cause settings that are otherwise integers to be returned as floats. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
unitUnitsUnits of setting to convert result to.
Return Value
TypedSetting Setting value.
m

getUnitConversionDescriptor()

throws
try axisSettings.getUnitConversionDescriptor(setting)
Retrieves unit conversion descriptor for a setting, allowing unit conversion without a device. The descriptor can be used with the ConvertTo/FromNativeUnits methods of the UnitTable class.
Arguments
NameTypeDescription
settingStringName of the setting.
Return Value
UnitConversionDescriptor The unit conversion descriptor for the setting.
m

set()

asyncthrows
try await axisSettings.set(setting, value, unit = Units.native)
Sets any axis setting. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
valueDoubleValue of the setting.
unitUnitsUnits of setting.
m

setBool()

asyncthrows
try await axisSettings.setBool(setting, value)
Sets any axis setting as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
valueBoolValue of the setting.
m

setInt()

asyncthrows
try await axisSettings.setInt(setting, value)
Sets any axis setting or property as an integer. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
valueInt64Value of the setting.
m

setString()

asyncthrows
try await axisSettings.setString(setting, value)
Sets any axis setting as a string. For more information refer to the ASCII Protocol Manual.
Arguments
NameTypeDescription
settingStringName of the setting.
valueStringValue of the setting.