Ask
Purpose: ask the operator during a run, either to judge PASS/FAIL or to enter a number or some text that is stored in a variable.

Answer picks the kind of answer (PASS / FAIL, Number, Text), and Save as is the variable that holds the answer (required for Number and Text).
JSON
json
{ "ask": { "message": "Is the LED on?", "answer": "pass_fail" } }
{ "ask": { "message": "Measured voltage (V)", "answer": "number", "var": "volt" } }
{ "ask": { "message": "Serial number", "answer": "text", "var": "sn" } }| Field | Required | Meaning |
|---|---|---|
message | Yes | The question, 1–127 characters. Can include ${variable} |
answer | No | pass_fail (default), number or text |
var | Required for number/text | Variable that holds the answer |
While running
The dialog for each kind of answer:



Stop run stops this run, and the Ask step counts as not run.
Result
| Answer | PASS | FAIL |
|---|---|---|
pass_fail | The operator clicks PASS | The operator clicks FAIL |
number | A number is entered (such as 3.3 or 0x10) and stored as a numeric variable | What was entered is not a number |
text | Stored as a text variable | — |
Example
Asks in turn whether the LED is on, the measured voltage and the serial number, then the Log prints Serial SN-0001, 3.3 V.

Notes
- Text variables can only be used in Log, Pause and Ask messages (
${sn}), not in calculations. Each round holds up to 32 text variables, each up to 95 characters. - When run from the command line with
--run-scriptthere is no operator, so Ask is judged FAIL (no operator to answer).
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.
