EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf

上传人:syndromehi216 文档编号:719533 上传时间:2019-01-04 格式:PDF 页数:222 大小:1.93MB
下载 相关 举报
EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf_第1页
第1页 / 共222页
EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf_第2页
第2页 / 共222页
EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf_第3页
第3页 / 共222页
EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf_第4页
第4页 / 共222页
EN 61131-3-2003 en Programmable controllers Part 3 Programming languages (Remains Current)《可编程控制器 第3部分 编程语言 IEC 61131-3 2003》.pdf_第5页
第5页 / 共222页
点击查看更多>>
资源描述

1、BRITISH STANDARD BS EN 61131-3:2003 Programmable controllers Part 3: Programming languages The European Standard EN 61161-3:2003 has the status of a British Standard ICS 25.040; 35.240.50 BS EN 61131-3:2003 This British Standard was published under the authority of the Standards Policy and Strategy

2、Committee on 16 June 2003 BSI 16 June 2003 ISBN 0 580 42021 3 National foreword This British Standard is the official English language version of EN 61131-3:2003. It is identical with IEC 61131-3:2003. It supersedes BS EN 61131-3:1993 which is withdrawn. The UK participation in its preparation was e

3、ntrusted by Technical Committee GEL/65, Measurement and control, to Subcommittee GEL/65/2, Elements of systems, which has the responsibility to: A list of organizations represented on this subcommittee can be obtained on request to its secretary. Cross-references The British Standards which implemen

4、t international or European publications referred to in this document may be found in the BSI Catalogue under the section entitled “International Standards Correspondence Index”, or by using the “Search” facility of the BSI Electronic Catalogue or of British Standards Online. This publication does n

5、ot purport to include all the necessary provisions of a contract. Users are responsible for its correct application. Compliance with a British Standard does not of itself confer immunity from legal obligations. aid enquirers to understand the text; present to the responsible international/European c

6、ommittee any enquiries on the interpretation, or proposals for change, and keep the UK interests informed; monitor related international and European developments and promulgate them in the UK. Summary of pages This document comprises a front cover, an inside front cover, the EN title page, pages 2

7、to 219, an inside back cover and a back cover. The BSI copyright date displayed in this document indicates when the document was last issued. Amendments issued since publication Amd. No. Date CommentsEUROPEAN STANDARD EN 61131-3 NORME EUROPENNE EUROPISCHE NORM March 2003 CENELEC European Committee f

8、or Electrotechnical Standardization Comit Europen de Normalisation Electrotechnique Europisches Komitee fr 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 member

9、s. Ref. No. EN 61131-3:2003 E ICS 25.040; 35.240.50 Supersedes EN 61131-3:1993English version Programmable controllers Part 3: Programming languages (IEC 61131-3:2003) Automates programmables Partie 3: Langages de programmation (CEI 61131-3:2003) Speicherprogrammierbare Steuerungen Teil 3: Programmi

10、ersprachen (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-d

11、ate 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 unde

12、r 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, I

13、celand, Ireland, Italy, Luxembourg, Malta, Netherlands, Norway, Portugal, Slovakia, Spain, Sweden, Switzerland and United Kingdom. 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 s

14、ubmitted 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 o

15、r 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

16、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. _ Page2 EN611313:2002CONTENTS 1 General9 1

17、.1 Scope.9 1.2 Normative references 9 1.3 Definitions9 1.4 Overview and general requirements .14 1.4.1 Software model.14 1.4.2 Communication model16 1.4.3 Programming model .18 1.5 Compliance19 1.5.1 System compliance 20 1.5.2 Program compliance.22 2 Common elements .22 2.1 Use of printed characters

18、 22 2.1.1 Character set 22 2.1.2 Identifiers 23 2.1.3 Keywords23 2.1.4 Use of white space 23 2.1.5 Comments 24 2.1.6 Pragmas .24 2.2 External representation of data .24 2.2.1 Numeric literals.24 2.2.2 Character string literals 25 2.2.3 Time literals 27 2.2.3.1 Duration .27 2.2.3.2 Time of day and da

19、te.28 2.3 Data types .28 2.3.1 Elementary data types29 2.3.2 Generic data types .30 2.3.3 Derived data types31 2.3.3.1 Declaration 31 2.3.3.2 Initialization32 2.3.3.3 Usage .34 2.4 Variables35 2.4.1 Representation .35 2.4.1.1 Single-element variables .35 2.4.1.2 Multi-element variables .37 2.4.2 Ini

20、tialization.37 2.4.3 Declaration .38 2.4.3.1 Type assignment .40 2.4.3.2 Initial value assignment .41 2.5 Program organization units .44 2.5.1 Functions 44 2.5.1.1 Representation 45 2.5.1.2 Execution control.48 2.5.1.3 Declaration 49 2.5.1.4 Typing, overloading, and type conversion.51 2.5.1.5 Standa

21、rd functions.54 2.5.1.5.1 Type conversion functions54 2.5.1.5.2 Numerical functions55 2.5.1.5.3 Bit string functions 58 2.5.1.5.4 Selection and comparison functions.58 2.5.1.5.5 Character string functions 61 2.5.1.5.6 Functions of time data types 63 2.5.1.5.7 Functions of enumerated data types65 Pag

22、e3 EN611313:20022.5.2 Function blocks.65 2.5.2.1 Representation 66 2.5.2.1a) Use of EN and ENO in function blocks 67 2.5.2.2 Declaration 68 2.5.2.3 Standard function blocks.76 2.5.2.3.1 Bistable elements .76 2.5.2.3.2 Edge detection77 2.5.2.3.3 Counters .77 2.5.2.3.4 Timers.80 2.5.2.3.5 Communicatio

23、n function blocks82 2.5.3 Programs 82 2.6 Sequential Function Chart (SFC) elements.83 2.6.1 General.83 2.6.2 Steps 83 2.6.3 Transitions 85 2.6.4 Actions88 2.6.4.1 Declaration 88 2.6.4.2 Association with steps .90 2.6.4.3 Action blocks .91 2.6.4.4 Action qualifiers .92 2.6.4.5 Action control.93 2.6.5

24、 Rules of evolution.98 2.6.6 Compatibility of SFC elements .106 2.6.7 SFC Compliance requirements 107 2.7 Configuration elements107 2.7.1 Configurations, resources, and access paths 109 2.7.2 Tasks 113 3 Textual languages 122 3.1 Common elements 122 3.2 Instruction list (IL) 122 3.2.1 Instructions .

25、122 3.2.2 Operators, modifiers and operands123 3.2.3 Functions and function blocks125 3.3 Structured Text (ST)128 3.3.1 Expressions 128 3.3.2 Statements .130 3.3.2.1 Assignment statements .132 3.3.2.2 Function and function block control statements 132 3.3.2.3 Selection statements .132 3.3.2.4 Iterat

26、ion statements.133 4 Graphic languages .134 4.1 Common elements 134 4.1.1 Representation of lines and blocks .134 4.1.2 Direction of flow in networks.134 4.1.3 Evaluation of networks .135 4.1.4 Execution control elements 137 4.2 Ladder diagram (LD) .138 4.2.1 Power rails138 4.2.2 Link elements and s

27、tates138 4.2.3 Contacts .139 4.2.4 Coils139 4.2.5 Functions and function blocks139 4.2.6 Order of network evaluation .140 4.3 Function Block Diagram (FBD)142 4.3.1 General.142 4.3.2 Combination of elements142 4.3.3 Order of network evaluation .142 Page4 EN611313:2002ANNEX A (normative) Specification

28、 method for textual languages 143 A.1 Syntax .143 A.1.1 Terminal symbols.143 A.1.2 Non-terminal symbols 143 A.1.3 Production rules 144 A.2 Semantics .144 ANNEX B (normative) Formal specifications of language elements.145 B.0 Programming model145 B.1 Common elements145 B.1.1 Letters, digits and ident

29、ifiers .145 B.1.2 Constants .146 B.1.2.1 Numeric literals 146 B.1.2.2 Character strings.146 B.1.2.3 Time literals147 B.1.2.3.1 Duration147 B.1.2.3.2 Time of day and date .147 B.1.3 Data types .148 B.1.3.1 Elementary data types 148 B.1.3.2 Generic data types148 B.1.3.3 Derived data types 148 B.1.4 Va

30、riables 150 B.1.4.1 Directly represented variables 150 B.1.4.2 Multi-element variables .150 B.1.4.3 Declaration and initialization .151 B.1.5 Program organization units 153 B.1.5.1 Functions.153 B.1.5.2 Function blocks .154 B.1.5.3 Programs.155 B.1.6 Sequential function chart elements155 B.1.7 Confi

31、guration elements 156 B.2 Language IL (Instruction List) .158 B.2.1 Instructions and operands158 B.2.2 Operators .158 B.3 Language ST (Structured Text) 159 B.3.1 Expressions159 B.3.2 Statements .159 B.3.2.1 Assignment statements.160 B.3.2.2 Subprogram control statements160 B.3.2.3 Selection statemen

32、ts.160 B.3.2.4 Iteration statements 160 ANNEX C (normative) Delimiters and keywords.161 ANNEX D (normative) Implementation-dependent parameters164 ANNEX E (normative) Error conditions .166 ANNEX F (informative) Examples .168 F.1 Function WEIGH .168 F.2 Function block CMD_MONITOR.169 F.3 Function blo

33、ck FWD_REV_MON 172 F.4 Function block STACK_INT.177 F.5 Function block MIX_2_BRIX .182 F.6 Analog signal processing 185 F.6.1 Function block LAG1 186 F.6.2 Function block DELAY 186 Page5 EN611313:2002F.6.3 Function block AVERAGE187 F.6.4 Function block INTEGRAL187 F.6.5 Function block DERIVATIVE .18

34、8 F.6.6 Function block HYSTERESIS .188 F.6.7 Function block LIMITS_ALARM .189 F.6.8 Structure ANALOG_LIMITS189 F.6.9 Function block ANALOG_MONITOR.190 F.6.10 Function block PID191 F.6.11 Function block DIFFEQ .192 F.6.12 Function block RAMP 193 F.6.13 Function block TRANSFER194 F.7 Program GRAVEL.19

35、4 F.8 Program AGV .202 F.9 Use of enumerated data types 205 F.10 Function block RTC (Real Time Clock)205 F.11 Function block ALRM_INT.205 ANNEX G (informative) Reference character set207 Annex ZA (normative) Normative references to international publications with their corresponding European publica

36、tions209 Index 210 Table 1 - Character set features.22 Table 2 - Identifier features.23 Table 3 - Comment feature.24 Table 3a - Pragma feature24 Table 4 - Numeric literals25 Table 5 - Character string literal features .26 Table 6 - Two-character combinations in character strings .27 Table 7 - Durati

37、on literal features .28 Table 8 - Date and time of day literals28 Table 9 - Examples of date and time of day literals .28 Table 10 - Elementary data types 29 Table 11 - Hierarchy of generic data types 31 Table 12 - Data type declaration features 32 Table 13 - Default initial values of elementary dat

38、a types33 Table 14 - Data type initial value declaration features .34 Table 15 - Location and size prefix features for directly represented variables.36 Table 16a - Variable declaration keywords 38 Table 16b - Usages of VAR_GLOBAL, VAR_EXTERNAL and CONSTANT declarations 40 Table 17 - Variable type a

39、ssignment features40 Table 18 - Variable initial value assignment features.42 Table 19 - Graphical negation of Boolean signals .46 Table 19a - Textual invocation of functions for formal and non-formal argument list 48 Table 20 - Use of EN input and ENO output 49 Table 20a - Function features .50 Tab

40、le 21 - Typed and overloaded functions.52 Table 22 - Type conversion function features 54 Page6 EN611313:2002Table 23 - Standard functions of one numeric variable56 Table 24 - Standard arithmetic functions57 Table 25 - Standard bit shift functions58 Table 26 - Standard bitwise Boolean functions59 Ta

41、ble 27 - Standard selection functions d 60 Table 28 - Standard comparison functions.61 Table 29 - Standard character string functions 62 Table 30 - Functions of time data types .63 Table 31 - Functions of enumerated data types.65 Table 32 - Examples of function block I/O variable usage.67 Table 33 -

42、 Function block declaration and usage features 70 Table 34 - Standard bistable function blocksa .76 Table 35 - Standard edge detection function blocks 77 Table 36 - Standard counter function blocks78 Table 37 - Standard timer function blocks80 Table 38 - Standard timer function blocks - timing diagr

43、ams.81 Table 39 - Program declaration features82 Table 40 - Step features .84 Table 41 - Transitions and transition conditions.86 Table 42 - Declaration of actionsa,b 89 Table 43 - Step/action association .91 Table 44 - Action block features.92 Table 45 - Action qualifiers.93 Table 45a - Action cont

44、rol features 97 Table 46 - Sequence evolution.100 Table 47 - Compatible SFC features107 Table 48 - SFC minimal compliance requirements 107 Table 49 - Configuration and resource declaration features111 Table 50 - Task features.115 Table 51a - Examples of instruction fields123 Table 51b - Parenthesize

45、d expression features for IL language124 Table 52 - Instruction List operators.124 Table 53 - Function Block invocation and Function invocation features for IL language.126 Table 54 - Standard Function Block input operators for IL language.128 Table 55 - Operators of the ST language.130 Table 56 - S

46、T language statements .131 Table 57 - Representation of lines and blocks .135 Table 58 - Graphic execution control elements137 Table 59 - Power rails.138 Table 60 - Link elements 139 Table 61 - Contactsa 140 Table 62 - Coils 141 Table C.1 - Delimiters.161 Table C.2 - Keywords .162 Table D.1 - Implem

47、entation-dependent parameters 164 Table E.1 - Error conditions166 Page7 EN611313:2002Table G.1 - Character representations.207 Table G.2 - Character encodings .208 Figure 1 - Software model 15 Figure 2 a) - Data flow connection within a program16 Figure 2 b) - Communication via GLOBAL variables.16 F

48、igure 2 c) - Communication function blocks .17 Figure 2 d) - Communication via access paths 17 Figure 3 - Combination of programmable controller language elements .19 Figure 4 - Examples of function usage.44 Figure 5 - Use of formal argument names47 Figure 6 - Examples of function declarations and u

49、sage .51 Figure 7 - Examples of explicit type conversion with overloaded functions .53 Figure 8 - Examples of explicit type conversion with typed functions 53 Figure 9 - Function block instantiation examples .66 Figure 10 - Examples of function block declarations69 Figure 11 a) - Graphical use of a function block name as an input variable 72 Figure 11 b) - Graphical use of a function block name as an in-out variable.73 Figure 11 c) - Graphical use of a

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 标准规范 > 国际标准 > 其他

copyright@ 2008-2019 麦多课文库(www.mydoc123.com)网站版权所有
备案/许可证编号:苏ICP备17064731号-1