Frame Formats & Registers
Depending on the enabled script, data frames support the following formats. Register numbers currently support 1~64 (content registers).
Simple Format (getString_reg.lua)
$$xxx[Rn]xxx\r\n$$
| Field | Description |
|---|---|
xxx | Transferred data |
[Rn] | Register number identifier, n is the register number |
\r\n | End frame |
Example: hello[1]world\r\n — transfers helloworld data to register 1
JSON Format
Single Register (getString_json.lua)
$${regNum=n,content="xxx"}\r\n$$
| Field | Description |
|---|---|
regNum | Register number (1~64) |
content | Transferred data; non-numeric values need quotes, i.e., content="xxx" |
\r\n | End frame |
Example: {regNum=1,content="hello"}\r\n
Multiple Registers (getString_multi_json.lua) — Recommended
$${regNum=n,content="xxx"}{regNum=n,content="xxx"}...\r\n$$
{} marks one complete data segment; multiple registers can be written in a single frame.
Example: {regNum=1,content="100"}{regNum=2,content="A002"}\r\n
Special Character Compatible Format (getOpMsg.lua)
When the transferred data contains special characters such as {} " ^ %, the JSON format will treat them as syntax identifiers. In this case, use this format with | as the register separator.
$$01content1!@#$%^|11content2|12content3\r\n$$
| Field | Description |
|---|---|
01 | Register number (10109) |
content1!@#$%^ | Transferred data containing special characters |
| | Register separator |
\r\n | End frame |
If
|itself needs to be transferred as content, the separator will be updated to another identifier — refer to the script version documentation.