What is SFC?
Sequential Function Chart (SFC) is a graphical programming language from the IEC 61131-3 standard with which a PLC controls a process as a fixed sequence of steps, with a transition between every two steps that determines when control moves on to the next step. Each step carries actions, such as starting a pump or opening a valve, and each transition is a condition, such as “tank full” or “timer elapsed”. That makes SFC the natural language for batch processes, machine cycles and start-up and shutdown procedures in process automation, industrial automation and other industrial control systems. The actions and transitions themselves are written in the other languages of the standard: Ladder Logic, FBD or ST.
🧠 How does a Sequential Function Chart work?
An SFC is a network in which steps and transitions always alternate: two steps are never connected directly, and neither are two transitions. The building blocks are:
| Element | Function | Example |
|---|---|---|
| Initial step | Step that is active when the program starts (drawn with a double border) | Idle or Wait_for_start |
| Step | A state of the process; active or inactive | Fill, Heat, Mix |
| Transition | Boolean condition between steps | Level >= 90 %, Fill.T > T#5m |
| Action | Logic belonging to an active step, with a qualifier | Valve V101 open, agitator on |
| Divergence / convergence | Splitting paths and joining them again | Alternative or parallel branches |
| Jump | Back to an earlier step, for example for a new cycle | After Drain back to Idle |
Execution follows two simple rules. A transition only fires when all steps directly above it are active and its condition is true. At that moment those preceding steps become inactive together and the following steps become active together. The PLC evaluates this every program cycle, so an SFC simply runs inside the cyclic scan, which in practice usually lies between 1 and 100 ms.
For each step the standard keeps two flags: StepName.X is true while the step is active, and
StepName.T shows how long the step has been active. These two make supervision easy, for
example raising an alarm when Fill.T exceeds five minutes.
🔧 Which action qualifiers does SFC use?
Each action gets a qualifier that determines when and for how long it executes. This is where SFC is more powerful than a simple step counter.
| Qualifier | Meaning | Typical use |
|---|---|---|
| N | Non-stored: active as long as the step is active | Valve open while filling |
| S | Set (stored): stays active until an R action | Agitator on across several steps |
| R | Reset: switches off a previously set action | Agitator off in the final step |
| L | Time limited: active until a time has elapsed or the step ends | Horn for at most 3 s |
| D | Time delayed: starts only after a delay, as long as the step stays active | Fan after 10 s |
| P, P1, P0 | Pulse: one cycle, when the step is activated (P1) or deactivated (P0) | Increment a counter, log a batch |
| SD, DS, SL | Combinations of storing with a delay or a time limit | Run-on time that continues after the step |
L, D, SD, DS and SL require a time value. Vendors differ in the details, such as whether an SD action keeps running once the step has already been left, so check the behaviour in your platform’s manual before relying on it.
🔀 How do alternative and parallel branches work?
SFC has two kinds of branching:
- Alternative branch (selective divergence) - a single line with several transitions below it; exactly one path is chosen, for example recipe A or recipe B. If several conditions are true at once, most implementations give priority to the leftmost branch, so make the conditions mutually exclusive where possible.
- Parallel branch (simultaneous divergence) - a double horizontal line; all paths become active at the same time, for example two conveyors starting together. At the double line where the paths join, the transition waits until all final steps of the branches are active. This is how SFC synchronises parallel processes without extra code.
A badly designed network can be unsafe (a parallel branch is left through an alternative branch, so steps remain stuck) or unreachable (a step can never become active). The standard treats such structures as errors, and most editors reject them at compile time.
🕰️ Where does SFC come from?
SFC is the PLC variant of GRAFCET, a French method for specifying sequential control that is itself derived from Petri nets.
| Year | Event |
|---|---|
| 1977 | A working group of the French association AFCET publishes the report regarded as the birth of GRAFCET |
| 1982 | AFNOR standardises GRAFCET as NF C03-190 |
| 1988 | International standard IEC 848 (later renumbered IEC 60848) |
| 1993 | First edition of IEC 61131-3 includes SFC alongside LD, FBD, ST and IL |
| 2002, 2013 | New editions of IEC 60848, the current one dating from 2013 |
| 2025 | Fourth edition of IEC 61131-3; with IL removed, the standard has four languages, SFC among them |
The difference is mainly one of purpose: GRAFCET (IEC 60848) is a specification language for describing the behaviour of a machine, while SFC (IEC 61131-3) is an implementation language that runs on a PLC. Strictly speaking, IEC 61131-3 describes SFC as a set of elements for structuring programs and function blocks rather than as a standalone language.
🔄 How does SFC differ from the other IEC 61131-3 languages?
| Language | Form | Strong at | Role alongside SFC |
|---|---|---|---|
| SFC | Graphical, steps and transitions | Sequences, synchronisation | Top layer: which phase is active |
| Ladder Logic | Graphical, relay logic | Boolean logic, interlocks | Transition conditions and simple actions |
| FBD | Graphical, function blocks | Signal processing, control loops | Actions with PID or analogue logic |
| ST | Textual, Pascal-like | Calculations, data | Complex actions, recipe calculations |
In a well-structured project SFC determines when something happens, while the other languages determine how. Interlocks that must always apply, such as “never run the pump at low level”, belong outside the SFC in a block that is executed permanently, so they do not depend on which step happens to be active.
The strengths and weaknesses of SFC at a glance:
| Benefits | Limitations |
|---|---|
| Process structure visible at a glance, much like a state machine | Unsuited to calculations and continuous control |
| Active step and stuck transition immediately visible during faults | Large networks quickly become hard to read |
| Parallel branches synchronise without extra code | Many parallel branches make behaviour hard to predict |
| Fits batch models and modular design | Details of qualifiers and timing differ between vendors |
🏭 Where is SFC used in practice?
- Batch processes - in ISA-88 the sequence of a recipe lives in procedures and phases, which are often implemented as SFC; see also batch control systems and the difference between discrete, batch and continuous
- Cleaning processes - CIP cycles in the food and dairy industry: pre-rinse, caustic, intermediate rinse, acid, final rinse
- Machine cycles - packaging machines, assembly stations and robot cells (robot sequences), often combined with the state model of PackML
- Start-up and shutdown procedures - controlled start-up of boilers, compressors or treatment stages
Typical sectors are chemicals, food and beverage, pharmaceuticals and water treatment: anywhere a plant passes through a fixed series of phases.
Virtually every platform supports SFC: Siemens as S7-GRAPH in TIA Portal and as the SFC editor in the PCS 7 process control system, Rockwell Automation in Studio 5000, and CODESYS and TwinCAT with their own SFC editors. Operators see the active step through the HMI and SCADA, while MES and the historian record batch status and step durations.
🧭 How do you design a robust SFC?
- Start with a state diagram on paper - name steps as states (“Filling”), not as actions, and define which transitions sit between them.
- Keep networks small - as a guideline, one SFC per unit or equipment module with at most a few dozen steps; split larger processes into sub-procedures.
-
Supervise every step - give each step a maximum duration using
StepName.T, often two to three times the normal duration, and move to a fault step with a clear message when it is exceeded. - Design fault handling explicitly - a fixed branch for hold, abort and safe stop, instead of operators forcing steps by hand.
- Define restart after a power failure - decide whether the sequence may continue in its last step or must return to the initial step.
- Test on a simulation or digital twin - run through the fault paths too, not just the normal cycle. In Industry 4.0 projects this increasingly happens virtually, with a soft PLC against a process model, before the plant even exists.
Common problems and their causes:
| Problem | Possible cause |
|---|---|
| Step gets stuck | Transition never becomes true, for example a faulty sensor |
| Sequence jumps unexpectedly | Overlapping conditions in an alternative branch |
| Deadlock after a parallel branch | One branch never reaches the join |
| Output stays on after stopping | S action without a matching R action |
🛡️ How does SFC relate to functional safety?
SFC is used for safety-related procedures such as a controlled shutdown or a start-up check, but the safety function itself does not belong in it. A safety PLC is usually programmed with a limited, certified subset of the languages, in practice FBD or LD with certified function blocks; SFC is generally not available there. The standards IEC 61508, IEC 61511 for the process industry, and ISO 13849 and IEC 62061 for machine safety set requirements for verifying and validating that safety logic. The usual set-up is therefore: the SFC runs the normal process, and the safety PLC intervenes independently and fail-safe.
🔐 How do you secure SFC programs?
Anyone who can change PLC code can make a sequence skip, extend or silently alter a step. Stuxnet showed in 2010 how this works: the malware modified code on Siemens S7 PLCs that drove frequency converters and hid those changes from the engineering software. An SFC is not a separate attack target, but because it defines the order of the process, a change has direct physical consequences. Measures in line with IEC 62443:
| Measure | Purpose |
|---|---|
| Network Segmentation | Engineering access only from its own zone |
| Engineering workstation with MFA | Only authorised staff can download |
| Application Whitelisting | No unknown software on the engineering workstation |
| Version Control and Change Management | Every change to a sequence traceable and approved |
| Logging | Record downloads and online changes |
| Patch Management | Close vulnerabilities in engineering software and firmware |
| Backup | Restore a known good version quickly |
❓ Frequently asked questions
Is SFC a real programming language?
SFC is listed in IEC 61131-3 as one of the four PLC languages, but strictly speaking the standard describes it as a structure for dividing programs and function blocks into steps. The actions and transitions inside an SFC are written in Ladder Diagram, FBD or Structured Text.
What is the difference between SFC and GRAFCET?
GRAFCET (IEC 60848) is a specification language for describing the sequential behaviour of a machine, independent of the technology. SFC (IEC 61131-3) is derived from GRAFCET and is intended for actually programming that sequence on a PLC.
What is S7-GRAPH?
S7-GRAPH is Siemens’ SFC implementation for S7 PLCs in STEP 7 and TIA Portal. It follows the SFC principles of steps, transitions and actions, extended with Siemens-specific features such as step supervision and interlock conditions per step.
When should you choose SFC instead of ST or ladder?
SFC is the best choice when a process passes through a fixed order of phases, such as a batch, a cleaning cycle or a machine cycle. For continuous control, calculations or simple combinational logic, ST, FBD or ladder are more suitable, often as actions within the SFC.
Can an SFC have several steps active at the same time?
Yes, an SFC can have several steps active at once through a parallel branch. The branches join again at a synchronisation point, where the next transition only fires once all parallel branches have reached their final step.
Can SFC be used in a safety PLC?
In certified safety programs SFC is usually not available; FBD or ladder with certified function blocks are used there instead. SFC often does run the normal process sequence, while an independent safety PLC performs the safety functions.
📌 In summary
SFC is the IEC 61131-3 language for sequences: steps, transitions and actions turn a batch, cleaning cycle or machine cycle into a clear program that is easy to diagnose. Combine SFC with ladder, FBD or ST for the logic, keep safety functions in a separate safety PLC and manage changes to sequences strictly, because they directly determine the physical process.
