Communicable State Machine (CSM) is a LabVIEW application framework built on JKI State Machine (JKISM). It extends JKISM with keywords for inter-module communication, including Sync-Message, Async-Message, and Status Subscription/Unsubscription—essential features for building reusable code modules. For more information, visit the CSM Wiki: https://nevstop-lab.github.io/CSM-Wiki/
- Learn more about JKI State Machine (JKISM): http://jki.net/state-machine/
- Learn more about NEVSTOP-LAB: https://github.com/NEVSTOP-LAB
CSM API Palette
Template Description:
English | 中文
A reusable module typically doesn't need to communicate with other modules—it only needs to provide an external interface and publish status changes. As long as these two aspects are clearly defined, the module can be called without understanding its internal implementation.
In CSM modules, all cases can be invoked as messages, but it's recommended to use API categories as the external interface. To send status updates, use Status or Interrupt Status to notify external entities of changes.
See /Example/1. Create a reusable module to learn how to create a CSM module.
In this scenario, inter-module communication relies on message string queue operations. You can generate message strings using the Build Message with Arguments++.vi function, or write them directly if you're familiar with the syntax.
#CSM State Syntax
// Local Message
DoSth: DoA >> Arguments
// Sync Call
API: xxxx >> Arguments -@ TargetModule
// Async Call
API: xxxx >> Arguments -> TargetModule
// Async Call without Reply
API: xxxx >> Arguments ->| TargetModule
// Broadcast Normal Status
Status >> StatusArguments -><status>
// Broadcast Interrupt Status
Interrupt >> StatusArguments -><interrupt>
// Register Source Module's Status to Handler Module
Status@Source Module >> API@Handler Module -><register>
// Unregister Source Module's Status
Status@Source Module >> API@Handler Module -><unregister>
#CSM Comments
// Use "//" to add comments - all text to the right will be ignored
UI: Initialize // This initializes the UI
// Another comment lineFor more syntax information, visit: Syntax.md
See /Example/2. Caller is CSM Scenario for an example.
In this scenario, inter-module communication relies on Post/Send Message APIs and module status change user events.
See /Example/3. Caller is Other Framework Scenario for an example.
JKISM only supports STRING parameters, but applications need to transmit various data types. The table below lists current parameter support options—some built-in, others requiring addon installation.
| Parameter | Type | Description |
|---|---|---|
| SafeStr | Built-in | Special characters ("->| -> -@ & <- , ; []{}`") are replaced with %[HEXCODE] |
| HexStr | Built-in | Data is converted to variant and encoded as hex string |
| MassData | Addon | Data is stored in a circular buffer; StartPos with length is passed as parameter |
| API String Arguments | Addon | Supports plain string as CSM API parameter |
| INI Static Variable | Addon | Provides ${variable} support for CSM |

