Glossary
What is State machine?
A pattern where the process is in exactly one known state at a time and moves between states on defined conditions.
In ST it is written with CASE: each state is a number or an enumerated value, holding what should happen and the condition for the next transition. That makes the behaviour drawable, reviewable and testable.
A good industrial state machine always has a fault state and a timeout on every step: if the step does not finish in time, go to the fault instead of waiting forever.
Related terms
- CASE statement
- A selection statement that runs one branch depending on an integer or enumerated value. It is what state machines in ST are built from.
- On-delay timer (TON)
- A standard function block whose output Q becomes true after IN has stayed true for PT without interruption, and resets as soon as IN drops.
- Step timeout
- A timer watching each step of a sequence: if the step does not finish in its expected time, raise a fault instead of waiting forever.