STUnit
STUnit: testing control logic before it reaches the PLC
A control block can produce the right output on one scan and fail several scans later. We developed STUnit so an engineering team can describe that scenario, repeat it outside the PLC and see exactly where the result changes.

A clock you can run again
Waiting ten milliseconds and observing an output by hand is hard to reproduce. STUnit lets the engineer set the scan duration and advance a simulated clock. The documentation runs a timer case over twenty ten-millisecond scans. Change the block and the same sequence is ready to run again.
From source code to a useful failure
The runner assembles the Structured Text sources, translates them to C with matiec and compiles with GCC. Each case keeps its own counters. A failed comparison reports both the expected value and the actual value. For a timed block, an assertion can wait several scans for its condition to become true.
python3 runner/run.py --filter timer \
--cycles 20 --cycle-time-ms 10One run, two readers
A developer needs to find the discrepancy. A continuous integration system needs to decide whether the run passed. STUnit produces a readable diagnostic, an exit code and reports in JSON and JUnit. Tags select subsets of tests, and skipped cases remain distinct from successful ones.
Why open a pilot
The website walks through a terminal example and links each step to the documentation. Automation teams can try representative, anonymised or synthetic cases. The pilot is designed to test compatibility and the usefulness of diagnostics against real team workflows before extending support to other environments.
