API Reference v9.2.0
AxisStorageclass
Module: ZaberMotionAscii
Class providing access to axis storage.
Requires at least Firmware 7.30.
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 axisStorage = axis.storageIndex
Methods
m
m
m
m
try await axisStorage.getString(key, decode = false)Gets the axis value stored with the provided key.
Arguments
| Name | Type | Description |
|---|---|---|
| key | String | Key to read the value of. |
| decode | Bool | Whether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true. |
Return Value
String Stored value.m
m
m
m
m
try await axisStorage.setString(key, value, encode = false)Sets the axis value stored at the provided key.
Arguments
| Name | Type | Description |
|---|---|---|
| key | String | Key to set the value at. |
| value | String | Value to set. |
| encode | Bool | Whether the stored value should be base64 encoded before being stored. This makes the string unreadable to humans using the ASCII protocol, however, values stored this way can be of any length and use non-ASCII and protocol reserved characters. |