Tiza Group

Home / Guides / Industry and automation

GRAFCET and SFC: Programming PLC Sequences

How to program sequences with GRAFCET and SFC: steps, transitions, OR and AND divergences, the initial step, and why safety is kept separate.

By Shadai García, CEO and protection engineer at Tiza Group.

0start · overload ok1KM1 closed (13-14)KM1 := 12airflow confirmedwait for pressure switch3stop ∨ faultfan running4KM1 open (13-14)KM1 := 05wait for stopOR divergenceAabBCcDselection: a single branchAND divergenceABCcDsimultaneous: waits for B and CElementsInitial step 0TransitionActionField confirmation© tizagrp.com0start · overload ok1KM1 closed (13-14)KM1 := 12airflow confirmedwait for pressure switch3stop ∨ faultfan running4KM1 open (13-14)KM1 := 05wait for stopOR divergenceAabBCcDselection: a single branchAND divergenceABCcDsimultaneous: waits for B and CElementsInitial step 0TransitionActionField confirmation© tizagrp.com
Fan GRAFCET: steps 0 to 5, transitions with field confirmation, and OR and AND branches. Location in the system and operating principle. Illustrative: real values come from the nameplate and the manufacturer's manual.
Short answer

GRAFCET and SFC describe a process as a succession of steps joined by transitions. An active step runs its actions, and when its transition condition is met, the transition deactivates the previous step and activates the next. They allow alternative and parallel branches and require a single initial step.

Short answer

An industrial sequence (fill, heat, mix, empty; or the startup steps of a plant) is better understood as stages than as logic equations. GRAFCET and SFC (sequential function chart) describe it with three elements: steps, transitions, and actions. Only one step is active in each branch; when the condition of the transition that follows it is met, that step is deactivated and the next one is activated. GRAFCET is standardized by IEC 60848 and SFC is part of IEC 61131-3; both are paid standards, and the method is described here in our own words.

The elements

ElementDrawn asWhat it means
StepNumbered rectangleA stable stage of the process; it is active or not
Initial stepDouble-bordered rectangleThe starting situation; there is only one per diagram
TransitionSmall transverse bar across the linkThe condition that allows moving to the next stage
Directed linkVertical line with an arrowThe direction of progress (normally downward)
ActionRectangle attached to the stepWhat is done while the step is active
Receptivity (transition condition)Text next to the transitionThe Boolean condition: a sensor, a timer, a counter, or combinations

One structural rule: steps and transitions always alternate. Between two steps there is a transition; between two transitions there is a step.

How the diagram evolves

  1. At startup, the initial step is activated.
  2. A transition is enabled when all the steps that precede it are active.
  3. If its receptivity is also met, the transition is fired: the preceding steps are deactivated and the following ones are activated.
  4. The actions tied to an active step are executed; when it is deactivated, they cease (except for actions defined as stored).

So the diagram always says which stage the machine is in, which simplifies diagnosis: if the process is stopped, the active step and the transition it is waiting on show which signal is missing.

Alternative and parallel branches

StructureSymbolBehavior
OR divergence (selection)A single horizontal line with one transition per branchOnly one branch is followed, the first whose condition is met
OR convergenceA single horizontal line joining the branchesWhichever branch finishes continues through the common exit
AND divergence (parallelism)Double horizontal lineWhen the transition is fired, all branches are activated at once
AND convergenceDouble line joining the branchesWaits for all to finish before continuing

The conditions of an OR divergence must be mutually exclusive. Parallel branches are synchronized at the AND convergence, which requires all branches to be in their last step.

From GRAFCET to the PLC

There are three usual ways to bring it into the controller:

  • Native SFC, if the environment offers it: the diagram is drawn and each action and transition is written in ladder, function blocks, or text.
  • Structured text with CASE: a stage variable and one branch per step, with the transitions as IF conditions. It is the typical solution when there is no SFC. See Structured Text: fundamentals.
  • Ladder with step bits: one bit per step, set by the transition and cleared when the next one is activated. It is the classic method and still widely used.

Illustrative example: sequential start with the 15 kW motor

Assumed data: a process fan driven by a 15 kW, 400 V motor (rated current on the order of 28 A), with an air inlet damper and a line contactor. The conditions and times belong to the example, not to a real unit.

StepActionTransition to the next
0 (initial)Everything off, damper closedStart command and no fault
1Open the damperDamper open limit switch
2Close contactor KM1KM1 feedback and an assumed 10 s timer to let the start stabilize
3Normal run; releases the “fan ready” signalStop command or fault
4Open KM1KM1 open feedback
5Close the damperDamper closed limit switch, and return to step 0

Each transition rests on a field confirmation (limit switch, auxiliary contact), not only on time. If the damper does not open, the sequence stays stopped at step 1 and does not start the motor against a closed damper; the diagnosis is immediate.

Safety stays outside the sequence

A rule found in GRAFCET practice: safety interlocks are implemented outside the sequence structure, or as forcing transitions that override normal progress. The protection of people is not entrusted to a step. The emergency stop acts on the power or safety circuit; the sequence only learns of it, goes to its safe rest step, and requires a deliberate reset. The same criterion applies to the electrical protections of the motor, such as those in low-voltage motor protection.

Advantages and limits

Advantages: the machine state is visible, sequences are documented and can be discussed with whoever knows the process, and changes are localized. Limits: it describes the order, not the calculations. Sequences with many operating modes (manual, automatic, emergency stop, recovery after a fault) become complex and call for a separate mode structure.

Operating modes and recovery

A real sequence does not only move forward. It must also be able to stop, step back, and recover:

SituationUsual handling
Automatic runThe sequence advances as each transition is met
Step-by-step runEach transition also requires an operator command; useful at commissioning
Normal stopThe cycle in progress is completed and it returns to the initial step
Fault stopForcing transition to a safe rest step
Restart after a faultExplicit command; it is verified that the field is in its initial condition
Power lossIt is decided whether the sequence retains its step or starts from the initial one

That last point is a safety matter: resuming a sequence midway after a power loss can leave the machine in a position the program does not expect. In most cases it starts from the initial step, with a check of conditions.

Documenting with GRAFCET

Even if it is later programmed in ladder or text, the diagram is an excellent specification tool: whoever knows the process and whoever programs can review it together, and it serves as the script for acceptance tests, which walk through each step and each transition. Delivering the diagram together with the program eases maintenance, because a technician knows which step the machine stopped at and which signal is missing. In an audit context, that functional description is part of the evidence that the system does what was specified.

Common mistakes

  • More than one initial step, or none.
  • Two consecutive steps without a transition.
  • Transitions based only on time, without confirming the state of the equipment.
  • OR branches with conditions that can be met at the same time.
  • Poorly synchronized AND convergences, so a branch waits indefinitely.
  • Actions that leave outputs on when leaving the step, by storing them without releasing them.
  • Not planning the return after a fault, with the machine trapped in a step.
  • Putting safety inside the sequence.
  • Mixing the sequence with the control of each piece of equipment instead of separating the sequence level from the equipment level.

Checklist

  • A single initial step, with clear starting conditions.
  • Strict alternation of steps and transitions.
  • Each transition has its field confirmation and a maximum supervision time.
  • OR branches mutually exclusive.
  • AND branches with a verified convergence.
  • Outputs released on leaving each step.
  • Behavior defined for fault, stop, and restart.
  • Protection of people independent of the sequence.
  • The printed diagram matches the online program.

Frequently asked technical questions

  • Is it suitable for programming the start of several motors? Yes; it is a good candidate, along with transfers and machine cycles. Compare it with the timer-based version in timers and counters in PLCs.
  • Are there graphical tools? Many environments include an SFC editor. If not, the diagram can be translated to ladder or text.
  • What is a step with a stored action? An action that is activated on entry and held until another step explicitly deactivates it.
  • How is a sequence tested? By forcing conditions one at a time and checking that the active step changes as expected.

How we help

A well-specified sequence saves commissioning time. At Tiza Group we design the control logic, define the safe states and field confirmations, then test the system and commission it. See engineering design and studies and testing and commissioning, or write to us through contact.

References

  • IEC 60848, GRAFCET (paid standard).
  • IEC 61131-3, sequential function chart (paid standard).
  • GRAFCET tutorial with translation to CASE (Industrial Monitor Direct).
  • Hugh Jack, Automating Manufacturing Systems with PLCs (CC BY-NC-SA 3.0 US).

Frequently asked questions

Are GRAFCET and SFC the same thing?

They are very close. GRAFCET is the French-origin description method, standardized by IEC 60848; SFC is the IEC 61131-3 language derived from it. Executable SFC has rules that descriptive GRAFCET does not impose.

Why must steps and transitions alternate?

Because a step is deactivated only when the transition that follows it is satisfied, and a transition is evaluated only if the previous step is active. Two steps in a row or two transitions in a row break that logic.

Where is an emergency stop programmed?

Outside the sequence, in safety circuits that act on the actuators. A sequence can have a forcing transition to a safe step, but the protection of people does not depend on it.

What happens if two transitions of an OR divergence are satisfied at the same time?

It must be avoided in the design: the conditions of alternative branches have to be mutually exclusive. If they are not, the behavior depends on the priority the environment defines.

WhatsApp