Professional Documents
Culture Documents
Abstract— Sequential function chart formalism is one of the 5 schemes and store them to XML files but also to check their
languages for PLC (programmable logic controller) syntax (validate them), compile them for the selected target
programming described in the IEC 61161-3 standard. Many and to visualize (monitor) the state development of the
PLC vendors integrate their own SFC editor implementation particular scheme in real-time. The editor is written in C#
as a part of their development environment. Absence of a using Microsoft .NET framework.
universal SFC editor lead to the authors own development.
This paper describes some of the features of the developed II. EDITOR ARCHITECTURE
universal SFC graphical editor, which includes: 1. editor
architecture; 2. graphical user interface; 3. SFC schema Almost overall logic of the SFC Editor can be divided to
validation and compilation to various targets; 4. editor the three basic categories. The first category contains classes
customization and integration to development tools of various related to the objects which are visible in the graphical user
control systems. REX uses the SFC editor in two ways: 1. a interface (GUI) and should be painted to the canvas. The
design tool for the ATMT, EATMT and REXLANG function second category contains classes responsible for handling a
blocks; 2. as an online visualization and debugging tool. chart validation and compilation processes. The last category
contains classes implementing a monitoring algorithm state
Keywords- Sequential Function Charts; SFC; IEC 61131-3; evolution of the particular chart. All these class categories
Grafcet; PLCopen; REX control system; object oriented are described in the next subsections in a more detail.
programming; OOP.
A. Graphics entites
I. INTRODUCTION Fig. 1 shows dependencies of the GUI classes. Every
shape drawn on the editor’s work canvas is inherited from
Sequential logic is usually a significant part of control the basic abstract class Shape. This class defines properties
algorithms. Even control algorithms of the regulatory type and functions common to all shapes, like shape size,
are very often equipped with a sequential logic e.g. for location, active bounds, etc. and also it defines abstract
switching of control modes and strategies, error handling, methods determining shapes appearance and behavior.
etc. Sequential logic in general can be inserted into control SFC formalism blocks are special cases of the drawn
algorithms by several ways. Very simple logic can be shapes. These blocks have typical properties like name,
programmed in some textual programming language (C, description, etc. Moreover, they have an extra functionality –
C++, structured text, etc.) directly. As the size of the logic handling blocks validation and compilation. The best way
increases, the code maintenance becomes more and more how to handle this functionality is to define another abstract
complicated and this approach is a very error prone. Hence, class Item inherited from the Shape class (Fig. 1). Note that
several graphical techniques for sequential logic design have object oriented programming (OOP) feature called
been developed. The sequential function chart (SFC) polymorphism has been extensively used.
technique (formerly also called Grafcet) is one of them. This
formalism is widely accepted by the automation community B. Validation and compilation logic
(vendors, users). Moreover, it is standardized by the IEC Polymorphism has been used also in classes responsible
61163-3 standard [1], which describes five languages for for validation and compilation of SFC charts, see Fig. 2. One
programmable logic controllers (PLC) algorithm abstract base class Build defines two abstract methods
development. Validate and Build. Those methods are overridden in
The authors needed a sequential function chart editor, particular classes which implements compilation and
which could be integrated to the REX control system [2] validation logic for the specific target device.
development environment RexDraw. Their effort to find
some open source standalone and smart SFC editor failed. Of C. Monitoring logic
course, there are many implementations of SFC editor SFC Editor cannot monitor the state development of the
integrated in commercial PLC development tools but they particular scheme itself. It must acquire the scheme state
could not be used for this purpose. This fact initiated the from some cooperating application e.g. using some
authors’ own work described in this paper. The developed communication protocol.
editor allows the user not only to create various SFC
Again, one abstract base class Monitor is used, which application and abstract methods responsible for handling
defines methods for reading states from a cooperating received data. Class diagram is shown in Fig. 3.
Figure 2. Class diagram of the build logic. Figure 3. Class diagram of the monitoring logic.