Serial numbers in the report
Need: on a production line, the operator scans each unit's serial number first and visually checks an LED during the test. The exported report must show which unit it was and how the operator answered.
| Step | What it does |
|---|---|
| 1 | Ask (text): Scan the unit serial number, answer stored in sn |
| 2 | Log Testing unit ${sn} |
| 3–4 | Write 0x0300 = 1 (start the self-test) and read it back |
| 5 | Ask (pass_fail): Unit ${sn}: is the RUN LED on? |
| 6 | Write 0x0300 = 0 |
| 7 | Log Unit ${sn} done |
At step 1 an input box appears with the cursor already in it. OK is the default button, so a barcode scanner that ends with Enter submits the answer as soon as it scans:

The question at step 5 includes the serial number just entered, and the operator clicks PASS or FAIL:


What the report contains
After the run, click Export to export the report: 07-serial-number_report.xlsx. The detail column of the Steps sheet records the operator's answers:
| step | action | verdict | detail |
|---|---|---|---|
| 1 | ask | PASS | sn = SN-2611-0042 |
| 2 | log | PASS | Testing unit SN-2611-0042 |
| 3 | write | PASS | |
| 4 | read | PASS | |
| 5 | ask | PASS | operator: PASS |
| 6 | write | PASS | |
| 7 | log | PASS | Unit SN-2611-0042 done |
The Firmware column of the Summary sheet is the text of the Firmware field at the bottom left (FW 1.0.0 here), which you can use to record the firmware version under test.
Notes
- If the operator clicks FAIL, the step is judged FAIL. Stop run stops the whole run.
- If the input box is empty, or a Number answer is not a number, OK asks again.
- Ask needs someone to answer, so in command-line runs Ask always FAILs.
- For a separate report per unit, click Export after each unit, with the serial number in the file name.
Download the sample script
Sample script
Before running it, start a Slave window on 127.0.0.1:502 and click Listen, then open the script with Open JSON in Script mode and click Run. See How to use the examples.
