Programmable controllers -- Part 3: Programming languages

Applies to the printed and displayed representation, using characters of the ISO/EN 646 character set, of the programming languages to be used for programmable controllers. Specifies the syntax and semantics.

Speicherprogrammierbare Steuerungen -- Teil 3: Programmiersprachen

Automates programmables -- Partie 3: Langages de programmation

S'applique à la représentation imprimée et affichée, à l'aide des caractères ISO/EN 646, des langages de programmation devant être utilisés pour les automates programmables. Spécifie la syntaxe et la sémantique.

Programmable controllers - Part 3: Programming languages

General Information

Status
Withdrawn
Publication Date
29-Feb-2004
Withdrawal Date
04-Apr-2016
Current Stage
9900 - Withdrawal (Adopted Project)
Start Date
05-Apr-2016
Due Date
28-Apr-2016
Completion Date
05-Apr-2016

Relations

Buy Standard

Standard
EN 61131-3:2004
English language
222 pages
sale 10% off
Preview
sale 10% off
Preview
e-Library read for
1 day

Standards Content (Sample)

SLOVENSKI SIST EN 61131-3:2004

STANDARD
marec 2004
Programmable controllers - Part 3: Programming languages
ICS 25.040.40; 35.240.50 Referenčna številka
SIST EN 61131-3:2004(en)
©  Standard je založil in izdal Slovenski inštitut za standardizacijo. Razmnoževanje ali kopiranje celote ali delov tega dokumenta ni dovoljeno

---------------------- Page: 1 ----------------------

EUROPEAN STANDARD EN 61131-3
NORME EUROPÉENNE
EUROPÄISCHE NORM March 2003

ICS 25.040; 35.240.50 Supersedes EN 61131-3:1993


English version


Programmable controllers
Part 3: Programming languages
(IEC 61131-3:2003)


Automates programmables Speicherprogrammierbare Steuerungen
Partie 3: Langages de programmation Teil 3: Programmiersprachen
(CEI 61131-3:2003) (IEC 61131-3:2003)






This European Standard was approved by CENELEC on 2002-12-01. CENELEC members are bound to
comply with the CEN/CENELEC Internal Regulations which stipulate the conditions for giving this European
Standard the status of a national standard without any alteration.

Up-to-date lists and bibliographical references concerning such national standards may be obtained on
application to the Central Secretariat or to any CENELEC member.

This European Standard exists in three official versions (English, French, German). A version in any other
language made by translation under the responsibility of a CENELEC member into its own language and
notified to the Central Secretariat has the same status as the official versions.

CENELEC members are the national electrotechnical committees of Austria, Belgium, Czech Republic,
Denmark, Finland, France, Germany, Greece, Hungary, Iceland, Ireland, Italy, Luxembourg, Malta,
Netherlands, Norway, Portugal, Slovakia, Spain, Sweden, Switzerland and United Kingdom.

CENELEC
European Committee for Electrotechnical Standardization
Comité Européen de Normalisation Electrotechnique
Europäisches Komitee für Elektrotechnische Normung

Central Secretariat: rue de Stassart 35, B - 1050 Brussels


© 2003 CENELEC - All rights of exploitation in any form and by any means reserved worldwide for CENELEC members.

Ref. No. EN 61131-3:2003 E

---------------------- Page: 2 ----------------------

EN 61131-3:2003 - 2 -
Foreword

The text of document 65B/456/FDIS, future edition 2 of IEC 61131-3, prepared by SC 65B, Devices, of
IEC TC 65, Industrial-process measurement and control, was submitted to the IEC-CENELEC parallel
vote and was approved by CENELEC as EN 61131-3 on 2002-12-01.

This European Standard supersedes EN 61131-3:1993.

The following dates were fixed:

– latest date by which the EN has to be implemented
 at national level by publication of an identical
 national standard or by endorsement (dop) 2003-10-01

– latest date by which the national standards conflicting
 with the EN have to be withdrawn (dow) 2005-12-01

Annexes designated "normative" are part of the body of the standard.
Annexes designated "informative" are given for information only.
In this standard, annexes A, B, C, D, E and ZA are normative and annexes F and G are informative.
Annex ZA has been added by CENELEC.
__________

Endorsement notice

The text of the International Standard IEC 61131-3:2003 was approved by CENELEC as a European
Standard without any modification.
__________

---------------------- Page: 3 ----------------------

- 3 - EN 61131-3:2003
Annex ZA
(normative)

Normative references to international publications
with their corresponding European publications
This European Standard incorporates by dated or undated reference, provisions from other
publications. These normative references are cited at the appropriate places in the text and the
publications are listed hereafter. For dated references, subsequent amendments to or revisions of any
of these publications apply to this European Standard only when incorporated in it by amendment or
revision. For undated references the latest edition of the publication referred to applies (including
amendments).
NOTE When an international publication has been modified by common modifications, indicated by (mod), the relevant
EN/HD applies.
Publication Year Title EN/HD Year
IEC 60050 Series International Electrotechnical - -
Vocabulary

IEC 60559 1989 Binary floating-point arithmetic for HD 592 S1 1991
microprocessor systems

IEC 60617-12 1997 Graphical symbols for diagrams EN 60617-12 1998
Part 12: Binary logic elements

IEC 60617-13 1993 Part 13: Analogue elements EN 60617-13 1993

IEC 60848 2002 GRAFCET specification language for EN 60848 2002
sequential function charts

1) 2)
IEC 61131-1 - Programmable controllers EN 61131-1 1994
Part 1: General information

1) 2)
IEC 61131-5 - Part 5: Communications EN 61131-5 2001

ISO/AFNOR 1989 Dictionary of computer science - The - -
standardised vocabulary

ISO/IEC 10646-1 1993 Information technology - Universal - -
Multiple-Octet Coded Character set
(UCS) - Part 1: Architecture and Basic
Multilingual Plane





1)
Undated reference.
2)
Valid editon at date of issue.

---------------------- Page: 4 ----------------------

IEC 61131-3
Edition 2.0 2003-01
INTERNATIONAL
STANDARD
Programmable controllers –
Part 3: Programming languages
INTERNATIONAL
ELECTROTECHNICAL
COMMISSION
PRICE CODE
XK
ICS 25.040; 35.240.50 ISBN 2-8318-6653-7

---------------------- Page: 5 ----------------------

– 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

---------------------- Page: 6 ----------------------

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 .123
3.1 Common elements .123
3.2 Instruction list (IL) .123
3.2.1 Instructions .123
3.2.2 Operators, modifiers and operands.124
3.2.3 Functions and function blocks.126
3.3 Structured Text (ST).129
3.3.1 Expressions .129
3.3.2 Statements .131
3.3.2.1 Assignment statements .133
3.3.2.2 Function and function block control statements.133
3.3.2.3 Selection statements .133
3.3.2.4 Iteration statements.134
4 Graphic languages .135
4.1 Common elements .135
4.1.1 Representation of lines and blocks .135
4.1.2 Direction of flow in networks.135
4.1.3 Evaluation of networks .136
4.1.4 Execution control elements .138
4.2 Ladder diagram (LD) .139
4.2.1 Power rails.139
4.2.2 Link elements and states.139
4.2.3 Contacts .140
4.2.4 Coils.140
4.2.5 Functions and function blocks.140
4.2.6 Order of network evaluation .141
4.3 Function Block Diagram (FBD).143
4.3.1 General.143
4.3.2 Combination of elements.143
4.3.3 Order of network evaluation .143

---------------------- Page: 7 ----------------------

– 4 – 61131-3 ” IEC:2003(E)
ANNEX A (normative) Specification method for textual languages .144
A.1 Syntax .144
A.1.1  Terminal symbols.144
A.1.2  Non-terminal symbols .144
A.1.3  Production rules .145
A.2 Semantics .145
ANNEX B (normative) Formal specifications of language elements.146
B.0 Programming model.146
B.1 Common elements.146
B.1.1 Letters, digits and identifiers .146
B.1.2 Constants .147
B.1.2.1  Numeric literals .147
B.1.2.2 Character strings.147
B.1.2.3 Time literals.148
B.1.2.3.1 Duration.148
B.1.2.3.2 Time of day and date .148
B.1.3  Data types .149
B.1.3.1 Elementary data types .149
B.1.3.2 Generic data types.149
B.1.3.3 Derived data types .149
B.1.4 Variables .151
B.1.4.1 Directly represented variables .151
B.1.4.2 Multi-element variables .151
B.1.4.3 Declaration and initialization .152
B.1.5 Program organization units .154
B.1.5.1 Functions.154
B.1.5.2 Function blocks .155
B.1.5.3 Programs.156
B.1.6 Sequential function chart elements.156
B.1.7 Configuration elements .157
B.2 Language IL (Instruction List) .159
B.2.1 Instructions and operands.159
B.2.2 Operators .159
B.3 Language ST (Structured Text) .160
B.3.1 Expressions.160
B.3.2 Statements .160
B.3.2.1 Assignment statements.161
B.3.2.2 Subprogram control statements.161
B.3.2.3 Selection statements.161
B.3.2.4 Iteration statements.161
ANNEX C (normative) Delimiters and keywords.162
ANNEX D (normative) Implementation-dependent parameters.165
ANNEX E (normative) Error conditions .167
ANNEX F (informative) Examples .169
F.1 Function WEIGH .169
F.2 Function block CMD_MONITOR.170
F.3 Function block FWD_REV_MON .173
F.4 Function block STACK_INT.178
F.5 Function block MIX_2_BRIX .183
F.6 Analog signal processing .186
F.6.1 Function block LAG1 .187
F.6.2 Function block DELAY .187

---------------------- Page: 8 ----------------------

61131-3 ” IEC:2003(E) – 5 –
F.6.3 Function block AVERAGE.188
F.6.4 Function block INTEGRAL.188
F.6.5 Function block DERIVATIVE .189
F.6.6 Function block HYSTERESIS .189
F.6.7 Function block LIMITS_ALARM .190
F.6.8 Structure ANALOG_LIMITS.190
F.6.9 Function block ANALOG_MONITOR.191
F.6.10 Function block PID.192
F.6.11 Function block DIFFEQ .193
F.6.12 Function block RAMP .194
F.6.13 Function block TRANSFER.195
F.7 Program GRAVEL.
...

Questions, Comments and Discussion

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