Sequential Function Chart (SFC) in PLC Programming
Sequential Function Chart (SFC) is the IEC 61131-3 graphical programming language for step-based sequences — batch processes, recipe handling, machine cycles, anything that runs as a series of named phases. SFC is the modern successor to GRAFCET (the French national standard from which it descends) and is the natural fit when ladder logic produces unreadable rung counts.
When to reach for SFC
SFC fits when your control flow is "do step 1, when condition X is true do step 2, when condition Y is true do step 3...". Batch reactors. Recipe handling. Test-stand sequences. Machine cycles. Startup/shutdown sequences. The moment you find yourself writing nested CASE statements or rungs that essentially encode "which step are we in?" — that's when SFC pays off.
Anatomy of an SFC
SFC building blocks
- Step — a named phase of the sequence. While active, its actions execute. Drawn as a rectangle. The initial step is drawn double-bordered.
- Action — code that runs while a step is active. Can be ladder, ST or FBD. Attached to a step with a qualifier letter.
- Action qualifier — controls how the action runs:
- •
N— Non-stored: runs while step active - •
S— Set: runs once and stays on until reset - •
R— Reset: turn off a previously Set action - •
P— Pulse: runs once at step entry - •
D— Delayed: runs after a time delay from step entry - •
L— Time-Limited: runs for a fixed duration
- •
- Transition — boolean condition that, when true, advances from one step to the next. Drawn as a horizontal bar.
- Parallel branch — multiple steps run simultaneously after a divergence. All must complete before the convergence transition fires.
- Alternative branch — only one of several possible next steps runs, based on which transition fires first.
SFC vs CASE in Structured Text
Many sequences can be implemented either way. SFC is graphical and the structure is visible at a glance — easier to review with non-programmers, easier for plant electricians to trace. ST CASE is more compact and easier to version-control as text.
In practice:
- Use SFC for batch sequences with parallel sub-sequences and recipe variations. Drawing it shows what runs in parallel.
- Use ST CASE for state machines without parallelism, or where text-based code review and version diff matter.
- Use ladder rungs with state-bit logic for tiny sequences (3-4 steps). Don't bring out SFC for trivial cases.
Vendor SFC support
- Siemens TIA Portal — full SFC editor. Most-used SFC implementation in industry. Common in pharma batch and chemical plants.
- Rockwell Studio 5000 — full SFC support. Tighter integration with PhaseManager / PlantPAx for batch.
- CODESYS / TwinCAT — SFC included. Strong action-qualifier support.
- Schneider EcoStruxure Machine Expert — SFC native.
- OpenPLC — SFC supported in OpenPLC Editor; Matiec compiler produces ST internally.
- Mitsubishi GX Works3 — SFC supported but less commonly used than ladder/ST.