# Communicable State Machine(CSM)
[English](./README.md) | [中文](./README(CN).md)
[![Image](https://www.vipm.io/package/nevstop_lib_communicable_state_machine/badge.svg?metric=installs)](https://www.vipm.io/package/nevstop_lib_communicable_state_machine/)
[![Image](https://www.vipm.io/package/nevstop_lib_communicable_state_machine/badge.svg?metric=stars)](https://www.vipm.io/package/nevstop_lib_communicable_state_machine/)
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
[![GitHub all releases](https://img.shields.io/github/downloads/NEVSTOP-LAB/Communicable-State-Machine/total)](https://github.com/NEVSTOP-LAB/Communicable-State-Machine/releases)
Communicable State Machine(CSM) is a LabVIEW application framework that builds upon JKI State Machine(JKISM). It follows the pattern of JKISM and extends the keywords to describe message communication between modules, including concepts such as Sync-Message, Async-Message, Subscription/Unsubscription of status - essential elements for creating reusable code modules. For more information, please visit the CSM wiki: <https://nevstop-lab.github.io/CSM-Wiki/>
- For instructions on JKI State Machine(JKISM), visit: <http://jki.net/state-machine/>
- For information on NEVSTOP-LAB, visit: <https://github.com/NEVSTOP-LAB>
![image](https://github.com/NEVSTOP-LAB/Communicable-State-Machine/assets/8196752/318b9363-083c-40e2-86ef-0106e567b2b3)
_**CSM API**_
![image](.doc/_img/CSM%20Palette.png)
Template Description:
[English](src/help/NEVSTOP/Communicable%20State%20Machine(CSM)/Template%20Description(EN).md) | [中文](src/help/NEVSTOP/Communicable%20State%20Machine(CSM)/Template%20Description(CN).md)
API Description:
[English](src/help/NEVSTOP/Communicable%20State%20Machine(CSM)/VI%20Description(EN).md) | [中文](src/help/NEVSTOP/Communicable%20State%20Machine(CSM)/VI%20Description(CN).md)
## Create Reuseable Modules
Creating a reusable module typically does not require message interaction with other modules; it only needs to provide an external interface and publish the state of the module. Therefore, as long as these two aspects are clearly described, one can call the reusable module without understanding its internal implementation details.
In CSM modules, all cases can be considered as messages for invocation, but it is recommended to use API category as external interfaces. When sending status updates, notify external entities of changes by sending either Status or Interrupt Status.
Go to _**/Example/1. Create a reusable module**_ to learn how to create a CSM module.
## Use CSM as application framework Scenario
In this scenario, inter-module communication solely relies on message string queue operations. You can generate a Message string using the "**Build Message with Arguments++.vi**" function. Alternatively, if you are familiar with the rules, you can directly utilize message description strings.
``` c
#CSM State Syntax
// Local Message Example
DoSth: DoA >> Arguments
// Sync Call Example
API: xxxx >> Arguments -@ TargetModule
// Async Call Example
API: xxxx >> Arguments -> TargetModule
// Async Call without Reply Example
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>
Status@Source Module >> Handler Module -><unregister> // API Name could not be specified.
#CSM Commenting
To add a comment use "//" and all text to the right will be ignored
UI: Initialize // This initializes the UI
// Another comment line
```
Go to _**/Example/2. Caller is CSM Scenario**_ to find an example for this scenario.
## Reuse CSM Module in another Application Framework
In this scenario, inter-module communication solely relies on Post/Send Message API and module status change user event.
Go to _**/Example/3. Caller is Other Framework Scenario**_ to find an example for this scenario.
## CSM Arguments Support
JKISM only supports the STRING TYPE as a parameter, but there is a wide variety of data that needs to be transmitted. Therefore, support for parameters is crucial. The table below lists some of the current ways in which different data types are supported, with some being built-in within CSM and others requiring additional installation through addons.
| Arguments | Type | Description |
|---|---|---|
| Safe String | Build-in | "->\| -> -@ & <- , ; []{}`" wil be replaced with %[HEXCODE] |
| HexStr | Build-in | Data will be converted as variant and changed to Hex String as parameter |
|[MassData](https://github.com/NEVSTOP-LAB/CSM-MassData-Parameter-Support) |Addons|Data will be converted to memory and saved in a circle buffer. Pass the StartPos with length as parameter. |
|[API String Arguments](https://github.com/NEVSTOP-LAB/CSM-API-String-Arugments-Support) |Addons|Support plain string as CSM API parameter|
|[INI Static Variable Support](https://github.com/NEVSTOP-LAB/CSM-INI-Static-Variable-Support)|Addons|offering ${variable} support for CSM|
LeonDL168
- 粉丝: 3003
- 资源: 785
最新资源
- 西门子s7 200smart与3台英威腾GD变频器通讯实战程序 原创可直接用于生产的程序,程序带注释,并附送触摸屏程序,有接线方式和设置,通讯地址说明等 程序采用轮询,可以后续根据要求适当修
- 标签打印C#控制程序源代码,适合自己进行二次开发 软件可以自己编辑标签,可以自动条形码或二维码的位置
- 松下FP-XHC60T 标准可带18轴中型程序,总共逻辑1万多步,含昆仑通态触摸屏程序(触摸屏附带配方功能,以及产能统计:), 项目功能完整主站与两个从站采用PLC链接通讯,该程序为标准框架,故障,复
- WPF智慧工厂数据平台 1, 提供一个智慧工厂数据平台框架 2,理解wpf的设计模式 3,学习如何绘制各种统计图 4,设计页面板块划分 5,如何在适当时候展现动画 有盆友问,这个是否带数据库
- yolo目标检测数据-抽烟、打电话、打哈欠数据集5665张含yolo标签文件(可用于疲劳检测、司机行为检测).zip
- FLAC3D锚杆辅助生成软件根据CAD图自动打锚杆 使用感受 在CAD画出锚杆,启动软件会生成锚杆命令流,call入flac中即可或者复制到自己命令流中,十分便捷 由于开发成软件,永久使用
- 施耐德ATV71原厂纸质原理图纸 施耐德ATV71变频器原理图纸,可以用来研究变频器电路的结构组成、控制原理,为搞清楚变频电路的控制原理、信号的来龙去脉提供科学依据,更能够做为变频器
- 信捷XC PLC与3台施耐德ATV12变频器通讯程序 信捷XC PLC与3台施耐德ATV12变频器通讯,可靠稳定,同时解决施耐德ATV12变频器断电重启后,自准备工作,无需人为准备 器件:信捷XC3
- 电动自行车方案,资料齐全 成熟电动自行车代码方案,学习好资料 中颖中颖电动自行车代码方案,包含代码,原理图,pcb,说明文档 不论是学习电动车代码还是学习电流环,速度环,Pid调节,都是很好
- 三菱PLC FX5U 伺服机器人程序 包括三菱FX5U程序,威纶通触摸屏程序,IO表,材料清单,eplan和PDF电气图 4轴伺服程序,1个机器人,FX5U结构化编程
- 电机启动模型 Matlab simulink 可用于模拟电压暂降等电能质量问题,适配于本家的IEEE 33节点模型
- python入门-外星人小游戏
- 高压大功率电动汽车360V方案 电动汽车高压电机控制器360v乘用车平台,某知名电控厂家主推 产品,软件源代码,软件FOC矢量控制算法,boot源码,全部开源,强大的上位机调试工具带实时波形显示,原理
- matlab 多智能体系统编队控制仿真,非线性,一致性,领导跟随控制,有限时间控制等
- 蛋白质功能预测中的深度学习方法:结合序列与互作网络的深层分类模型(DeepGO)
- 三菱纯水设备程序纯水设备程序 使用三菱A系列 PLC和三菱A985GOT触摸屏,也可以额外有偿转移指其他触摸屏,比如昆仑通态和威纶通还有信捷等等
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈