GRAFCET: what it is, how to draw it and solved examples

GRAFCET explained: elements and rules, how to draw it step by step, three solved examples and the method to convert a GRAFCET into ladder logic.

By Miguel Ángel Muñoz, Director of Automation at i-mas 8 min read

GRAFCET: what it is, how to draw it and solved examples

GRAFCET is a diagram that describes, step by step, how a sequential machine behaves: what it does in each step and which condition moves it on to the next. It is standardised in IEC 60848 and is the bridge between the process description and the PLC program. Drawn well, the program almost writes itself.

In our industrial automation projects we use it before writing a single line of code: the client reviews it, the programmer reviews it and everyone talks about the same cycle. In this article we cover its elements, its rules, how to draw it and three solved examples.

What is GRAFCET and what is it used for?

GRAFCET comes from the French Graphe Fonctionnel de Commande Étape-Transition: a functional control chart built on steps and transitions. It was born in France in 1977 and became an international standard. Today it is the standard way to specify sequential control in Europe.

It does two jobs. First, specification: it puts in writing what the machine must do, without ambiguity, in a language both the process engineer and the programmer understand. Second, programming: each step becomes a PLC memory bit and each transition a condition. SFC in IEC 61131-3, the sequential function chart language for PLCs, is directly based on it.

Its advantage over writing the program straight in ladder is order. In a twenty-step sequence, unstructured ladder ends up full of cross interlocks nobody understands six months later. GRAFCET forces the machine to always be in a known state.

What are the elements of a GRAFCET?

There are only five elements. With them you can describe any sequence:

ElementHow it is drawnWhat it means
StepSquare with a numberA stable state of the machine
Initial stepDouble squareThe state the system starts in
ActionRectangle to the right of the stepWhat is done while the step is active
TransitionShort horizontal bar on the linkThe barrier between one step and the next
ReceptivityCondition written next to the transitionWhat must be true to clear the transition

Steps and transitions always alternate. There are never two steps in a row without a transition, nor two transitions without a step. Links are read top to bottom; if a link goes upwards, it carries an arrow.

Receptivities use the machine’s signals: a push button m, a limit switch a1, a timer t/3/5 s. They combine with Boolean logic: a1 · b0 means “a1 and b0”; a1 + b0, “a1 or b0”.

Which rules govern how a GRAFCET evolves?

The standard defines five rules. They are what make the diagram deterministic:

  1. Initial situation. At start-up, only the initial steps are active.
  2. Enabled transition. A transition can be cleared when all preceding steps are active and its receptivity is true.
  3. Clearing. When cleared, the following steps are activated and the preceding ones deactivated, at the same time.
  4. Simultaneous clearing. If several transitions can be cleared at once, they are all cleared at once.
  5. Activation priority. If a step must be activated and deactivated at the same time, it stays active.

Rule 2 prevents the most errors. A transition does not fire just because its condition is true: the previous step must also be active. That is why a limit switch triggered at the wrong moment does not move the machine on.

How do you draw a GRAFCET step by step?

Our method has five steps. It works the same for a two-cylinder table as for an assembly cell:

  1. List inputs and outputs. Push buttons, sensors, limit switches, solenoid valves, motors. Each with a short name.
  2. Write the cycle in words. One sentence per movement: “cylinder A extends”, “wait 2 seconds”, “cylinder A retracts”.
  3. One step per sentence. Each stable movement is a step; step 0 is the rest state.
  4. One transition between steps. Its receptivity is the sensor confirming the previous movement has finished.
  5. Close the cycle. The last transition goes back to the initial step.

Teaching practice also distinguishes three levels of detail. Level 1 describes the function in words (“clamp part”). Level 2 uses the real actuators and sensors (“A+”, “a1”). Level 3 uses PLC addresses (“Q0.1”, “I0.3”). For a client review, level 1; for programming, level 3.

How do you solve a GRAFCET? Three examples

Example 1: one cylinder, out and back

Pneumatic cylinder A extends when start button m is pressed and retracts by itself at the end of stroke. Sensors: a0 (cylinder retracted) and a1 (cylinder extended).

StepActionTransition to next
0 (initial)None (rest)m · a0
1A+ (cylinder extends)a1
2A− (cylinder retracts)a0 → back to 0

The condition m · a0 prevents the cycle from starting if the cylinder is not at rest. A small detail that, on the real machine, avoids a crash.

Example 2: A+ B+ A− B− sequence

Two cylinders: A clamps the part and B marks it. The cycle is A extends, B extends, A retracts, B retracts. Sensors a0, a1, b0, b1.

StepActionTransition to next
0 (initial)Restm · a0 · b0
1A+a1
2B+b1
3A−a0
4B−b0 → back to 0

Watch one detail: if B has to mark while the part is clamped, the logical order would be A+ B+ B− A−. GRAFCET does not fix a badly thought-out cycle; it only makes it visible. That is exactly why it is useful in the client review.

Example 3: OR divergence (two products)

A station processes two part numbers. Sensor p detects a long part. If it is long, a second hole is drilled; if not, that step is skipped.

StepActionTransition
0 (initial)Restm
1Drill 1end1 · p → step 2  |  end1 · /p → step 3
2Drill 2end2 → step 3
3Eject partejected → back to 0

The two receptivities of step 1 are mutually exclusive: p and /p (not p). If they were not, rule 4 would activate both branches at once. It is the most common mistake when drawing an OR divergence.

When two things must happen at the same time, for instance loading one part while another is machined, you use an AND divergence: one transition activates two parallel branches, drawn between double horizontal lines. Both branches wait for each other at the convergence before moving on.

How do you convert GRAFCET to ladder?

With a systematic method: each step is an internal PLC bit. For each step you write two conditions:

  • Activation (set): previous step active and receptivity true.
  • Deactivation (reset): next step active.

Then each output is driven by the step or steps where its action appears. In example 1, the A+ solenoid valve is driven by the step 1 bit. This splits the program in two: the sequence, which only moves bits, and the outputs, which only read them. If an action changes tomorrow, the sequence stays untouched.

Many PLCs let you program in SFC directly, without going through ladder. It is convenient, but it pays to master the manual translation: it is what is used on simple devices such as programmable relays, and what lets you debug when something fails.

What are the usual mistakes when making a GRAFCET?

  • Forgetting stops. The normal cycle is clear; emergency stop and reset are not. They are handled with a safety GRAFCET that overrides the production one.
  • Receptivities that confirm nothing. Moving on by time instead of by sensor works on the test bench and fails on the shop floor.
  • A step with too many actions. If a step moves three actuators, it is usually three steps.
  • Not reviewing it with whoever knows the process. GRAFCET is cheap to change on paper and expensive to change on the machine.

That last point links to something we see often: many of the reasons automation projects fail would have shown up in a good specification. And that specification starts with understanding the process, which is what a process audit before automating does.

Frequently asked questions about GRAFCET

How is a GRAFCET represented?

With steps (numbered squares, the initial one doubled), transitions (horizontal bars), receptivities (conditions next to each transition) and actions (rectangles to the right of each step), joined by links read top to bottom.

How do you go from GRAFCET to ladder?

Each step becomes an internal bit with an activation condition (previous step and receptivity) and a deactivation condition (next step). Outputs are then driven by the bits of the steps where their actions appear.

Which software can you use to draw a GRAFCET?

PLC programming environments usually include an SFC editor. For documentation, any diagram editor will do, and there are simulators designed for teaching.

How do you handle a reset with GRAFCET?

With a safety GRAFCET that has authority over the production one. On an emergency it forces production into a safe situation; the reset returns it to the initial step once the machine is at rest.

What is the difference between GRAFCET and SFC?

GRAFCET (IEC 60848) is a specification language. SFC (IEC 61131-3) is a PLC programming language based on it. The notation is almost the same.

Have a machine to automate?

If you are thinking of automating a process or a machine, tell us about your project. We start by understanding the cycle, put it in writing and program it on a specification the whole team has reviewed. To see an automatic machine end to end, our Toque de Ingenio episode on Awayter’s automated canteen tells the story with its creators.