
State Engine Programming
A Practical Guide to Sequential and Batch Process Control in CODESYS
Coming soon
Most PLC programs don't fail because the math was wrong. They fail because no one could say, with certainty, what the machine was supposed to be doing at the moment it misbehaved.
This book fixes that by design. It teaches one disciplined pattern, the state engine, that gives a process exactly one well-defined state at every scan, a safe state to fall back to, and a clean, repeatable home for every transition and every output. The pattern is built from three small subroutines: a framework that knows which step is active, the transition logic that decides when to move, and the outputs that drive the field according to the active step. Write it twice and you will never go back to a wall of free-floating interlocks. Everything is concrete and built in CODESYS, rung by rung, in real IEC 61131-3 ladder logic.
Inside: build a state engine from three subroutines; design safe states and fault handling that latch and recover only on purpose; put timers to work for dwells, step watchdogs, and debounce; wire a clean HMI and first-out diagnostics without letting the screen drive the engine; carry three real machines from a blank project to a running sequence (a fuel-gas burner, a multi-stage pump station, and a batch mixer-cooker); and test in simulation, commission in stages, and know when to reach for SFC. You need only to know what a contact and a coil are, and to want a program you can hand to the next technician without an apology.
- Author
- Charles Vance
- Category
- Programming
