state diagrams. The obtained models allow a formal
description of the behavior, thus avoiding the ambi-
guities that a textual description can induce. In this
work, Grafcet diagrams, defined in the IEC 60848
(IEC, 2002), which are state-transition diagrams well-
known in the automation field, will be used to model
the behavior of discrete event control systems.
Grafcet diagrams and SFC language of standard
IEC 61131 are similar since both have the step-
transition concepts at its base. This makes the imple-
mentation of discrete event controller in SFC easier
to read and understand compared with implementa-
tions of controllers in other languages of the standard.
Thus, the usage of SFC results in a more maintain-
able code. Furthermore, due to the similarities be-
tween Gafcets and SFC, the formal description of the
controller behavior in Grafcet models can be easily
obtained from the SFC code, even if it is modified.
The aim of this work is to show that modular de-
sign enables for a modular implementation, enhanc-
ing the capability of the software to be distributed
across fieldbus devices, maintaining the structural hi-
erarchy of the Grafcet model. The translation step
from the model to the implementation is out of the
scope of the work since it has been detailed in the
literature (Julius et al., 2017; Schumacher and Fay,
2014). However, the usage of SFC for implementing
structuring mechanisms will be also explored. Be-
sides, aspects like readability and maintainability will
be shown to be enhanced through SFC implementa-
tion from GRAFCET diagram.
The structure of the work is as follows. In Sec-
tion 2 some preliminary discussion is made with
regard to the modeling and implementation of dis-
tributed automation software. In Section 3 the pro-
cedure for the design and implementation of the soft-
ware is explained. Section 4 presents the platform
used for validating the results, together with the mod-
eling and implementation details. Finally, in Section 5
de conclusions about this work are drawn.
2 PRELIMINARY NOTES
2.1 Modeling
Among the different modeling techniques available,
Grafcet diagrams, defined in the standard IEC 60848,
are a well-known tool in the field of control engi-
neering since this kind of diagrams form part of the
contents studied in higher education and technical
schools of the automation branch.
This modeling language allows the designer to de-
fine the general behavior of an automation system
regardless of the particular implementation details,
leaving their definition for subsequent and more de-
tailed design rounds or directly for the implementa-
tion.
Grafcet diagrams allow defining the detailed be-
havior of discrete event systems through a modular
and hierarchical design. This is accomplished, in part,
because of the language elements, which cover most
of the possible situations that can be found in actual
applications. Besides, the user has the possibility of
modeling the functioning of a whole system through
different partial Grafcet diagrams, enabling a modular
design.
To coordinate the different partial Grafcets that
can result from the design process, the norm provides
some mechanisms for hierarchically structuring the
functioning. In particular, the modeling mechanisms
are enclosures, macro-steps and forcing orders. The
particularities and rules concerning these mechanisms
are defined in the norm, and will not be further dis-
cussed. In this work, forcing orders will be used as
structuring mechanism since they enable for a hierar-
chical design.
It is worth noticing that these principles of mod-
ular design, hierarchy and abstraction in the behavior
definition, are not tied to a given physical device. In
this sense, there is not any hindrance to use Grafcet
diagrams for modeling distributed automation appli-
cations.
2.2 Implementation
The standard IEC 61131 in its third part offers five
programming language for implementing automation
software, each of them with their own properties
which make them more suitable than another lan-
guage for a given task.
In (Bonfatti et al., 1997), a discussion about the
roles of the language in IEC 61131 was provided.
SFC was highlighted as the most suitable to sup-
port the initial phases of PLC software development.
Several characteristics that endorsed SFC were men-
tioned: 1) High expressive power, 2) Graphic formal-
ism, 3) Support to preliminary design, 4) Support to
detailed design, 5) Natural connection with other lan-
guages and 6) Support to software fragmentation.
Due to these characteristics, SFC is recommended
for early design and to structure any application, leav-
ing the remaining languages to auxiliary tasks as
further specifying or implementing specific parts of
code. According to this, a hierarchy was defined in
(Bonfatti et al., 1997) between the IEC 61131 lan-
guages, regarding to their capabilities in different cod-
ing phases and to their level, which is presented in
ICINCO 2023 - 20th International Conference on Informatics in Control, Automation and Robotics
136