Script command reference
Every field, screen and result here was checked on the v1.3.3 (Windows) Release build.
This reference covers every script command, one page each. Each page covers, in order: what the command is for, its screen, the JSON form with a field table, how its result is decided, a sample you can download, and things to watch out for.
If you are new to the basics of scripts (cases, rounds, PASS/FAIL, variables), read the Script tutorial and Script concepts first.
How to use the examples
- Each example is a complete script file. Download it (
.json) from the box at the end of its page. - Open one Roach Modbus Tool window, switch to Slave mode and click Listen (default
127.0.0.1:502, Slave ID 1). The examples write whatever data they need, so there is nothing to set up in the registers. - Open a second window, switch to Script, click Open JSON to open the example, and click Run.
- Case names and messages in the examples are in English, and that is the text you see on screen.
Each example uses its own address block (for example, Read starts at 0x0100 and While uses 0x0500), so they do not interfere with each other and can run one after another against the same Slave.
Contents
| Group | Commands |
|---|---|
| Read and write | Write · Read · Wait Until |
| Flow | If / Else / End If · Repeat · While · End Case · End Round · Verdict |
| Subroutines | Subroutine · Call · Return |
| Variables | Set |
| Timing and interaction | Wait · Log · Pause · Ask |
| Other | Common fields · Unsupported syntax · Script file top-level fields |
Conventions
- Each step is a JSON object keyed by the command name, for example
{"write": {...}}or{"log": "..."}. - Addresses and values can be decimal (
256) or a hex string ("0x0100"). - Fields marked "expression allowed" accept expressions such as
"0x0400 + ${i}". The rules are in Concepts › 7. Expressions. - Variable names start with a letter or
_, followed by letters, digits or_, up to 31 characters.nowis a built-in variable and cannot be set.
Next steps
- Script examples: combining these commands into complete tests
- Troubleshooting
