Programmable controllers - Part 8: Guidelines for the application and implementation of programming languages

applies to the programming of program-mable controller systems using the programming languages defined in IEC 61131-3. It also provides guidelines for the implementation of these languages in programmable controller systems and their programming support environments (PSEs).

General Information

Status
Published
Publication Date
28-Sep-2003
Current Stage
DELPUB - Deleted Publication
Start Date
22-Nov-2017
Completion Date
26-Oct-2025
Ref Project

Relations

Technical report
IEC TR 61131-8:2003 - Programmable controllers - Part 8: Guidelines for the application and implementation of programming languages Released:9/29/2003 Isbn:2831872103
English language
105 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


TECHNICAL IEC
REPORT
TR 61131-8
Second edition
2003-09
Programmable controllers –
Part 8:
Guidelines for the application and implementation
of programming languages
Automates programmables –
Partie 8:
Lignes directrices pour l'application et la mise en oeuvre
des langages de programmation
Reference number
IEC/TR 61131-8:2003(E)
Publication numbering
As from 1 January 1997 all IEC publications are issued with a designation in the

60000 series. For example, IEC 34-1 is now referred to as IEC 60034-1.

Consolidated editions
The IEC is now publishing consolidated versions of its publications. For example,

edition numbers 1.0, 1.1 and 1.2 refer, respectively, to the base publication, the

base publication incorporating amendment 1 and the base publication incorporating

amendments 1 and 2.
Further information on IEC publications
The technical content of IEC publications is kept under constant review by the IEC,
thus ensuring that the content reflects current technology. Information relating to
this publication, including its validity, is available in the IEC Catalogue of
publications (see below) in addition to new editions, amendments and corrigenda.
Information on the subjects under consideration and work in progress undertaken
by the technical committee which has prepared this publication, as well as the list
of publications issued, is also available from the following:
• IEC Web Site (www.iec.ch)
• Catalogue of IEC publications
The on-line catalogue on the IEC web site (www.iec.ch/searchpub) enables you to
search by a variety of criteria including text searches, technical committees
and date of publication. On-line information is also available on recently issued
publications, withdrawn and replaced publications, as well as corrigenda.
• IEC Just Published
This summary of recently issued publications (www.iec.ch/online_news/ justpub)
is also available by email. Please contact the Customer Service Centre (see
below) for further information.
• Customer Service Centre
If you have any questions regarding this publication or need further assistance,
please contact the Customer Service Centre:

Email: custserv@iec.ch
Tel: +41 22 919 02 11
Fax: +41 22 919 03 00
TECHNICAL IEC
REPORT
TR 61131-8
Second edition
2003-09
Programmable controllers –
Part 8:
Guidelines for the application and implementation
of programming languages
Automates programmables –
Partie 8:
Lignes directrices pour l'application et la mise en oeuvre
des langages de programmation
 IEC 2003  Copyright - all rights reserved
No part of this publication may be reproduced or utilized in any form or by any means, electronic or
mechanical, including photocopying and microfilm, without permission in writing from the publisher.
International Electrotechnical Commission, 3, rue de Varembé, PO Box 131, CH-1211 Geneva 20, Switzerland
Telephone: +41 22 919 02 11 Telefax: +41 22 919 03 00 E-mail: inmail@iec.ch  Web: www.iec.ch
PRICE CODE
Commission Electrotechnique Internationale XD
International Electrotechnical Commission
МеждународнаяЭлектротехническаяКомиссия
For price, see current catalogue

– 2 – TR 61131-8 © IEC:2003(E)

CONTENTS
FOREWORD .6

INTRODUCTION .8

1 General.9

1.1 Scope .9

1.2 Normative references .9

1.3 Abbreviated terms .9
1.4 Overview.10
2 Introduction to IEC 61131-3.10
2.1 General considerations.10
2.2 Overcoming historical limitations.12
2.3 Basic features in IEC 61131-3 .13
2.4 New features in the second edition of IEC 61131-3 .14
2.5 Software engineering considerations .14
2.5.1 Application of software engineering principles .14
2.5.2 Portability .17
3 Application guidelines.17
3.1 Use of data types .17
3.1.1 Type versus variable initialization.18
3.1.2 Use of enumerated and subrange types .18
3.1.3 Use of BCD data.19
3.1.4 Use of REAL data types .21
3.1.5 Use of character string data types.21
3.1.6 Use of time data types .22
3.1.7 Declaration and use of multi-element variables.22
3.1.8 Use of bit-string functions .23
3.1.9 Strongly typed assignment .24
3.2 Data passing .25
3.2.1 Global and external variables.25
3.2.2 In-out (VAR_IN_OUT) variables .26
3.2.3 Formal and non-formal invocations and argument lists .28

3.3 Use of function blocks .30
3.3.1 Function block types and instances .30
3.3.2 Scope of data within function blocks.31
3.3.3 Function block access and invocation .32
3.4 Differences between function block instances and functions.33
3.5 Use of indirectly referenced function block instances .33
3.5.1 Establishing an indirect function block instance reference .34
3.5.2 Access to indirectly referenced function block instances.35
3.5.3 Invocation of indirectly referenced function block instances .35
3.5.4 Recursion of indirectly referenced function block instances .38
3.5.5 Execution control of indirectly referenced function block instances .38
3.5.6 Use of indirectly referenced function block instances in functions .38
3.6 Recursion within programmable controller programming languages.39
3.7 Single and multiple invocation .39

TR 61131-8 © IEC:2003(E) – 3 –

3.8 Language specific features .40

3.8.1 Edge-triggered functionality .40

3.8.2 Use of EN/ENO in functions and function blocks.41

3.8.3 Use of non-IEC 61131-3 languages.42

3.9 Use of SFC elements.42

3.9.1 Action control.42

3.9.2 Boolean actions .44

3.9.3 Non-SFC actions .47

3.9.4 SFC actions.48

3.9.5 SFC function blocks .48
3.9.6 “Indicator” variables .49
3.10 Scheduling, concurrency, and synchronization mechanisms.50
3.10.1 Operating system issues .50
3.10.2 Task scheduling.51
3.10.3 Semaphores .52
3.10.4 Messaging .53
3.10.5 Time stamping .53
3.11 Communication facilities in ISO/IEC 9506/5 and IEC 61131-5 .54
3.11.1 Communication channels .54
3.11.2 Reading and writing variables .54
3.11.3 Communication function blocks .55
3.12 Deprecated programming practices.56
3.12.1 Global variables.56
3.12.2 Jumps in FBD language .56
3.12.3 Multiple invocations of function block instances in FBD .56
3.12.4 Coupling of SFC networks.56
3.12.5 Dynamic modification of task priorities .57
3.12.6 Execution control of function block instances by tasks.57
3.12.7 Incorrect use of WHILE and REPEAT constructs .57
3.13 Use of TRUNC and REAL_TO_INT functions .58
4 Implementation guidelines .58
4.1 Resource allocation.59
4.2 Implementation of data types .59
4.2.1 REAL and LREAL data types.59
4.2.2 Bit strings .59

4.2.3 Character strings .59
4.2.4 Time data types .60
4.2.5 Multi-element variables .60
4.3 Execution of functions and function blocks.60
4.3.1 Functions.60
4.3.2 Function blocks.61
4.4 Implementation of SFCs .62
4.4.1 General considerations .62
4.4.2 SFC evolution .62
4.5 Task scheduling .63
4.5.1 Classification of tasks .63
4.5.2 Task priorities.63

– 4 – TR 61131-8 © IEC:2003(E)

4.6 Error handling .64

4.6.1 Error-handling mechanisms.64

4.6.2 Run-time error-handling procedures .65

4.7 System interface .67

4.8 Compliance .67

4.8.1 Compliance statement .67

4.8.2 Controller instruction sets .68

4.8.3 Compliance testing .68

5 PSE requirements .68

5.1 User interface.68
5.2 Programming of programs, functions and function blocks .69
5.3 Application design and configuration.70
5.4 Separate compilation.70
5.5 Separation of interface and body .71
5.5.1 Invocation of a function from a programming unit.71
5.5.2 Declaration and invocation of a function block instance .72
5.6 Linking of configuration elements with programs .73
5.7 Library management.75
5.8 Analysis tools .75
5.8.1 Simulation and debugging.75
5.8.2 Performance estimation .76
5.8.3 Feedback loop analysis.76
5.8.4 SFC analysis .76
5.9 Documentation requirements .79
5.10 Security of data and programs .79
5.11 On-line facilities .79

Annex A (informative) Changes to IEC 61131-3, Second edition.80
Annex B (informative) Software quality measures.90
Annex C (informative) Relationships to other standards.92

INDEX .93

Bibliography .105

Figure 1 – A distributed application .11
Figure 2 – Stand-alone applications .11
Figure 3 – Cyclic or periodic scanning of a program .12
Figure 4 – Function block BCD_DIFF .20
Figure 5 – Function block SBCD_DIFFF.20
Figure 6 – ST example of time data type usage.22
Figure 7 – Example of declaration and use of “anonymous array types”.23
Figure 8 – Examples of VAR_IN_OUT usage.28
Figure 9 – Hiding of function block instances .32
Figure 10 – Graphical use of a function block name .35
Figure 11 – Access to an indirectly referenced function block instance .35

TR 61131-8 © IEC:2003(E) – 5 –

Figure 12 – Invocation of an indirectly referenced function block instance .37

Figure 13 – Timing of edge triggered functionality .40

Figure 14 – Execution control example.42

Figure 15 – Timing of Boolean actions .47

Figure 16 – Example of a programmed non-Boolean action .47

Figure 17 – Use of the pulse (P) qualifier .48

Figure 18 – An SFC function block.49

Figure 19 – Example of incorrect and allowed programming constructs .58

Figure 20 – Essential phases of POU creation .69
Figure 21 – Essential phases of application creation .70
Figure 22 – Separate compilation of functions and function blocks .70
Figure 23 – Compiling a program accessing external or directly represented variables .71
Figure 24 – Compiling a function that invokes another function.71
Figure 25 – Compiling a program containing local instances of function blocks .72
Figure 26 – Separate compilation example.73
Figure 27 – The configuration process .74
Figure 28 – Reduction steps .77
Figure 29 – Reduction of SFCs .78

Table 1 – IEC 61131-3 elements supporting encapsulation and hiding.15
Table 2 – Examples of textual invocations of functions and function blocks .29
Table 3 – Differences between multi-user and real-time systems.51
Table 4 – Recommended run-time error-handling mechanisms .64
Table A.1 – Changes in usage to achieve program compliance .89

– 6 – TR 61131-8 © IEC:2003(E)

INTERNATIONAL ELECTROTECHNICAL COMMISSION

____________
PROGRAMMABLE CONTROLLERS –
Part 8: Guidelines for the application

and implementation of programming languages

FOREWORD
1) The International Electrotechnical Commission (IEC) is a worldwide organization for standardization comprising
all national electrotechnical committees (IEC National Committees). The object of IEC is to promote
international co-operation on all questions concerning standardization in the electrical and electronic fields. To
this end and in addition to other activities, IEC publishes International Standards, Technical Specifications,
Technical Reports, and Guides (hereafter referred to as “IEC Publication(s)”). Their preparation is entrusted to
technical committees; any IEC National Committee interested in the subject dealt with may participate in this
preparatory work. International, governmental and non-governmental organizations liaising with the IEC also
participate in this preparation. IEC collaborates closely with the International Organization for Standardization
(ISO) in accordance with conditions determined by agreement between the two organizations.
2) The formal decisions or agreements of IEC on technical matters express, as nearly as possible, an
international consensus of opinion on the relevant subjects since each technical committee has representation
from all interested IEC National Committees.
3) IEC Publications have the form of recommendations for international use and are accepted by IEC National
Committees in that sense. While all reasonable efforts are made to ensure that the technical content of IEC
Publications is accurate, IEC cannot be held responsible for the way in which they are used or for any
misinterpretation by any end user.
4) In order to promote international uniformity, IEC National Committees undertake to apply IEC Publications
transparently to the maximum extent possible in their national and regional publications. Any divergence
between any IEC Publication and the corresponding national or regional publication shall be clearly indicated in
the latter.
5) IEC provides no marking procedure to indicate its approval and cannot be rendered responsible for any
equipment declared to be in conformity with an IEC Publication.
6) All users should ensure that they have the latest edition of this publication.
7) No liability shall attach to IEC or its directors, employees, servants or agents including individual experts and
members of its technical committees and IEC National Committees for any personal injury, property damage or
other damage of any nature whatsoever, whether direct or indirect, or for costs (including legal fees) and
expenses arising out of the publication, use of, or reliance upon, this IEC Publication or any other IEC
Publications.
8) Attention is drawn to the Normative references cited in this publication. Use of the referenced publications is
indispensable for the correct application of this publication.
9) Attention is drawn to the possibility that some of the elements of this IEC Publication may be the subject of
patent rights. IEC shall not be held responsible for identifying any or all such patent rights.
The main task of IEC technical committees is to prepare International Standards. However, a

technical committee may propose the publication of a technical report when it has collected
data of a different kind from that which is normally published as an International Standard, for
example “state of the art”.
IEC 61131-8, which is a technical report, has been prepared by subcommittee 65B: Devices,
of IEC technical committee 65: Industrial-process measurement and control.
This second edition cancels and replaces the first edition, published in 2000, and constitutes
a technical revision.
The main changes with respect to the previous edition are to make IEC 61131-8 consistent
with IEC 61131-3, 2nd edition.

TR 61131-8 © IEC:2003(E) – 7 –

The text of this technical report is based on the following documents:

Enquiry draft Report on voting

65B/478/DTR 65B/492/RVC
Full information on the voting for the approval of this technical report can be found in the

report on voting indicated in the above table.

This publication has been drafted in accordance with the ISO/IEC Directives, Part 2.

The committee has decided that the contents of this publication will remain unchanged until
2008. At this date, the publication will be
• reconfirmed;
• withdrawn;
• replaced by a revised edition, or
• amended.
A bilingual version of this publication may be issued at a later date.

– 8 – TR 61131-8 © IEC:2003(E)

INTRODUCTION
This part of IEC 61131 is being issued as a technical report in order to provide guidelines for

the implementation and application of the programming languages defined in IEC 61131-3:

2003, second edition.
Its contents answer a number of frequently asked questions about the intended application

and implementation of the normative provisions of IEC 61131-3, second edition and about its

differences from IEC 61131-3:1993, first edition.

TR 61131-8 © IEC:2003(E) – 9 –

PROGRAMMABLE CONTROLLERS –
Part 8: Guidelines for the application

and implementation of programming languages

1 General
1.1 Scope
This part of IEC 61131, which is a technical report, applies to the programming of program-
mable controller systems using the programming languages defined in IEC 61131-3. It also
provides guidelines for the implementation of these languages in programmable controller
systems and their programming support environments (PSEs).
IEC 61131-4 should be consulted for other aspects of the application of programmable
controller systems.
NOTE Neither IEC 61131-3 nor this technical report explicitly addresses safety issues of programmable controller
systems or their associated software. The various parts of IEC 61508 should be consulted for such considerations.
1.2 Normative references
The following referenced documents are indispensable for the application of this document.
For dated references, only the edition cited applies. For undated references, the latest edition
of the referenced document (including any amendments) applies.
IEC 61131-1:1992, Programmable controllers – Part 1: General information
IEC 61131-2:2003, Programmable controllers – Part 2: Equipment requirements and tests
IEC 61131-3:2003, Programmable controllers – Part 3: Programming languages
IEC 61131-5:2000, Programmable controllers – Part 5: Communications
1.3 Abbreviated terms
FB Function Block
FBD Function Block Diagram
LD Ladder Diagram
IL Instruction List
POU Program Organization Unit
PSE Programming Support Environment
SFC Sequential Function Chart
ST Structured Text
– 10 – TR 61131-8 © IEC:2003(E)

1.4 Overview
The intended audience for this technical report consists of

– users of programmable controller systems as defined in IEC 61131-3, who must program,
configure, install and maintain programmable controllers as part of industrial-process
measurement and control systems; and

– implementors of programming languages, as defined in IEC 61131-3, for programmable

controller systems. This may include vendors of software and hardware for the
preparation and maintenance of programs for these systems, as well as vendors of the
programmable controller systems themselves.

IEC 61131-3 is mainly oriented toward the implementors of programming languages for
programmable controllers. Users who wish a general introduction to these languages and
their application should consult any of several generally available textbooks on this subject.
Subclause 1.4 of IEC 61131-3 should be consulted by those who wish a “top-down” overview
of the contents of that standard.
Clause 2 of this technical report provides a general introduction to IEC 61131-3, while Clause
3 provides complementary information about the application of some of the programming
language elements specified in IEC 61131-3. Clause 4 provides information about the
intended implementation of some of these programming language elements, while Clause 5
provides general information about requirements for hardware and software for program
development and maintenance. Hence, it is expected that users of programmable controllers
will find Clauses 2 and 3 of this technical report most useful, while programming language
implementors will find Clauses 4 and 5 more useful, referring to the background material in
Clauses 2 and 3 as necessary.
2 Introduction to IEC 61131-3
2.1 General considerations
In the past, the limited capabilities of expensive hardware components imposed severe
constraints on the design process for industrial-process control, measurement and
automation systems. Software design and implementation were tightly tailored to the selected
hardware. This required specialists who were highly skilled, both in solving process
automation problems and in dealing with complicated, often hardware-specific computer
programming constructs.
With the rapid innovation in microelectronics and related technologies, the cost/performance
ratio of system hardware has decreased dramatically. At present, a small programmable
controller may cost many times less than the cost of programming it.

Driven by rapidly decreasing hardware cost, a trend has become established of replacing
large, centrally installed process computers or other comparatively large, isolated controllers
by systems with spatially and functionally distributed parts.
As illustrated in Figure 1, the essential backbone of such systems is the communication
subsystem, which provides the mechanism for information exchange between the distributed
automating devices. Connected to this backbone are the devices, such as programmable
controllers, which deliver the distributed processing power of the system. Each device, under
the control of its own software, performs a dedicated subtask to achieve the required overall
system functionality. Each device is chosen with the size and performance required to meet
the demands of its particular subtask.
In a different environment, programmable controllers are used in stand-alone applications as
illustrated in Figure 2. Users of these applications also stand to gain by the evolution outlined
above. Due to the present low cost of hardware components, many new, relatively small,
automation tasks can be solved profitably and flexibly by programmable controllers.

TR 61131-8 © IEC:2003(E) – 11 –

Operating
monitoring
Communication subsystem
I
I I I
O
Loop Logic Mixed
O O O
control control control
Automated process
IEC  2060/03
Figure 1 – A distributed application
Operating Operating
monitoring monitoring
I
I I
O
Logic Mixed
O O
control control
Press Pump
IEC  2061/03
Figure 2 – Stand-alone applications

In addition to their low hardware price, the intensive use of programmable controllers in
solving automation tasks is also advanced by their straightforward operating and
programming principles, which are easily understood and applied by the shop-floor personnel
involved in programming, operation and maintenance.
Programmable controllers typically employ the principles of cyclic or periodic program
execution illustrated in Figure 3. Cyclically running programs restart execution as fast as
possible after they have terminated execution. Periodic execution of a program is triggered
by a clock mechanism at equidistant points in time.
These principles are well known and applied in the operation of digital signal processing
systems to simulate the operation of continuously operating analog or electromechanical
systems. Process values are read into the device and written out to the process as discrete
samples at random or equidistant points in time, depending on the control task that has to be
fulfilled.
– 12 – TR 61131-8 © IEC:2003(E)

The advantage of these operating principles is that they allow the construction of programs

for programmable controllers using elements closely related to the principles of hard-wired

logic or continuous control circuits previously used for the same purpose.

The operating principles of programmable controllers thus enable the provision of application-

specific, graphical programming languages. Combined with appropriate man-machine inter-

faces, these languages enable the control engineer to concentrate on solving the problems of

the application, without extensive training in software engineering. The control engineer’s

technological specifications can be mapped direct to the corresponding language elements.

Another particular advantage of such programming languages is that the representation they

offer can be used not only for program input and documentation, but also for on-line test and
diagnosis as well. Thus, programming support environments (PSEs) for programmable
controllers are able to provide the graphically oriented representation and documentation that
are already familiar to the application engineer and shop-floor personnel.
Clock trigger:
e.g. every 80 ms
Read Read
Cyclic Periodic
inputs inputs
execution execution
OR
Execute Execute
algorithms algorithms
Write Write
outputs outputs
IEC  2062/03
Figure 3 – Cyclic or periodic scanning of a program
2.2 Overcoming historical limitations
Automation system designers are often required to use programmable controllers from
various manufacturers in different automation systems, or even in the same system.

However, the hardware of programmable controllers from different manufacturers may have
very little in common. In the past, this has resulted in significant differences in the elements
and methods of programming the software as well. This has led to the development of
manufacturer-specific programming and debugging tools, which generally carried very
specialized software for programming, testing and maintaining particular controller “families”.
Changing from one controller family to another often required the designer to read large
manuals for both the hardware and software of the new family. Often, the manual had to be
reviewed several times in order to understand the exact meaning and to use the new
controller family in an appropriate way. Due to the concentrated, tedious work necessary to
read and understand the new, vendor-specific material, few people did it. For this reason,
many people regarded the design and the programming of such controllers as some black
magic to be avoided. Thus, the knowledge of how to use such systems effectively was
concentrated in one or a few specialists and could not be transferred effectively to those
responsible for system operation, maintenance, and upgrade.

TR 61131-8 © IEC:2003(E) – 13 –

A major goal of IEC 61131-3 was to remove such barriers to the understanding and

application of programmable controllers. Thus, IEC 61131-3 introduced numerous facilities to

support the advantages of programmable controllers described in 2.1, even if controllers of

different vendors are concerned. It has turned out that the resulting expansion of the

application domains of programmable controllers, and the increasing demand of customers

fed through this expansion, stimulated a lot of vendors to make their programming systems

compliant to the standard.
Vendor and user organizations like PLCopen accelerated this process by promoting the

benefits and advantages of standardizing PLC programming to a large extent.

2.3 Basic features in IEC 61131-3
From the point of view of the application engineer and the control systems configurator, the
most important features introduced by IEC 61131-3 can be summarized as follows.
a) Well-structured, “top-down” or “bottom-up” program development is facilitated by
language constructs for the definition of typed functional objects (program organization
units) such as functions, function blocks and programs.
b) Strong data typing is not only supported but inherently required, thus eliminating a major
source of programming errors.
c) A sufficient set of features for the execution control of program organization units is
included; those features associated with steps, transitions and action blocks offer
excellent means to represent complicated sequential control solutions in a concise form.
d) The necessary functionalities for designing the communication between application
programs are provided. Independent of the mapping of programs onto a single device or
different devices, identical communication features can be used between two programs.
This facilitates the reuse of software in different environments.
e) Two graphical languages and two textual languages may be chosen by the designer,
according to the requirements of the application. These languages, plus a set of textual
and graphical common elements, support software design methodologies based on well-
understood models.
1) The graphical Ladder Diagram (LD) language models networks of simultaneously
functioning electromechanical elements such as relay contacts and coils, timers,
counters, etc.
2) The graphical Function Block Diagram (FBD) language models networks of
simultaneously functioning electronic elements such as adders, multipliers, shift
registers, gates, etc.
3) The Structured Text (ST) language models typical information processing tasks such
as numerical algorithms using constructs found in general-purpose high level
languages such as Pascal.
4) The Instruction List (IL) language models the low-level programming of control
systems in assembly language.
5) A set of graphical and textual common elements provides rules for defining values and
variables, features for software configuration and object declaration. The common
elements include graphical and textual elements for the construction of
6) Sequential Function Charts (SFCs), which model time- and event-driven sequential
control devices and algorithms.
f) Flexibility in the selection of languages suited for programming application-specific
functionalities will increase the reuse of software solutions to process control problems.
g) Each application specialist on a project team can use a programming style and language
suited for the particular functionality in question, with the assurance that the results of the
work of the individual specialists will integrate smoothly together.
In summary, the principal goal of IEC 61131-3 is to introduce all the necessary standardized
language concepts and constructs to solve the technological problems of each application

– 14 – TR 61131-8 © IEC:2003(E)

and to provide principles for the construction of vendor-independent software elements. This

facilitates the reusability of control software designs for different controller types, even

though some effort will almost always be required in order to move control programs from one

controller family to another.
2.4 New features in the second edition of IEC 61131-3

Since 1993, the publication date of the first edition of IEC 61131-3, its environment has

changed greatly. During the first phase, a large amount of experience with the practical
application of the standard was gained. A number of inconsistencies, contradictions and
unresolved questions as well as features, which were unnecessarily difficult to implement,

were discovered. The industrial end-users, often represented by software companies,

supplied many proposals for changes and amendments.
To maintain the value of investment by the former IEC 61131 users and by today’s users of
IEC 61131-3 control software as far as possible for the future, the IEC has decided to use the
review of existing standards, which is due every five years, for a two-step revision.
Step 1: Elimination of inconsistencies within IEC 61131-3 (corrigendum)
Step 2: Amelioration of specific items in need of improvement within IEC 61131-3 and the
integration of features regarded as particularly relevant in practice (amendment).
For every individual item to be altered, changes were kept upward-compatible, i.e. a user
program compliant with the first edition is also compliant with the new edition, with the
exceptions noted in Clause A.4.
A summary of the corrections and amendments is given in Annex A of this technical report.
2.5 Software engineering considerations
2.5.1 Application of software engineering principles
2.5.1.1 Encapsulation and hiding
A number of software engineering principles were employed in the development of IEC
61131-3 in order to promote increased software quality. A few of the more important
principles, their contributions to software quality, and their embodiment in IEC 61131-3 are
discussed below.
NOTE See Annex B of this technical report for descriptions of the software engineering quality measures
referenced in this subclause, for example, reliability, maintainability, etc.
Encapsulation is the “packaging” of functionally related data and/or procedures in a single
software entity. Encapsulation contributes to software reliability, maintainability, usability, and

adaptability.
Associated with encapsulation is the notion of hiding of procedures and data, in which the
only knowledge that the user has of a software entity is its external interface and specified
functionality. Details of internal data structure and procedure implementation are intentionally
hidden. Hiding contributes to software maintainability, integrity, usability, portability and
reusability.
The elements of IEC 61131-3 that support encapsulation and hiding, and their main
subclauses in IEC 61131-3, are listed in Table 1.

TR 61131-8 © IEC:2003(E) – 15 –

Table 1 – IEC 61131-3 elements supporting encapsulation and hiding

Encapsulation Hiding
Element
(subclause)
Data Procedures Data Procedures

Structure (2.3.3) Yes No No No

Function (2.5.1) No Yes Yes Yes

Function block (2.5.2) Yes Yes Yes Yes

Program (2.5.3) Yes Yes Yes Yes

Action (2.6.4) No Yes No No
Access path (2.7.1) Yes No Yes No

2.5.1.2 Explicit representation of state
The SFC elements defined in 2.6 of IEC 61131-3 enable the state of the control system to be
determined at any point in time as the set of active steps and actions. Without this
representation, the state of the system must be inferred from data such as system inputs,
outputs, and some set of “state” (Boolean) variables. The use of SFC elements thus
contributes to software maintainability, usability and portability. Furthermore, system
responsiveness and processing capacity are enhanced by performing only those portions of
the software algorithm relevant to the current state.
2.5.1.3 Mapping to the application domain
The direct mapping of the elements of IEC 61131-3 to well-understood concepts in industrial-
process measurement, automation and control has already been noted in 2.1
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...