Malian 2007
Malian 2007
7
$XWRPDWLRQ-XO\$WKHQV*UHHFH
Abstract— In this paper, we review aspects relevant to The study of these works offers a clear perspective of the
industrial standards related to PLC programming: IEC programming methodology that the standard draws. Cur-
61131, IEC 61499 and a work about safety developed by the rently, the IEC 61131 has been successfully introduced in
PLCOpen organization based on IEC 61508. We propose to
use these standards in PLC learning to fix a common know- the industry. Many commercial tools are compliant or, at
how that allows one to reduce the gap between industry and least, include their main concepts. Nevertheless, several
education, and between different professionals. We show the studies show that the languages and the execution model,
application scope of these standards by analyzing the IEC defined in the standard, are incomplete. Because of this,
61131 limits. The IEC 61499 can be introduced in distributed frameworks usually define additional language elements
control systems and in complex centralized systems with
multiple operating modes. In critical applications, like safety or characteristic, and non-compliant program execution
functions, where functional safety is required, the IEC 61508 models [6] [7].
is a reference model. In section II, we analyze the main concepts of IEC
61131-3 standard. In certain applications, special relia-
I. I NTRODUCTION bility and availability are required for long periods of
In PLC programming, there is a gap between industry time (e.g. safety in process and machinery). Programming
and education that has been increasing, especially in the restrictions and different methodologies are necessary to
last few years. We identify two main reasons. Tradition- achieve that [8] [9] . IEC 61508 standard introduces the
ally, automation control systems have been developed main concepts on functional safety, recommendations and
by engineers or technicians. Their know-how, design methods for programmable electronic devices in safety
methodology and working procedures are compiled into applications. In the section III, we present a work done
standards. But usually, these standards are quite complex by PLCOpen organization to adapt IEC 61131-3 to IEC
to be introduced in education because they are written to 61508 recommendations.
transmit clear information to experts, not to teach to non- The application of the IEC 61131 also has limitations.
experienced students. The second reason is the increasing The study of these limitations allows us to introduce the
use and the integration, of programmable electronic sys- standard IEC 61499. This new standard is better suited
tems (PES) and computers in all the levels of the automa- to program decentralized control with highly-coupled
tion hierarchy: sensor/actuator level, supervisory level and applications distributed on several devices [14] [15] .
the company management tools (databases, information It is also adequate when the process and the controller
systems, decision tools, etc). Due to the introduction of have multiple operation modes and operating states. A
communications technologies and new programming con- comparative study of both is presented in section IV.
cepts with PES, professionals from computer science have
started working with industrial PES. Their methodology II. T HE IEC 61131-3 MAIN CONCEPTS
and their knowledge about industrial processes are quite The IEC 61131 part 3 defines a software model for
different from traditional engineers and conversely. There industrial controllers based on a clear set of definitions
is a mutual misunderstanding. about what is a program, how to construct one, and how
The IEC 61131 standard was a first attempt to give the program interacts with the host machine and with
a reference model for industrial PES. It was defined another program. The model consists of:
in 1993 and released in 2003. It unifies concepts and • High-level elements: Configurations, Resources and
proposes a common standardized programming interface Tasks. They describe the overall architecture of a
to allow people with different backgrounds to create program resident in a programmable controller.
different pieces of a program that can be joined to work
• Program Organization Units - POU’s. They are basic
together correctly. The standard also defines a set of
programming languages and includes an easy way to code containers. A program is structured in one or
apply new technologies like communication protocols and more POU’s.
fuzzy-logic [1][2][3]. The PLCOpen association is work- • Variables and Data Types.
ing to update and promote the IEC-61131 standard. Their The standard defines basic hardware-independent data
working groups have developed much material to better types. The size and the arithmetic are strictly declared.
understand and teach the standard [4] [5]. They have also Consequently, many errors, caused when a program is
been developing recommendations and solutions to many compiled in different platforms, can be avoided. From
industrial problems such as safety and motion control. basic types, programmers can define derived data types,
;,(((
0HGLWHUUDQHDQ&RQIHUHQFHRQ&RQWURODQG
7
$XWRPDWLRQ-XO\$WKHQV*UHHFH
0 0
example. Another is a computer running a Soft-PLC.
A soft-PLC is a specialized software able to run IEC
CODE programs. Nowadays, this technology is being applied
1 more and more frequently. A Resource is a real o virtual
1
machine where the programs are executed. Each CPU
STATIC DATA
in a PLC is a resource. A configuration can contain
one or more resources. Global user variables can be
Fig. 1. Function Block elements. defined in the resource or a configuration level, and this
0HGLWHUUDQHDQ&RQIHUHQFHRQ&RQWURODQG
7
$XWRPDWLRQ-XO\$WKHQV*UHHFH
CONFIGURATION
RESOURCE RESOURCE S1
S1 S2 S3
PROGRAM PROGRAM PROGRAM PROGRAM
FB FB FB FB S4 S5
S2 S3
ACCESS PATHS
COMMUNICATION FUNCTION (SEE IEC 1131-5) Fig. 5. Unsafe and impossible SFC’s
Funct iona l GE
Validation/ Validation/
certification certification
• Using applicable programming guidelines.
• Using recognized error-reducing measures for the
lifecycle of the safety-related software. Fig. 7. Safety applications programming procedure
hardware structure: 1oo1 (”1 out of 1”), 1002D, 2oo2 as ”error reset”, restoring the initial state, or as a
or 2oo3. The hardware which executes the FBs with ”manual reset” of a restart interlock by the operator.
0HGLWHUUDQHDQ&RQIHUHQFHRQ&RQWURODQG
7
$XWRPDWLRQ-XO\$WKHQV*UHHFH
Activate D2
Diagnosis and D3
TRIGat Reset 0 Production
1 teatment of
with faliures F6
0 Init 1 Errors faliures Operating
8001 Bxxx Test
3
2 D1
0 NOT Activate Emergency Stop
1 1 On error D - DE FECT
0 StateX
8xxx 2 3 S_Inputx value
S_Out = FLASE
Fig. 9. The GEMMA guide.
S_Out = TRUE
0 Idle 1 GEMMA
0000
SCHEDULER
F4_EN
Fig. 8. Interface and behavior of the base SRFB. A6_EN
F4-Manual mode
EN
E128.0 ON
• S Inputs (process specific variables). E128.1 OFF PUMB1 A128.0
PUMB2 A128.1
E128.2
• A Ready output indicates if the FB is activated and /TE
/TE
• The DiagCode is very useful for debugging. It repre- E200.0
PUMB1
PUMB2
A200.0
sents all the states (active, not active and error states). E200.1 Temp
Heater A200.1
Following this model, PLC Open has developed a
library composed of 20 SFRB’s (e.g. emergency stop, safe Fig. 10. GEMMA implementation example.
stop category 1 and 2, mode selector, two hand control,
sequential and parallel muting, etc)
sophisticated synchronization methods than IEC 61131-
IV. T HE LIMITS OF THE IEC 61131-3 PROGRAMMING 3 defines. E.g., in contrast with the Send/Receive func-
MODEL AS AN INTRODUCTION TO IEC 61499 tions or Networked Variables, the IEC 61499 offers Pub-
STANDARD PROGRAMMING lisher/Subscriber and Client/Server services.
In complex controllers, the IEC 611313 model presents On the other hand, along its operational life, a machine
applicability problems derived from overall architecture or a process can be placed in many different operating
model misconceptions, and FB specifications. A con- modes and states. A very popular design reference to
trolled system with a high number of control points (I/O define them is GEMMA (Guide d’Etude des Modes
channel) does not carry to a complex controller necessar- de Marches et d’Arrts) (fig. 9). GEMMA is a general
ily. In this paper, we refer to controller complexity as a schedule that describes the process with up to 16 states.
functional complexity. Two aspects contribute to increase Engineers have to decide which states are present or not.
this functional complexity: Each state is a different automation problem and describes
the process in a specific situation. For example: F1- is the
• Multiple operation modes or running states of the normal production mode. F4 represents a manual mode,
process and the controllers. where some elements can be controlled by an operator’s
• The use of distributed control systems in highly- orders, A6 state signals a set of sequentially ordered
coupled applications. operations for restarting the process, etc.
The IEC 61131-3 describes a centralized, or ”multi- Following the traditional structuring methodology, and
centralized”, architecture, i.e. a control system composed IEC 61131-3 FB’s, each state will be programmed with
by several configurations running different applications a different FB. A scheduler FB will call the right FB
each one, but in a coordinated way. In the opposite, depending on the operating process state. This can be
IEC 61499 proposes applications hosted and running in done by using the EN input of FB’s (Fig 10), or using
several devices. Obviously, Function Blocks running in actions in an SFC main program.
different devices, within a distributed application, have When an FB is deactivated it is not executed and stores
to be strongly coupled, so it is required to have more the process state. When the block is activated again, the
0HGLWHUUDQHDQ&RQIHUHQFHRQ&RQWURODQG
7
$XWRPDWLRQ-XO\$WKHQV*UHHFH