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
Completion Date
22-Nov-2017
Ref Project

Relations

Buy Standard

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.
...

Questions, Comments and Discussion

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