In this article, we’ll introduce you to a PLC programming language called Sequential Function Chart, or SFC for short.
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.
Here are the steps in 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.
Now Let’s see how we can implement these steps easily using 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.
The first graphic symbol is used for initialization. This is called 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.
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.
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.
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.
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.
There are many other qualifiers and they will be explained in another article.
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.
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.
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.
In this article, you learned the basic graphic symbols used in SFC.
– Init step
– Step (or State)
I Hope this article helped you learn some new skills to become a better PLC programmer.
Tom Mejer Antonsen
Posted on Sep 5th, 2022
Tom Mejer Antonsen
Posted on Sep 5th, 2022
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!
Programmable Logic Controllers (PLCs) have been the backbone of control systems for a long time. However, traditional PLCs have been known for their close architecture which results in limited flexibility in programming and also integrations with other systems. This...
To program a PLC, I need to write a program on my computer and download it to the PLC. To be able to write the program on my computer, I need programming software, right? I can not just open up my laptop and start writing codes. For example, to write code in C++ on my...
RealPars is the world's largest online learning platform for cutting-edge industrial technologies.
+31 10 316 6400
Mon - Fri 8:30 am to 5:30 pm (CET)
Rotterdam Science Tower,
3029AK Rotterdam, The Netherlands
Terms of Service
Help & Support
Refund & Cancellation Policy
© 2023 RealPars B.V. All rights reserved.
Created with coffee and tea in Rotterdam.