Sequential Function Chart (SFC) Implementation
IEC 61131-3 compliant
Door position
Active SFC step
I/O TRUE = closed circuit
Controls
Event log
I want to program a control system to control a garage door.
The user controls the garage door with a momentary contact push button that starts and stops the motor.
The motor automatically stops when the door hits the open or closed indicator switch.
If the garage door is closed, it opens on a push-button pulse.
If the garage door is moving, it stops on a push-button pulse.
If the garage door is stopped while it was moving, the next push-button pulse closes the garage door.
If the garage door is in the fully open position, a push-button pulse closes the garage door.
Door position digital inputs:
Door Open
Open circuit when the door is fully open, and
Closed circuit when closed or moving.
Door Closed
Open circuit when the door is fully closed, and
Closed circuit when open or moving.
Error state:
In case both door position switches are open circuit: the motor is stopped, an error LED is illuminated on the motor casing, and all further push-button pulses are ignored until one of the door position switches is closed.
The controller logic is implemented in Structured Text (ST), a high-level, Pascal-like language and one of the five languages defined in the IEC 61131-3:2025 international standard for Programmable Logic Controllers.
Structured Text is natively supported by all major PLC platforms:
Opens in a new tab. Place it alongside the simulator to follow the code as you operate the controller.