资源预览内容
第1页 / 共32页
第2页 / 共32页
第3页 / 共32页
第4页 / 共32页
第5页 / 共32页
第6页 / 共32页
第7页 / 共32页
第8页 / 共32页
第9页 / 共32页
第10页 / 共32页
亲,该文档总共32页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述
8 The IEC 61131-3 Programming Languages Copyright 2005 Yokogawa System Center Europe B.V. 8-2 RSWB rev 1.2 Table of contents 8 The IEC 61131-3 Programming Languages.8-1 8.1 The IEC 61131-3 Programming Languages. 8-3 8.1.1 Chapter objectives. 8-4 8.1.2 Overview of the IEC61131-3 Standard. 8-5 8.1.3 Functions and Function Blocks. 8-7 8.1.3.1 Common elements. 8-8 8.1.3.2 Function Blocks. 8-12 8.1.3.3 Variable Types. 8-13 8.1.4 Function Block Diagram Language 8-14 8.1.4.1 Graphical conventions within FBD. 8-15 8.1.4.2 FBD Signal flow 8-16 8.1.4.3 FBD Feedback. 8-17 8.1.4.4 Jumps, labels and Return. 8-18 8.1.4.5 Function Block Diagram Example 8-20 8.1.5 Ladder Diagrams. 8-25 8.1.5.1 Symbols used in Ladder Diagrams 8-26 8.1.5.2 Appearance of the Ladder Diagram Editor 8-27 8.1.5.3 Methodology 8-28 RSWB rev 1.2 8-3 8.1 The IEC 61131-3 Programming Languages This section covers the programming language utilized by the ProSafe-RS. The programming conforms to the IEC61131-3 standard which defines a complete programming system, data structure and PLC interface. IEC61131-3 is part of IEC 1131 standard, which deals with all aspects of PLC application to industrial-process measurement and control. IEC61131 standard defines the following programming methods: o Function Block Diagrams o Ladder Diagrams o Instruction list o Structured Text o Sequence Function Charts The ProSafe-RS supports only the Function Block Diagrams and Ladder Diagrams. These languages are most commonly used in Safety Applications. The standard was developed to standardize the programming of PLCs across the many hardware platforms available on the market. This has several advantages: o A common language means that users do not have to learn different languages for different PLCs. o Portability of programs across different PLCs. o Well structured top-down or bottom-up program development. o Allows a program to be broken down into functional elements called Program Organization Units (POUs). POUs include functions, function blocks and programs and can be developed as portfolios by users for re-use. o Strong Data typing - Various data elements that are associated can be addressed as a single entity o Self check to detect when a wrong data type is being assigned to a variable. o Full execution control of scan time facilities are provided for different parts of a program to be executed at: o different times o different rates o in parallel o Can describe Complex Sequential Behavior 8-4 RSWB rev 1.2 8.1.1 Chapter objectives After completing this section, the student will be able to: Know how to program in Function Block Diagram and Ladder Diagram Use the Standard and Yokogawa specific function blocks RSWB rev 1.2 8-5 8.1.2 Overview of the IEC61131-3 Standard Configurations Configurations are at the highest level of the project. They define the hardware interface to the PLC, containing the configuration to enable interfacing between the software and the hardware. This includes o PLC specification (resource) o Tasks o I/O Configuration o Global Variables Resources Within each configuration there are one or more resources. A resource provides system support for all of the features needed for the execution of programs and an interface between a program and the physical I/O channels of the PLC. In ProSafe-RS a configuration only has (at this moment) 1 resource. An IEC program cannot function unless it is loaded into a resource. IEC standard allows each resource to be able to support more than one program Program Organization Units (POUs) An IEC program can be built from a number of different software elements. Each software element can be written in any one of the different IEC languages. Typically a program consists of a number of interconnected Function Blocks. The execution of a program is controlled using tasks. A POU must be instantiated into a task to execute. In ProSafe-RS there is only one task. Every POU runs on the same scan sequence. Tasks Controls a set of programs and/or FBs to execute periodically or upon the occurrence of a specified trigger. A program or FB will remain dormant unless it is assigned to a specific task and the task is configured to execute periodically or when triggered by a specified variable. In ProSafe-RS there is only one task. Every POU runs on the same scan sequence. Function Blocks (FBs) One of the most important building blocks within IEC 1131-3 for creating programs. Any FB can be programmed using other FBs. This helps to create programs that are well structured and truly hierarchical. 8-6 RSWB rev 1.2 Functions A software element which when executed, with a particular set of input values produces one primary result. Unlike a Function Block, it has no internal storage. Examples: SIN(), COS() functions Control flow Configurations and resources are responsible for the control and execution of elements in them. Configurations and resources can be started and stopped by external facilities such as Operator Interface o
收藏 下载该资源
网站客服QQ:2055934822
金锄头文库版权所有
经营许可证:蜀ICP备13022795号 | 川公网安备 51140202000112号