State machines overview
States, actions and transitions, sequence logic without code.
Cams and functions produce continuous motion. Machines also have sequences: home, wait for a part, clamp, move, release, repeat. State machines are how you express that, graphically, no code.
The model
A state machine has states; exactly one is marked initial. While a state is active, its actions execute every tick. Its transitions are evaluated in order, the first whose condition is true switches the machine to the target state.
┌─────────┐ part present ┌─────────┐ clamped ┌────────┐
──► │ Waiting │ ───────────────►│ Clamping│ ────────────►│ Moving │
└─────────┘ └─────────┘ └───┬────┘
▲ position done │
└───────────────────────────────────────────────────┘- Actions write to variables: hold a value, run a function, run a cam, or execute a trapezoid position move toward a target. See Actions.
- Transitions fire on variable thresholds, timers, or the completion of a position move. See Transitions.
Where state machines run
State machines tick first in the simulation loop, their writes are visible to variables and objects in the same frame. They run in both Simulation and Online modes; a common Online use is animating the product flow around a machine whose axes are PLC-driven.
Runtime state (which state is active, timer progress, move progress) resets when simulation restarts. It is not saved with the project.
Editor
The State Machines tab lists machines; selecting one shows its states, each state's actions, and the transition editor. Mark the initial state, then build outwards from the happy path, see Patterns for well-worn structures.