API Reference v9.2.0
DeviceSettingsclass
Module: zaber_motion.ascii
Class providing access to various device settings and properties.
The following example illustrates how you can obtain an instance of this type:
from zaber_motion.ascii import Connection
connection = Connection.open_serial_port('COM3')
device = connection.get_device(1)
device_settings = device.settingsRelated Guides:
Index
mMethods
Methods
m
m
device_settings.convert_from_native_units(setting, value, unit)Convert arbitrary setting value from Zaber native units.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | float | Value of the setting in Zaber native units. |
| unit | UnitsAndLiterals | Units to convert value to. |
Return Value
float Setting value.m
device_settings.convert_to_native_units(setting, value, unit, round = False)Convert arbitrary setting value to Zaber native units.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | float | Value of the setting in units specified by following argument. |
| unit | UnitsAndLiterals | Units of the value. |
| round | bool | If true, round the result to the device's native decimal places. |
Return Value
float Setting value.m
device_settings.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 | str | Name of the setting. |
| unit | UnitsAndLiterals | Units of setting. |
Return Value
float Setting value.m
device_settings.get_bool(setting)Returns any device setting or property as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
Return Value
bool Setting value.m
device_settings.get_default(setting, unit = Units.NATIVE)Returns the default value of a setting.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| unit | UnitsAndLiterals | Units of setting. |
Return Value
float Default setting value.m
m
m
m
device_settings.get_from_all_axes(setting)Gets the value of an axis scope setting for each axis on the device. Values may be NaN where the setting is not applicable.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
Return Value
List[float] The setting values on each axis.m
device_settings.get_int(setting)Returns any device setting or property as an integer. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
Return Value
int Setting value.m
device_settings.get_many(*settings)Gets many setting values in as few device requests as possible.
Arguments
| Name | Type | Description |
|---|---|---|
| *settings | GetSetting | The settings to read. |
Return Value
List[GetSettingResult] The setting values read.m
device_settings.get_many_typed(*settings)Returns many device 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 |
|---|---|---|
| *settings | GetSetting | The settings to read. |
Return Value
List[GetSettingTypedResult] The setting values read.m
device_settings.get_string(setting)Returns any device setting or property as a string. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
Return Value
str Setting value.m
device_settings.get_synchronized(*settings)Gets many setting values in the same tick, ensuring their values are synchronized.
Requires at least Firmware 7.35.
Arguments
| Name | Type | Description |
|---|---|---|
| *settings | GetSetting | The settings to read. |
Return Value
List[GetSettingResult] The setting values read.m
device_settings.get_typed(setting, unit = Units.NATIVE)Returns any device 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 | str | Name of the setting. |
| unit | UnitsAndLiterals | Units of setting to convert result to. |
Return Value
TypedSetting Setting value.m
device_settings.get_unit_conversion_descriptor(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 | str | Name of the setting. |
Return Value
UnitConversionDescriptor The unit conversion descriptor for the setting.m
device_settings.set(setting, value, unit = Units.NATIVE)Sets any device setting. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | float | Value of the setting. |
| unit | UnitsAndLiterals | Units of setting. |
m
device_settings.set_bool(setting, value)Sets any device setting as a boolean. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | bool | Value of the setting. |
m
device_settings.set_int(setting, value)Sets any device setting or property as an integer. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | int | Value of the setting. |
m
device_settings.set_string(setting, value)Sets any device setting as a string. For more information refer to the ASCII Protocol Manual.
Arguments
| Name | Type | Description |
|---|---|---|
| setting | str | Name of the setting. |
| value | str | Value of the setting. |