Script tutorial: your first script
This chapter starts from an empty script and builds your first automated test on screen, one step at a time: write a register → wait → read it back and compare → log the result. At the end you have a script that you can run again and again, that decides PASS or FAIL by itself, and an Excel report.
Every screen and result here was checked on the v1.3.4 (Windows) Release build. The sample script and report used in this chapter can be downloaded from the links in the text.
0. Before you start: a device to talk to
Follow step 1 of Getting started › First connection: open another window, switch it to Slave and click Listen, so it acts as a device on 127.0.0.1:502. The script in this chapter connects to that simulated device.
If you have a real device, point channel A at its IP or serial port in section 2 instead.
1. Open Script mode
Click Script on the left. A new script already has one empty case, named Test 1.

The main areas:
| Area | What it is |
|---|---|
| Toolbar (top) | New, Open JSON, Save JSON, undo, redo; Run F5, Pause F6, Step F10, Stop Esc; Loop (1×/N×/∞); Pause on FAIL; Export |
| CONNECTIONS (left) | Connection cards for channels A and B. The switch turns a channel on or off, and the ⇄ icon opens its settings |
| CASES / SUBROUTINES (left) | The list of test cases and subroutines. + adds one |
| REPORT & ERRORS (bottom left) | Firmware: the firmware version text written into the report. On comm error: what to do when communication fails (see Concepts) |
| Step table (centre) | The steps of the current case. After a run, it shows each step's Result, Check (expected value) and Actual (actual value) |
| Output (bottom) | The Log and Variables tabs |
2. Set up channel A
Click the ⇄ icon at the top right of the channel A card (or Connection → Set Channel A...) to open its connection settings.
Modbus TCP (used in this tutorial; keep the defaults):

| Field | What it sets | This tutorial |
|---|---|---|
| Role | Master: read and write the device. Slave: make this channel act as a device | Master |
| Mode | Modbus TCP or Modbus RTU | Modbus TCP |
| Slave ID | The device's unit ID | 1 |
| TCP IP | The device's IP | 127.0.0.1 |
| TCP Port | The device's port | 502 |
| Timeout | How long to wait for a reply | 1000 ms |
| Retries | How many times to retry when there is no reply | 3 |
Modbus RTU: switch Mode to Modbus RTU and the IP and port give way to serial settings:

| Field | What it sets |
|---|---|
| COM Port | The serial port, for example COM3 (/dev/ttyUSB0 on Linux) |
| Baud | The baud rate, for example 9600, 19200 or 115200 |
| Data bits / Parity / Stop bits | Data bits, parity (None/Even/Odd) and stop bits. They must match the device |
Click OK. The channel A card shows a summary of the connection, for example 127.0.0.1:502 · Slave ID 1. This tutorial uses only channel A, so leave channel B off (Off).
3. Add steps
Click Add Step at the top right of the step table (or + Add step at the end below it) to open the add-step window:

- The left side lists every step type, in five groups: I/O, FLOW, VARIABLES, TIMING & RESULT and INSPECT.
- The right side holds the settings of the selected step.
- PREVIEW at the top summarises the step as you edit. The top right shows Ready when the settings are complete, or Needs a fix when a field still needs attention, with the reason shown below.
- Add adds the step and closes the window. Add & next adds it and opens a new add-step window straight away, which is quicker when adding several steps.
We will add four steps in order.
Step 1: Write
- Click Write on the left.
- Keep Function at
06 - Write Single Register, Channel atAand Start address at0x0000. - Enter
0x1234in Write value. - PREVIEW shows
Write FC06 A 0x0000 = 0x1234. Click Add & next.

Addresses and values can be decimal (
4660) or hex (0x1234). Hex always needs the0x.
Step 2: Wait
- Click Wait on the left.
- Keep the default
100 ms. - Click Add & next.
The wait gives the device time to process the write. If a real device needs longer, raise it.
Step 3: Read back and compare
- Click Read on the left.
- Keep Function at
03 - Read Holding Registers. Start address and End address are both0x0000(one register). - Set Compare to = equals and enter
0x1234in Expected value. - Enter
vin Variable to store the value read in variablev, which the next step uses. - PREVIEW shows
Read FC03 A 0x0000 == 0x1234 → v. Click Add & next.

The four Compare choices:
| Choice | PASS when |
|---|---|
| No check | The device replies, whatever the value |
| = equals | The value read equals the expected value |
| ≠ not equal | The value read differs from the expected value |
| In range | The value read is between the lower and upper limits |
Step 4: Log a line
- Click Log on the left.
- Enter
Read back 0x0000 = ${v}in Message. At run time,${v}is replaced with the value of variablev. - Click Add.

The step table now has four steps:

To edit a step, double-click it (or select it and press Enter). Del deletes it. Drag the ⋮⋮ handle or press Ctrl+↑/↓ to reorder. Ctrl+/ disables or enables the step. Right-click for more.
4. Run
Click Run F5. A confirmation window first lists the channels this run will connect, how communication failures are handled, and the number of rounds:

If it looks right, click Run. When the run finishes:

- The top shows Release PASS and
PASS 1 / FAIL 0 / SKIP 0 / DISCONNECT 0. - Every step's Result is PASS, and the Actual column shows the value read and the response time, for example
0x1234 · 0.3 ms [v = 4660]. - The case card on the left is ticked and shows
4 step(s) · PASS. - The Log tab records the whole run, and its last line is the path of the log file. Click Open log folder at the top right to open the folder.
The Log step prints
Read back 0x0000 = 4660:${v}is shown in decimal, and4660is0x1234.
Switch to the Slave window: 0x0000 now holds 4660, and the Writes counter has gone up:

The Variables tab lists the variables this run created, with their decimal and hex values and the step that set them:

Other ways to run
| Button / shortcut | What it does |
|---|---|
| Run F5 | Run every case from the start |
| Script → Run from Selected Step (Ctrl+F5) | Run one round starting at the selected step |
| Step F10 | Run one step, then pause. Handy for debugging |
| Pause F6 / Resume F6 | Pause / resume |
| Stop Esc | Stop the run |
| Pause on FAIL | When ticked, the run pauses on a FAIL so you can inspect the device on the spot |
5. Save the script
Click Save JSON in the toolbar (or File → Save Script As...) and choose a location and name. A script is a JSON text file. Saved, the script you just built looks like this (first-script.json):
{
"cases": [
{
"steps": [
{
"write": {
"address": "0x0000",
"channel": "A",
"function": 6,
"value": "0x1234"
}
},
{
"wait": {
"ms": 100
}
},
{
"read": {
"address": "0x0000",
"channel": "A",
"compare_op": "==",
"expected": "0x1234",
"function": 3,
"store": "v"
}
},
{
"log": {
"message": "Read back 0x0000 = ${v}"
}
}
],
"test": "Test 1"
}
],
"channel_a": {
"enabled": true,
"ip": "127.0.0.1",
"port": 502,
"retry": 3,
"role": "master",
"slave_id": 1,
"timeout_ms": 1000,
"transport": "tcp"
},
"channel_b": {
"enabled": false,
"ip": "127.0.0.1",
"port": 502,
"retry": 3,
"role": "master",
"slave_id": 1,
"timeout_ms": 1000,
"transport": "tcp"
},
"firmware": "unknown",
"loop": 1,
"loop_infinite": false,
"on_error": "skip",
"same_line": false
}The file holds the steps, the connection settings of both channels, the number of rounds and how communication failures are handled, so opening it on another PC runs it with the same settings. Each field is explained in Script concepts.
The status next to the file name shows Unsaved (never saved), Modified (unsaved changes) or Saved.
6. Export a report
After a run, click Export (or Script → Export Excel) and choose where to save. The default name is "script name_report.xlsx", for example first-script_report.xlsx (download the sample report). The report has three sheets:
| Sheet | Contents |
|---|---|
| Summary | Firmware, case count, PASS/FAIL/SKIP/DISCONNECT counts and the Release verdict |
| Cases | Each case's run time, name and verdict |
| Steps | Each step's time, case, step number, action, channel, function code, start and end address, actual value, expected value, verdict, note and response time (ms) |
Export is available once the script has run, and exports the most recent run.
7. Open existing scripts and samples
Click Open JSON in the toolbar (or File → Open Script...) to open a script file.
The
scriptsfolder in the app folder holds sample scripts, for example:Sample What it does A single.jsonWrite one register on channel A and read it back A consecutive.json,A multi-segment.jsonA consecutive block, several blocks A to B single.jsonand othersWrite on channel A, read back on channel B (gateway tests) Power cycle.jsonPower-cycle test Showcase - all features.jsonShows every feature Script → Import Template... adds a case from a template: one channel stands for one device, two channels for "write on one side, read on the other".
8. Next steps
- Script concepts: results, communication failures, variables, multiple rounds and value formats
