fbpx

SFC Programming for Beginners

Learn about a PLC programming language called Sequential Function Chart.

In this article, we’ll introduce you to a PLC programming language called Sequential Function Chart, or SFC for short.

The PLC programming standard IEC 61131-3 includes five programming languages:

Ladder Diagram

Function Block Diagram

Instruction List

Structured Text

– Sequential Function Chart

PLC programming standard IEC 61131-3 programming languages

The SFC programming language is different compared to the four other languages. The SFC is used to program a sequence directly in the PLC.

What is a sequence in SFC?

A sequence is a step-by-step operation that should be used to perform a task. An example of a sequence can be a part painting process.

1) The first step is placing the part that needs to be painted in the machine.

2) And next step is the first coat of paint.

3) The next step is drying.

4) And the last step is the final coat of paint.

Painting process sequence

Now we will introduce you to SFC programming. An SFC makes it easy to program the sequence directly in the PLC.

An SFC program is composed of graphic symbols. Each graphic symbol represents one step. A step is the same as a state.

Init step

The first graphic symbol is used for initialization. This is named the init step. This is a square that is double-lined.

Inside the square is a step name. The step name Step_1 is used to identify each step and this must be a unique name in your program.

When the PLC turns on the program will go into the initialization step and stay there.

Step or State

A Step is a single-lined square. The step shown is named Step_10.

Init step Vs Step

Transition

Each step is connected to the next step by a connection line. And a small horizontal line is added and this is called the transition. At the transition line, there must be a condition.

Where B1 is a Boolean variable there can be TRUE or FALSE. When B1 is changed from FALSE to TRUE the program state changes from Step_10 to Step20.

SFC transitions and Conditions

The transition can also be a logic. When AND is added between B1 and B2, both B1 and B2 must be TRUE to change from Step_10 to Step20.

SFC Logical Conditions - AND

Another commonly used transition is the Delay transition. In SFC, a delay is a part of the step box, and therefore easy to use.

In the transition space, first, enter the step name followed by a dot. After the dot, enter t and then >. Then enter the delay time. Enter t# indicating that the format is time, Finally, enter the delay time. In our example, we have entered 2, meaning 2 seconds.

Delay transition

Action and Qualifiers

An action can be added to a step if required. A line connects the Step to the Action.

Inside the action box is a qualifier letter N that indicates what to do with the VarName or variable name. The VarName is a Boolean variable.

An N qualifier means that the variable VarName is TRUE only when the step is active. Therefore you don’t need to set VarName to FALSE when leaving the Step_10 action.

Let’s look at 2 other important qualifiers to know.

When using S as a qualifier, a TRUE will be stored for VarName inside the memory. This is used to keep the VarName TRUE when leaving the step.

If you need to reset the stored VarName value, you can use R as a qualifier.

SFC Actions - “R” qualifier

There are many other qualifiers and they will be explained in another article.

SFC example

Let’s look at an SFC example. We want a lamp to flash at 2 seconds interval.

To program the SFC we start with the init step.

We need to add two steps. The sequence includes one step for the lamp to turn on, and another step for the lamp to turn off.

Flashing Lamp using SFC

There is always a transition between each step. If a condition always is full fit just enter TRUE as shown between Init and Step1. When right after entering Init step the program will go to Step1.

The program needs to be repeated, because of the continuous flashing. Draw a line from Step 2 to the end before step 1.

The lamp needs to flash at 2 seconds intervals. Therefore, a time delay of 2 seconds between the steps is needed. The on-time and the off-time are the same therefore same delay time is used.

Then the action to control the lamp is to be added. The qualifier letter N is used because the lamp must be turned on only in Step1. The lamp turns automatically off when leaving Step1 when using the qualifier letter N.

No action is needed for Step2 because the lamp is turned off when entering step 2.

SFC Example for Flashing Lamp - N qualifier

The variable name or TAG name is Lamp and is assigned to the output module where the physical lamp is wired.

Another solution for implementing a flashing lamp is to use the qualifier S to turn the lamp on and the qualifier R to turn the lamp off.

SFC Example for Flashing Lamp - S and R qualifiers

Summary

In this article, you learned the basic graphic symbols used in SFC.

We have:

– Init step

– Step (or State)

– Transition

– Action

– Qualifiers

If you have any questions about the Sequential Function Chart programming language or about programming languages in general, add them in the comments below and we will get back to you in less than 24 hours.

Got a friend, client, or colleague who could use some of this information? Please share this article.

Tom Mejer Antonsen

Tom Mejer Antonsen

Automation Engineer

Posted on Sep 5th, 2022

Tom Mejer Antonsen

Tom Mejer Antonsen

Automation Engineer

Posted on Sep 5th, 2022

5 Actionable Tips for Getting a PLC Programming Job with NO Experience

5 Actionable Tips for Getting a PLC Programming Job with NO Experience

In this blog post, you’ll learn about the mindset that helped me getting a PLC programming job with NO experience. This is my personal experience as someone who searched for a job in this field and as an employer who reviews resumes and interviews candidates for a variety of projects. So let’s get started!

Laser Sensor Explained | Types and Working Principles

Laser Sensor Explained | Types and Working Principles

In this article, I will be talking about laser sensors. I will explain what laser sensors are, the basics of how they work, the different types of laser sensors, and I will give some examples of how laser sensors are used with automation.What is a laser sensor?A laser...

u-remote – Remote I/O System Modernization with Weidmüller

u-remote – Remote I/O System Modernization with Weidmüller

In this case study, we will look at the value of modernizing remote I/O systems based on the experience of a leading industrial company specializing in the storage and distribution of bulk liquid products.To respect this company’s privacy, we will not use their name...

RealPars is the world's largest online learning platform for cutting-edge industrial technologies. 

Questions?
[email protected]
+31 10 316 6400
Mon - Fri  8:30 am to 5:30 pm (CET)

Rotterdam Science Tower,
Marconistraat 16,
3029AK Rotterdam, The Netherlands

COMPANY

About

Job openings

Privacy

Cookies

LEARN

Courses

Blog

Sign in

HELP

Contact Us

Help & Support

Refund & Cancellation Policy

© 2022 RealPars B.V. All rights reserved.

Created with coffee and tea in Rotterdam.