Lua Scripts
The communication format is determined by built-in Lua scripts on the mainboard. The corresponding script must be loaded and enabled on the development board before use.
Script List
| Script | Data Format | Use Case |
|---|---|---|
checkConnectivity.lua | Any string | Connectivity test; data goes to register 1 (test only) |
getString_reg.lua | Simple format | Simple data exchange; register number identified by frame |
getString_json.lua | Single JSON | Single register write, standardized format |
getString_multi_json.lua | Multiple JSON | Recommended — write multiple registers in one frame, supports remote commands |
getOpMsg.lua | Special character format | When data contains {} " ^ % etc. |
Script Selection Guide
| Requirement | Recommended Script |
|---|---|
| Connectivity test only | checkConnectivity.lua |
| Simple data transfer | getString_reg.lua or getString_json.lua |
| Multiple registers / remote control | getString_multi_json.lua (recommended) |
| Data with special characters | getOpMsg.lua |
Data Flow
$$Host/Scale/PLC ──(Serial/Network)──> Lua script parses
│
Writes to register
│
Canvas object updates$$
Note:
checkConnectivity.luais for connectivity testing only — it does not support signal switching.