1、 IEC TR 61131-8 Edition 3.0 2017-11 TECHNICAL REPORT Industrial-process measurement and control Programmable controllers Part 8:Guidelines for the application and implementation of programming languages IEC TR 61131-8:2017-11en)colourinside THIS PUBLICATION IS COPYRIGHT PROTECTED Copyright 2017 IEC,
2、Geneva,Switzerland 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 IECs member National Committee in the
3、 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 Vare
4、mb Fax:+41 22 919 03 00 CH-1211 Geneva 20 infoiec.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 publicat
5、ions 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 The stand-alone application for consulting the entire bibliographic
6、al information on IEC International Standards,Technical Specifications,Technical Reports and other documents.Available for PC,Mac OS,Android Tablets and iPad.IEC publications search-www.iec.ch/searchpub The advanced search enables to find IEC publications by a variety of criteria(reference number,te
7、xt,technical committee,).It also gives information on projects,replaced and withdrawn publications.IEC Just Published-webstore.iec.ch/justpublished Stay up to date on all new IEC publications.Just Published details all new publications released.Available online and also once a month by email.Electro
8、pedia-www.electropedia.org The worlds leading online dictionary of electronic and electrical terms containing 20 000 terms and definitions in English and French,with equivalent terms in 16 additional languages.Also known as the International Electrotechnical Vocabulary(IEV)online.IEC Glossary-std.ie
9、c.ch/glossary 65 000 electrotechnical terminology entries in English and French extracted from the Terms and Definitions clause of IEC publications issued since 2002.Some entries have been collected from earlier publications of IEC TC 37,77,86 and CISPR.IEC Customer Service Centre-webstore.iec.ch/cs
10、c If you wish to give us your feedback on this publication or need further assistance,please contact the Customer Service Centre:csciec.ch.IEC TR 61131-8 Edition 3.0 2017-11 TECHNICAL REPORT Industrial-process measurement and control Programmable controllers Part 8:Guidelines for the application and
11、 implementation of programming languages INTERNATIONAL ELECTROTECHNICAL COMMISSION ICS 25.040.40;25.240.50 ISBN 978-2-8322-4898-0 Registered trademark of the International Electrotechnical Commission Warning!Make sure that you obtained this publication from an authorized distributor.colourinside 2 I
12、EC 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
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 select
14、ion.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 mul
15、ti-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
16、 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 referen