CSM-MassData-Parameter-Support is an add-on for the Communicable State Machine (CSM) framework that enables efficient transfer of large datasets between CSM modules. Instead of encoding large data directly into the API string, it uses a reference mechanism to pass data by reference, overcoming the limitations of API strings for large data transfer.
In LabVIEW test and measurement applications, handling large data types such as waveforms and 1D/2D arrays is common, especially in high-sampling-rate and multi-channel systems. Transferring such data using traditional API string encoding is inefficient due to:
- Extra memory overhead from plaintext encoding
- Performance cost of encoding/decoding large data
- Excessive log noise that degrades debug readability
MassData Support is based on the following principle:
- Encode: Convert large data into a compact reference string ("address") instead of encoding the data inline
- Transmit: Send the reference string through CSM's invisible bus
- Decode: The receiving CSM module uses the reference string to retrieve the original data
The reference string contains three fields — flag, start position, and size — which together act as a locator for the actual data stored in a shared memory buffer.
- Efficient Transmission: Only a compact reference string is transferred, avoiding full data copies
- Memory Efficient: Large data is stored once regardless of the number of receivers
- Cleaner Logs: Compact reference strings keep CSM log output concise and readable
- MassData uses a circular buffer internally
- When the buffer is full, new data overwrites old data from the beginning
- Overwritten data cannot be recovered; decoding will fail
- All CSM modules in the same application share the same MassData buffer
- Avoid Long-Lived Data: Do not use MassData for data that must persist indefinitely
- Set an Appropriate Cache Size: Use
Config MassData Parameter Cache Size.vito configure the buffer size- Too large wastes memory
- Too small causes frequent overwrites
- Monitor Cache Usage: Use the provided debugging tools to observe cache usage and tune the configuration
Install via VIPM (VI Package Manager). After installation, find it in the CSM add-ons palette.
- Use encoding VIs to convert large data into MassData arguments
- Pass these arguments between CSM modules via CSM's parameter passing mechanism
- Use decoding VIs at the receiving end to retrieve the original data
See the example folder for demonstrations of:
- MassData argument format
- Displaying MassData cache status on the front panel
- Using MassData in non-CSM frameworks
- Using MassData with CSM
LabVIEW 2017 or later
This project is licensed under the MIT License — see the LICENSE file for details.