Glossary · PLC and control programming
Finite-state machine (FSM)
Also known as: State machine, Finite automaton
German: Endlicher Automat
In software and control engineering, a finite-state machine (FSM) is a model of behavior with a finite number of states, in which the system is in exactly one state at a time and changes state through defined transitions triggered by inputs or events.
- PLC programming
In one sentence
A finite-state machine has a finite set of states and defined transitions; in PLC code it structures sequences and machine modes.
Example
A pick-and-place unit is programmed as an FSM with the states WAIT_PART, PICK, MOVE, PLACE and RETURN, implemented with a CASE statement over an enumeration.
How it applies
- Engineering: FSMs are the most common way to structure sequential machine logic. In Structured text (ST), a CASE statement over an Enumeration implements the states; in Sequential function chart (SFC), steps and transitions express the same idea graphically. The ISA-88 and PackML state models are standardized state machines for batch and packaging equipment.
- Commissioning: A clear FSM makes testing systematic: each state and each transition becomes a test case, including faults and aborts.
- Operation: Showing the current state on the HMI tells operators what the machine is waiting for.
- Documentation: A state diagram with a table of states, transition conditions and actions is the best bridge between specification, code and manual. Reuse the state names from the program in the operating manual and in alarm texts.
Finite-state machine vs. state model
In this glossary, the State model is the systems engineering description of a system's states and permitted transitions. The FSM is the concrete computational form, usually implemented in software. A state model can be realized as one or several FSMs.