Skip to content

Verdict ​

Purpose: set this case to PASS or FAIL directly, regardless of the step results.

Verdict settings

Pick Force PASS or Force FAIL in Result. It usually sits in an If or Else branch.

JSON ​

json
{ "verdict": "fail" }
{ "verdict": "pass" }

It can also be written as {"verdict": {"result": "pass"}}. PASS and FAIL in upper case are accepted too.

Result ​

  • The Verdict step itself shows the result it sets.
  • The case result follows the Verdict, even if an earlier step FAILed. If a case has several Verdicts, the last one to run wins.
  • Steps after a Verdict still run.
  • With Pause on FAIL ticked, a Verdict FAIL also pauses the run.

Example ​

CaseWhat it doesResult
Force FAILReads a status flag into s and sets FAIL if s is not 0. The read itself is PASSFAIL
Force PASSThe read compare fails (expected 99, actual 1), but a final Verdict sets PASSPASS

Verdict example result

Notes ​

  • Verdict suits checks where the value itself is neither right nor wrong and only a calculation tells, such as the status flag in example 1.
  • Verdict cannot be used in a subroutine. Return a value instead and decide in the case.
  • When a Verdict PASS overrides a FAIL, the report still records the FAILed step. Make sure that is what you want.

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.

Roach Modbus Tool by Mr.Roach