Industrial-process measurement and control - Programmable controllers - Part 8: Guidelines for the application and implementation of programming languages

IEC TR 61131-8:2017(E) applies to the programming of program­mable controller systems using the programming languages defined in IEC 61131-3. The scope of IEC 61131-3 is applicable to this part.
This document provides
a) guidelines for the application of IEC 61131-3,
b) guidelines for the implementation of IEC 61131-3 languages for programmable controller systems,
c) programming and debugging tool (PADT) recommendations.
For further information see IEC 61131-4 which describes other aspects of the application of programmable controller systems, e.g. electromagnetic compatibility or functional safety. This third edition cancels and replaces the second edition published in 2003. This edition constitutes a technical revision. This edition includes the following significant technical changes with respect to the previous edition: This third edition is a compatible extension of the second edition. The main extensions are new data types and conversion functions, references, name spaces and the object oriented features of classes and function blocks (see listing in Annex B of IEC 61131-3:2013).

General Information

Status
Published
Publication Date
21-Nov-2017
Current Stage
PPUB - Publication issued
Start Date
03-Nov-2017
Completion Date
22-Nov-2017
Ref Project

Relations

Buy Standard

Technical report
IEC TR 61131-8:2017 - Industrial-process measurement and control - Programmable controllers - Part 8: Guidelines for the application and implementation of programming languages
English language
102 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


IEC TR 61131-8 ®
Edition 3.0 2017-11
TECHNICAL
REPORT
colour
inside
Industrial-process measurement and control – Programmable controllers –
Part 8: Guidelines for the application and implementation of programming
languages
All rights reserved. Unless otherwise specified, 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
either IEC or IEC's member National Committee in the country of the requester. If you have any questions about IEC
copyright or have an enquiry about obtaining additional rights to this publication, please contact the address below or
your local IEC member National Committee for further information.

IEC Central Office Tel.: +41 22 919 02 11
3, rue de Varembé Fax: +41 22 919 03 00
CH-1211 Geneva 20 info@iec.ch
Switzerland www.iec.ch
About the IEC
The International Electrotechnical Commission (IEC) is the leading global organization that prepares and publishes
International Standards for all electrical, electronic and related technologies.

About IEC publications
The technical content of IEC publications is kept under constant review by the IEC. Please make sure that you have the
latest edition, a corrigenda or an amendment might have been published.

IEC Catalogue - webstore.iec.ch/catalogue Electropedia - www.electropedia.org
The stand-alone application for consulting the entire The world's leading online dictionary of electronic and
bibliographical information on IEC International Standards, electrical terms containing 20 000 terms and definitions in
Technical Specifications, Technical Reports and other English and French, with equivalent terms in 16 additional
documents. Available for PC, Mac OS, Android Tablets and languages. Also known as the International Electrotechnical
iPad. Vocabulary (IEV) online.

IEC publications search - www.iec.ch/searchpub IEC Glossary - std.iec.ch/glossary
The advanced search enables to find IEC publications by a 65 000 electrotechnical terminology entries in English and
variety of criteria (reference number, text, technical French extracted from the Terms and Definitions clause of
committee,…). It also gives information on projects, replaced IEC publications issued since 2002. Some entries have been
and withdrawn publications. collected from earlier publications of IEC TC 37, 77, 86 and

CISPR.
IEC Just Published - webstore.iec.ch/justpublished

Stay up to date on all new IEC publications. Just Published IEC Customer Service Centre - webstore.iec.ch/csc
details all new publications released. Available online and If you wish to give us your feedback on this publication or
also once a month by email. need further assistance, please contact the Customer Service
Centre: csc@iec.ch.
IEC TR 61131-8 ®
Edition 3.0 2017-11
TECHNICAL
REPORT
colour
inside
Industrial-process measurement and control – Programmable controllers –

Part 8: Guidelines for the application and implementation of programming

languages
INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
ICS 25.040.40; 25.240.50 ISBN 978-2-8322-4898-0

– 2 – IEC TR 61131-8:2017  IEC 2017
CONTENTS
FOREWORD . 6
INTRODUCTION . 8
1 Scope . 9
2 Normative references . 9
3 Terms and definitions . 9
4 Abbreviated terms . 9
5 Overview . 10
6 Introduction to IEC 61131-3 . 10
6.1 General considerations . 10
6.2 Overcoming historical limitations . 13
6.3 Basic features in IEC 61131-3 . 13
6.4 Language items overview . 14
6.5 Changes from IEC 61131-3:2003 (edition 2) to IEC 61131-3:2013 (edition 3) . 16
6.6 Software engineering considerations . 17
6.6.1 Application of software engineering principles . 17
6.6.2 Portability . 19
7 Application guidelines . 20
7.1 Use of data types . 20
7.1.1 Type selection . 20
7.1.2 Type versus variable initialization . 20
7.1.3 Use of enumerated and subrange types . 21
7.1.4 Use of BCD data . 22
7.1.5 Use of REAL data types . 22
7.1.6 Use of character string data types . 23
7.1.7 Use of character data types . 24
7.1.8 Use of time data types . 24
7.1.9 Declaration and use of multi-element variables . 26
7.1.10 Use of bit-string variables . 26
7.1.11 Use of partial accessing of bitstring variables . 27
7.1.12 Type assignment . 27
7.2 Data passing over POU . 27
7.2.1 General . 27
7.2.2 External variables . 29
7.2.3 In-out (VAR_IN_OUT) variables . 29
7.2.4 Formal and non-formal invocations and argument lists . 32
7.2.5 Assignment of input, output, and in-out variables of programs . 34
7.3 Use of function blocks . 35
7.3.1 Function block types and instances . 35
7.3.2 Scope of data within function blocks . 35
7.3.3 Function block access and invocation . 36
7.4 Differences between function block instances and functions . 37
7.5 Use of indirectly referenced function block instances . 37
7.5.1 General . 37
7.5.2 Establishing an indirect function block instance reference . 38
7.5.3 Access to indirectly referenced function block instances . 40

7.5.4 Invocation of indirectly referenced function block instances . 41
7.5.5 Recursion of indirectly referenced function block instances . 43
7.5.6 Execution control of indirectly referenced function block instances . 44
7.5.7 Use of indirectly referenced function block instances in functions . 44
7.6 Use of programs . 44
7.6.1 Difference to function block . 44
7.6.2 Communication with other programs . 44
7.7 Object orientation . 45
7.7.1 General introduction . 45
7.7.2 Usage of methods . 45
7.7.3 Usage of class variable . 49
7.7.4 Usage of inheritance . 50
7.7.5 Usage of override . 53
7.7.6 Usage of interfaces . 53
7.8 Recursion within programmable controller programming languages . 54
7.9 Multiple invocations of a function block instance . 54
7.10 Language specific features . 55
7.10.1 Edge-triggered functionality . 55
7.10.2 Edge-triggering in LD language . 55
7.10.3 Use of edge-triggered function blocks . 56
7.10.4 Use of EN/ENO in functions and function blocks . 56
7.10.5 Language selection. 57
7.11 Namespaces . 58
7.11.1 General . 58
7.11.2 Usage of global namespace . 58
7.11.3 Usage of INTERNAL . 58
7.12 Use of SFC elements . 59
7.12.1 General . 59
7.12.2 Action control . 59
7.12.3 Boolean actions . 60
7.12.4 Non-SFC actions . 64
7.12.5 SFC actions . 65
7.12.6 SFC function blocks . 66
7.13 Scheduling, concurrency and synchronization mechanisms . 67
7.13.1 Operating system issues . 67
7.13.2 Task scheduling . 68
7.13.3 Semaphores . 69
7.13.4 Messaging . 70
7.13.5 Time stamping . 70
7.14 Communication facilities in ISO/IEC 9506-5 and IEC 61131-5 . 71
7.14.1 Overview . 71
7.14.2 Data representation . 71
7.14.3 Communication channels . 73
7.14.4 Reading and writing variables . 73
7.14.5 Communication function blocks . 74
7.15 Deprecated programming practices . 75
7.15.1 General . 75
7.15.2 Global variables . 75
7.15.3 Jumps in FBD/LD language . 75

– 4 – IEC TR 61131-8:2017  IEC 2017
7.15.4 Dynamic modification of task properties .
...

Questions, Comments and Discussion

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