Programmable controllers - Part 3: Programming languages

IEC 61131-3:2003 specifies syntax and semantics of programming languages for programmable controllers as defined in part 1 of IEC 61131. This second edition of IEC 61131-3 cancels and replaces the first edition, published in 1993, and constitutes a technical revision. This bilingual version (2015-06) corresponds to the English version, published in 2003-01.

Automates programmables - Partie 3: Langages de programmation

L'IEC 61131-3:2003 spécifie la syntaxe et la sémantique des langages de programmation utilisés pour les automates programmables tels que définis dans la Partie 1 de la CEI 61131. Cette seconde édition de la CEI 61131-3 annule et remplace la première édition publiée en 1993, dont elle constitue une révision technique. La présente version bilingue (2015-06) correspond à la version anglaise monolingue publiée en 2003-01.

General Information

Status
Published
Publication Date
20-Jan-2003
Current Stage
DELPUB - Deleted Publication
Completion Date
20-Feb-2013
Ref Project

Relations

Buy Standard

Standard
IEC 61131-3:2003 - Programmable controllers - Part 3: Programming languages Released:1/21/2003 Isbn:2831866537
English language
230 pages
sale 15% off
Preview
sale 15% off
Preview
Standard
IEC 61131-3:2003 - Programmable controllers - Part 3: Programming languages Released:1/21/2003 Isbn:9782832226162
English and French language
438 pages
sale 15% off
Preview
sale 15% off
Preview

Standards Content (Sample)


IEC 61131-3
Edition 2.0 2003-01
INTERNATIONAL
STANDARD
Programmable controllers –
Part 3: 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
3, rue de Varembé
CH-1211 Geneva 20
Switzerland
Email: inmail@iec.ch
Web: 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.
ƒ Catalogue of IEC publications: www.iec.ch/searchpub
The IEC on-line Catalogue enables you to search by a variety of criteria (reference number, text, technical committee,…).
It also gives information on projects, withdrawn and replaced publications.
ƒ IEC Just Published: www.iec.ch/online_news/justpub
Stay up to date on all new IEC publications. Just Published details twice a month all new publications released. Available
on-line and also by email.
ƒ Electropedia: www.electropedia.org
The world's leading online dictionary of electronic and electrical terms containing more than 20 000 terms and definitions
in English and French, with equivalent terms in additional languages. Also known as the International Electrotechnical
Vocabulary online.
ƒ Customer Service Centre: www.iec.ch/webstore/custserv
If you wish to give us your feedback on this publication or need further assistance, please visit the Customer Service
Centre FAQ or contact us:
Email: csc@iec.ch
Tel.: +41 22 919 02 11
Fax: +41 22 919 03 00
IEC 61131-3 ®
Edition 2.0 2003-01
INTERNATIONAL
STANDARD
Programmable controllers –
Part 2: Equipment requirements and tests

INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
COMMISSION
ELECTROTECHNIQUE
PRICE CODE
INTERNATIONALE
XH
CODE PRIX
ICS 25.040; 35.240.50 ISBN 2-8318-6653-7

– 2 – 61131-3  IEC:2003(E)
CONTENTS
FOREWORD .8
1  General.9
1.1 Scope.9
1.2 Normative references .9
1.3 Definitions.9
1.4 Overview and general requirements .14
1.4.1 Software model.14
1.4.2 Communication model.16
1.4.3 Programming model .18
1.5 Compliance.19
1.5.1 System compliance .20
1.5.2 Program compliance.22
2 Common elements .23
2.1 Use of printed characters .23
2.1.1 Character set .23
2.1.2 Identifiers .23
2.1.3 Keywords.24
2.1.4 Use of white space .24
2.1.5 Comments .24
2.1.6 Pragmas .25
2.2 External representation of data .25
2.2.1 Numeric literals.25
2.2.2 Character string literals .26
2.2.3 Time literals .28
2.2.3.1 Duration .28
2.2.3.2 Time of day and date.29
2.3 Data types .29
2.3.1 Elementary data types.30
2.3.2 Generic data types .31
2.3.3 Derived data types.32
2.3.3.1 Declaration .32
2.3.3.2 Initialization.33
2.3.3.3 Usage .35
2.4 Variables.36
2.4.1 Representation .36
2.4.1.1 Single-element variables .36
2.4.1.2 Multi-element variables .38
2.4.2 Initialization.38
2.4.3 Declaration .39
2.4.3.1 Type assignment .41
2.4.3.2 Initial value assignment.42
2.5 Program organization units .45
2.5.1 Functions .45
2.5.1.1 Representation .46
2.5.1.2 Execution control.49
2.5.1.3 Declaration .50
2.5.1.4 Typing, overloading, and type conversion.52
2.5.1.5 Standard functions.55
2.5.1.5.1 Type conversion functions.55
2.5.1.5.2 Numerical functions.56
2.5.1.5.3 Bit string functions .59
2.5.1.5.4 Selection and comparison functions.59
2.5.1.5.5 Character string functions .62
2.5.1.5.6 Functions of time data types .64
2.5.1.5.7 Functions of enumerated data types.66

61131-3  IEC:2003(E) – 3 –
2.5.2 Function blocks.66
2.5.2.1 Representation .67
2.5.2.1a) Use of EN and ENO in function blocks .68
2.5.2.2 Declaration .69
2.5.2.3 Standard function blocks.77
2.5.2.3.1 Bistable elements .77
2.5.2.3.2 Edge detection.78
2.5.2.3.3 Counters .78
2.5.2.3.4 Timers.81
2.5.2.3.5 Communication function blocks.83
2.5.3 Programs.83
2.6 Sequential Function Chart (SFC) elements.84
2.6.1 General.84
2.6.2 Steps.84
2.6.3 Transitions .86
2.6.4 Actions.89
2.6.4.1 Declaration .89
2.6.4.2 Association with steps .91
2.6.4.3 Action blocks .92
2.6.4.4 Action qualifiers .93
2.6.4.5 Action control.94
2.6.5 Rules of evolution.99
2.6.6 Compatibility of SFC elements.107
2.6.7 SFC Compliance requirements .108
2.7 Configuration elements.108
2.7.1 Configurations, resources, and access paths .110
2.7.2 Tasks .114
3 Textual languages .
...


IEC 61131-3 ®
Edition 2.0 2003-01
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
Programmable controllers –
Part 3: Programming languages
Automates programmables –
Partie 3: Langages de programmation

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.

Droits de reproduction réservés. Sauf indication contraire, aucune partie de cette publication ne peut être reproduite
ni utilisée sous quelque forme que ce soit et par aucun procédé, électronique ou mécanique, y compris la photocopie
et les microfilms, sans l'accord écrit de l'IEC ou du Comité national de l'IEC du pays du demandeur. Si vous avez des
questions sur le copyright de l'IEC ou si vous désirez obtenir des droits supplémentaires sur cette publication, utilisez
les coordonnées ci-après ou contactez le Comité national de l'IEC de votre pays de résidence.

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 more than 30 000 terms and
Technical Specifications, Technical Reports and other definitions in English and French, with equivalent terms in 15
documents. Available for PC, Mac OS, Android Tablets and additional languages. Also known as the International
iPad. Electrotechnical 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 More than 60 000 electrotechnical terminology entries in
variety of criteria (reference number, text, technical English and French extracted from the Terms and Definitions
committee,…). It also gives information on projects, replaced clause of IEC publications issued since 2002. Some entries
and withdrawn publications. have been 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.
A propos de l'IEC
La Commission Electrotechnique Internationale (IEC) est la première organisation mondiale qui élabore et publie des
Normes internationales pour tout ce qui a trait à l'électricité, à l'électronique et aux technologies apparentées.

A propos des publications IEC
Le contenu technique des publications IEC est constamment revu. Veuillez vous assurer que vous possédez l’édition la
plus récente, un corrigendum ou amendement peut avoir été publié.

Catalogue IEC - webstore.iec.ch/catalogue Electropedia - www.electropedia.org
Application autonome pour consulter tous les renseignements
Le premier dictionnaire en ligne de termes électroniques et
bibliographiques sur les Normes internationales,
électriques. Il contient plus de 30 000 termes et définitions en
Spécifications techniques, Rapports techniques et autres
anglais et en français, ainsi que les termes équivalents dans
documents de l'IEC. Disponible pour PC, Mac OS, tablettes
15 langues additionnelles. Egalement appelé Vocabulaire
Android et iPad.
Electrotechnique International (IEV) en ligne.

Recherche de publications IEC - www.iec.ch/searchpub
Glossaire IEC - std.iec.ch/glossary
La recherche avancée permet de trouver des publications IEC Plus de 60 000 entrées terminologiques électrotechniques, en
en utilisant différents critères (numéro de référence, texte, anglais et en français, extraites des articles Termes et
comité d’études,…). Elle donne aussi des informations sur les Définitions des publications IEC parues depuis 2002. Plus
projets et les publications remplacées ou retirées. certaines entrées antérieures extraites des publications des

CE 37, 77, 86 et CISPR de l'IEC.
IEC Just Published - webstore.iec.ch/justpublished

Service Clients - webstore.iec.ch/csc
Restez informé sur les nouvelles publications IEC. Just
Published détaille les nouvelles publications parues. Si vous désirez nous donner des commentaires sur cette
Disponible en ligne et aussi une fois par mois par email. publication ou si vous avez des questions contactez-nous:
csc@iec.ch.
IEC 61131-3 ®
Edition 2.0 2003-01
INTERNATIONAL
STANDARD
NORME
INTERNATIONALE
Programmable controllers –
Part 3: Programming languages
Automates programmables –
Partie 3: Langages de programmation

INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
COMMISSION
ELECTROTECHNIQUE
INTERNATIONALE
ICS 25.040; 35.240.50 ISBN 978-2-8322-2616-2

– 2 – IEC 61131-3:2003  IEC 2003
CONTENTS
FOREWORD . 8
1  General . 9
1.1 Scope . 10
1.2 Normative references . 10
1.3 Definitions . 10
1.4 Overview and general requirements . 15
1.4.1 Software model . 15
1.4.2 Communication model . 17
1.4.3 Programming model . 19
1.5 Compliance . 20
1.5.1 System compliance . 21
1.5.2 Program compliance. 23
2 Common elements . 24
2.1 Use of printed characters . 24
2.1.1 Character set . 24
2.1.2 Identifiers . 24
2.1.3 Keywords . 25
2.1.4 Use of white space . 25
2.1.5 Comments . 25
2.1.6 Pragmas . 26
2.2 External representation of data . 26
2.2.1 Numeric literals . 26
2.2.2 Character string literals . 27
2.2.3 Time literals . 29
2.2.3.1 Duration . 29
2.2.3.2 Time of day and date . 30
2.3 Data types . 30
2.3.1 Elementary data types . 31
2.3.2 Generic data types . 32
2.3.3 Derived data types . 33
2.3.3.1 Declaration . 33
2.3.3.2 Initialization . 34
2.3.3.3 Usage . 36
2.4 Variables . 37
2.4.1 Representation . 37
2.4.1.1 Single-element variables . 37
2.4.1.2 Multi-element variables . 38
2.4.2 Initialization . 39
2.4.3 Declaration . 40
2.4.3.1 Type assignment . 42
2.4.3.2 Initial value assignment . 43
2.5 Program organization units . 46
2.5.1 Functions . 46
2.5.1.1 Representation . 47
2.5.1.2 Execution control . 50
2.5.1.3 Declaration . 51
2.5.1.4 Typing, overloading, and type conversion . 53
2.5.1.5 Standard functions. 56
2.5.1.5.1 Type conversion functions . 56
2.5.1.5.2 Numerical functions . 57
2.5.1.5.3 Bit string functions . 60
2.5.1.5.4 Selection and comparison functions . 60
2.5.1.5.5 Character string functions . 63
2.5.1.5.6 Functions of time data types . 65

2.5.1.5.7 Functions of enumerated data types . 67
2.5.2 Function blocks . 67
2.5.2.1 Representation . 68
2.5.2.1a) Use of EN and ENO in function blocks .
...

Questions, Comments and Discussion

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