AxisStorageclass Module: zaber_motion.ascii
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:
from zaber_motion.ascii import Connection
connection = Connection.open_serial_port('COM3' )
device = connection.get_device(1 )
axis = device.get_axis(1 )
axis_storage = axis.storageCopy Methods m erase_key() async available axis_storage.erase_key(key)
Erases the axis value stored at the provided key.
Arguments Name Type Description key strKey to erase.
Return Value bool A boolean indicating if the key existed.
m get_bool() async available axis_storage.get_bool(key)
Gets the value at the provided key interpreted as a boolean.
Arguments Name Type Description key strKey to get the value at.
Return Value bool Stored value.
m get_number() async available axis_storage.get_number(key)
Gets the value at the provided key interpreted as a number.
Arguments Name Type Description key strKey to get the value at.
Return Value float Stored value.
m get_string() async available axis_storage.get_string(key, decode = False)
Gets the axis value stored with the provided key.
Arguments Name Type Description key strKey to read the value of. decode boolWhether the stored value should be decoded. Only use this when reading values set by storage.set with "encode" true.
Return Value str Stored value.
m key_exists() async available axis_storage.key_exists(key)
Determines whether a given key exists in axis storage.
Arguments Name Type Description key strKey which existence to determine.
Return Value bool True indicating that the key exists, false otherwise.
m list_keys() async available axis_storage.list_keys(prefix = None)
Lists the axis storage keys matching a given prefix. Omit the prefix to list all the keys.
Arguments Name Type Description prefix Optional[str]Optional key prefix.
Return Value List[str] Storage keys matching the given prefix.
m set_bool() async available axis_storage.set_bool(key, value)
Sets the value at the provided key to the provided boolean.
Arguments Name Type Description key strKey to set the value at. value boolValue to set.
m set_number() async available axis_storage.set_number(key, value)
Sets the value at the provided key to the provided number.
Arguments Name Type Description key strKey to set the value at. value floatValue to set.
m set_string() async available axis_storage.set_string(key, value, encode = False)
Sets the axis value stored at the provided key.
Arguments Name Type Description key strKey to set the value at. value strValue to set. encode boolWhether 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.