sfc2fbd 1
sfc2fbd 1
net/publication/335636516
CITATIONS READS
0 3,735
3 authors, including:
Grzegorz Filcek
Wroclaw University of Science and Technology
32 PUBLICATIONS 67 CITATIONS
SEE PROFILE
All content following this page was uploaded by Grzegorz Popek on 10 April 2020.
Abstract. This paper presents a method and a tool for converting Se-
quential Function Charts into Function Block Diagrams in a manner that
models states with the use of flip-flops. Order of evaluation is enforced
through the use of explicit delays. Presented approach can be used when
SFC programming is not directly available but the developer wants to
use advantages of SFC modeling such as robust analysis tools.
1 Introduction
to Petri nets. Additional modeling facilities are available through the application
of Timed Automata [13], Symbolic Model Verifiers [3] and others [2].
Typically, SFC is used in conjunction with supplementary languages defined
in IEC 61131-3 such as Structured Text (ST) or Function Block Diagram (FBD).
The more complex the supplementary constructs are, the less descriptive power
does the SFC itself have. To efficiently use the design and analysis tools limited
to SFCs, it is crucial to keep the charts as pure as possible. To accomplish that,
one should use SFC as the primary programming methodology and transform
it to other languages as necessary. However, direct SFC programming might be
unavailable on the given platform. A method for conversion to other languages is
then invaluable. This paper introduces a method of transforming SFC into FBD
and a software implementing it. The main idea of the method is to represent
states defined by SFC with the use of flip-flops and to enforce the order of
block evaluation with the use of explicit delays. Specific conversion methods are
provided for all the common structures defined within the SFC language.
The paper is divided into five sections. This introduction is followed by a
description of ST, FBD and SFC in the second section. Related works and mo-
tivation are presented shortly after. The transformation method is described in
the third section and the software in the fourth one. The paper is then concluded
in the final section.
V := A + (B * C) MOD 5;
W := A_FUNCTION(1, 2, 3) + V;
Fig. 2: Function Block Diagram example – binary output Q1 is set if A1 > A2 and an
RS flip-flop is set (input I1 sets, I2 resets)
merge them. If one enters a parallel block, all the states following the block are
executed concurrently.
In Fig. 4 we have a sample SFC with two states and three actions. Signal
Execute.X is the step flag, set only when the step is active. All the common
SFC structures are provided in Fig. 5 and they are the subject of conversion.
Without the delay, ambiguity can occur in situations when a block is simulta-
neously set and reset such as is the case when a convergence of sequences occurs
for two different branches of a simultaneous divergence (Fig. 6a). Explicit delays
are also necessary in some of the PLC programming software such as LOGO!
SoftComfort (single-cycle delaying flags needed for recursion).
IEC 6113-3 states that ”clearing time of a transition [...] cannot be zero”.
To reflect this ambiguity, in our transformations we also provide two methods
of dealing with self-loops (Fig. 6b): with or without enforcing resetting of action
controller timers. Finally, our approach removes the need for a synchronization
block. This takes out the need to modify the SFC diagram in simultaneous
convergence (esp. in simultaneous convergence with a sequence selection) and
permits the use of any outgoing transition condition.
Fig. 7: Action controller and the corresponding flip-flop for the Execute state in Fig. 4
ably by one cycle). Transition conditions and actions are given symbolically.
Flip-flops (RS) are named after the state they represent. Delay is given by δ.
Transformations of structures in Fig. 5 are shown in Fig. 8.
Fig. 8: FBD after conversion from SFC: a) sequence, b) divergence with mutual
exclusion, c) divergence with priority, d) convergence of sequences, e) simultaneous
divergence, f) simultaneous convergence, g) self-loop with timer reset
8 Maciej Hojda, Grzegorz Filcek, Grzegorz Popek
In the case of sequence, for each SFC state A and B a single flip-flop is created
RS(A) and RS(B) respectively. Action controllers a and b are connected directly
to flip-flops. Change of state occurs when both, RS(A) and X evaluate to truth,
then the delaying block δ is activated. After the delay, RS(A) is reset and RS(B)
is set. This concludes the change of state.
Divergence is converted with the use of one delay for every possible destina-
tion state. If RS(A) is set and either of the conditions X or Y is satisfied, then
the corresponding delay δ is activated. This, in turn, sets RS(B) or RS(C) and
resets RS(A). Divergence with priority ensures that transition to RS(B) executes
over transition to RS(C) if both transitions, X and Y are enabled. Convergence
to state C occurs when either RS(A) is set and X is enabled, or RS(B) is set and
Y is enabled.
Simultaneous divergence results in two enabled flip-flops. If RS(A) is set and
X is enabled then, after a short delay δ, RS(B) and RS(C) are set and RS(A) is
reset. Simultaneous convergence can only happen if all three: RS(A), RS(B) and
X are set.
Finally, we provide transformation conditions for a self-loop from Fig. 6b
when action controller timers require resetting. This is accomplished by using
two delays δ. First is used to reset RS(A) the second is used to set it again. For
a self-loop without timer reset, both delays are merged.
5 Conclusions
Ability to quickly perform conversions of SFC into FBD allows for more control
over programming of PLCs. Presented transformation methodology allows for
easy flow control, and analysis of a program under execution. On-the-fly ad-
justments can be performed in order to modify the controller operation or to
eliminate design mistakes. Presented methodology is accessible to future exten-
sions such as multi-network FBDs. Included example illustrates the ease of use
of presented conversion rules. Further works will focus on including other PLC
programming languages in the conversion methodology.
References
1. Alnaib A., Altaee O., Al-jawady N.: PLC Controlled Multiple Stepper Motor Us-
ing Various Excitation Methods. In: proceedings of ICETA, 2018 International
Conference on Engineering Technologies and their Applications, pp. 54–59 (2018).
2. Bauer, N., et al.: Verification of PLC Programs Given as Sequential Function
Charts. In: Ehrig H. et al. (eds) Integration of Software Specification Techniques
for Applications in Engineering. Lecture Notes in Computer Science, vol 3147, pp.
517-540. Springer, Berlin, Heidelberg (2004).
3. Bornot, S., et al.: Verication of sequential function charts using SMV. In: pro-
ceedings of PDPTA, 2000 International Conference on Parallel and Distributed
Processing Techniques and Applications, pp. 2987-2993 (2000).
4. Darvas D., Majzik I., Viñuela E.: PLC Program Translation for Verification Pur-
poses. Periodica Polytechnia Electrical Engineering and Computer Science, vol.
62(2), pp. 151–165 (2017).
5. Dideban, A., Mohsen, K., Alla H.: Implementation of Petri Nets Based Controller
using SFC. Control Engineering and Applied Informatics, vol. 13(4), pp. 82-92
(2011).
10 Maciej Hojda, Grzegorz Filcek, Grzegorz Popek
6. Fengyun H., Hao P., Ruifeng G.: Design of PLC Sequential Function Chart based
on IEC61131-3 standard. Applied Mechanics and Materials, vol. 325, pp. 1130-1134
(2013).
7. Fujino, K., et al.: Design and verification of the SFC program for sequential control.
Computers and Chemical Engineering, vol. 24, pp. 303-308 (2000).
8. International Electrotechnical Commision: IEC 61131-3 First edition. International
Standard. Programmable controllers – Part 3: Programming languages (1993).
http://www.iec.ch
9. International Electrotechnical Commision: IEC 61131-3 Edition 3.0. International
Standard. Programmable controllers – Part 3: Programming languages (2013).
http://www.iec.ch
10. Jarmuda T: A computer system for controlling temperature in a two-state mode
and by means of a PI controller in an “intelligent building”. Computer Applications
in Electrical Engineering, vol. 10, pp. 372–385 (2012).
11. Karl-Heinz, J., Tiegelkamp, M.: IEC 61131-3: Programming Industrial Automation
Systems. Springer, Berlin, Heidelberg (2001).
12. Kim H., Kwon W., Chang N.: Translation method for ladder diagram with applica-
tion to a manufacturing process. In proceedings of ICRA, 1999 IEEE International
Conference on Robotics and Automation, vol. 1, pp. 793-798 (1999).
13. L’Her, P. et al.: Proving sequential function chart programs using automata. LNCS,
vol. 1660, pp. 149-163 (1998).
14. Lopes V., Sousa M.: Algorithm and tool for LD to SFC conversion with state-space
method. In: proceedings of INDIN, 2017 IEEE 15th International Conference on
Industrial Informatics, pp. 565–570 (2017).
15. Mello, A., et al.: A Transcription Tool From Petri Net To Clp Programming Lan-
guages. ABCM Symposium Series in Mechatronics, vol. 5, pp. 781-790 (2012).
16. Peng, S., Zhou, M.: Design and Analysis of Sequential Function Charts Using
Sensor-Based Stage Petri Nets. In: proceedings of SMC, 2003 IEEE International
Conference on Systems, Man and Cybernetics. Conference Theme - System Secu-
rity and Assurance, pp. 4748-4753 (2003).
17. Sarac V.: Application of PLC Programming in Cost Efficient Industrial Process.
International Journal on Information Technologies & Security, vol. 1, pp. 69–78
(2016).
18. Tsukamoto T., Takahashi K.: Modeling of Elevator Control Logic Based on Mark
Flow Graph and Its Implementation on Programmable Logic Controller. In: pro-
ceedings of GCCE, 2014 IEEE 3rd Global Conference on Consumer Electronics,
pp. 599–600 (2014).
19. Wciślik M.: Programming of Sequential System in Ladder Diagram Language.
IFAC Proceedings Volumes, vol. 36(1), pp. 37-40 (2003).
20. Wciślik M., Suchenia K., askawski M.: Programming of sequential control systems
using functional block diagram language. IFAC-PapersOnLine, vol. 48(4), pp. 330-
335 (2015).