Store

API Documentation: [cpp] [python] [.NET] [LabVIEW]

Every BrainStem module has one or more stores. Stores are the BrainStem equivalent of a filesystem. Stores are broken up into a number of slots, each of which can be thought of as a file. A Store generally represents a specific type of storage. Flash or internal, RAM, or SD if the BrainStem includes an SD slot. The most common usage of slots and stores is for the storage of reflex code that will run on the BrainStem module. Additionally Bulk capture of Analog data can write to a slot within a store. Slots within the internal store can be set up as boot slots by setting the appropriate slot number in the system configuration. See the :doc:` System <system>` entity for more information about setting a boot slot.

The number and type of stores is Model specific. Details about the number of slots per store, and available stores can be found in the data sheets for specific models.

There are a number of commands for manipulating stores, which are detailed below. Many of the store commands are only accessible from host API’s and UI applications, however commands relating to enabling reflex files in slots are accessible from the reflex language.


Every BrainStem module includes several Store entities and onboard memory slots to load Reflex files (for details on Reflex, see Reflex Language Reference). One Reflex file can be stored per slot.

The MTM-USBSTEM has store slots [0-2].

Store Slot

Storage Type

Available Slots

0

RAM

12

1

Internal

1

2

SD

0-255

Get Slot State

For slots which hold reflexes, this read only command returns whether the slot is currently enabled or not. 1 is enabled 0 is disabled. This command can be called from a reflex.

stem.store[index].getSlotState(slot) [cpp] [python] [NET] [LabVIEW]

Load/Unload Slot

This command writes a data buffer into a slot for the given store. It is only available from host side API’s.

stem.store[index].loadSlot(slot, data, _=None) [cpp] [python] [NET] [LabVIEW]

This command reads the slot in the given store into the byte buffer. The length will never be more than the max buffer size given, but may be less if the slot contents were shorter than max buffer length.

stem.store[index].unloadSlot(slot) [cpp] [python] [NET] [LabVIEW]

Enable/Disable Slot

This command enables the reflex file in the given store and slot. This command is accessible from the reflex language.

stem.store[index].slotEnable(slot) [cpp] [python] [NET] [LabVIEW]

This command disables the reflex file in the given store and slot. This command is accessible from the reflex language.

stem.store[index].slotDisable(slot) [cpp] [python] [NET] [LabVIEW]

Slot Capacity

This command gets the maximum capacity of the given slot for the store. This command is accessible from the reflex language.

stem.store[index].slotCapacity(slot) [cpp] [python] [NET] [LabVIEW]

Slot Size

This command gets the current size of the data in the given slot for the store. This can be the size in bytes of the reflex byte code file, or the data size for a bulk capture.

stem.store[index].slotSize(slot) [cpp] [python] [NET] [LabVIEW]