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.settingsRelated Guides:
Index
Methods
m
m
try axisSettings.convertFromNativeUnits(setting, value, unit)Convert arbitrary setting value from Zaber native units.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| value | Double | Value of the setting in Zaber native units. |
| unit | Units | Units to convert value to. |
Return Value
Double Setting value.m
try axisSettings.convertToNativeUnits(setting, value, unit, round = false)Convert arbitrary setting value to Zaber native units.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| value | Double | Value of the setting in units specified by following argument. |
| unit | Units | Units of the value. |
| round | Bool | If true, round the result to the device's native decimal places. |
Return Value
Double Setting value.m
try 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
Double Setting value.m
try await axisSettings.getBool(setting)Returns any axis setting or property as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
Return Value
Bool Setting value.m
try axisSettings.getDefault(setting, unit = Units.native)Returns the default value of a setting.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| unit | Units | Units of setting. |
Return Value
Double Default setting value.m
m
m
m
try await axisSettings.getInt(setting)Returns any axis setting or property as an integer. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
Return Value
Int64 Setting value.m
try await axisSettings.getMany(...axisSettings)Gets many setting values in as few requests as possible.
Arguments
| Name | Type | Description |
|---|---|---|
| ...axisSettings | [GetAxisSetting] | The settings to read. |
Return Value
[GetAxisSettingResult] The setting values read.m
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
| Name | Type | Description |
|---|---|---|
| ...axisSettings | [GetAxisSetting] | The settings to read. |
Return Value
[GetAxisSettingTypedResult] The setting values read.m
try await 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 | String | Name of the setting. |
Return Value
String Setting value.m
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
| Name | Type | Description |
|---|---|---|
| ...axisSettings | [GetAxisSetting] | The settings to read. |
Return Value
[GetAxisSettingResult] The setting values read.m
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
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| unit | Units | Units of setting to convert result to. |
Return Value
TypedSetting Setting value.m
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
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
Return Value
UnitConversionDescriptor The unit conversion descriptor for the setting.m
try 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 | Double | Value of the setting. |
| unit | Units | Units of setting. |
m
try await axisSettings.setBool(setting, value)Sets any axis setting as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| value | Bool | Value of the setting. |
m
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
| Name | Type | Description |
|---|---|---|
| setting | String | Name of the setting. |
| value | Int64 | Value of the setting. |
m
try await 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 | String | Name of the setting. |
| value | String | Value of the setting. |