Compact Control Builder AC 800M 5.1
Total Page:16
File Type:pdf, Size:1020Kb
Compact 800 Engineering Compact Control Builder AC 800M 5.1 Planning Compact 800 Engineering Compact Control Builder AC 800M 5.1 Planning NOTICE The information in this document is subject to change without notice and should not be construed as a commitment by ABB. ABB assumes no responsibility for any errors that may appear in this document. In no event shall ABB be liable for direct, indirect, special, incidental or consequential damages of any nature or kind arising from the use of this document, nor shall ABB be liable for incidental or consequential damages arising from use of any software or hard- ware described in this document. This document and parts thereof must not be reproduced or copied without written per- mission from ABB, and the contents thereof must not be imparted to a third party nor used for any unauthorized purpose. The software or hardware described in this document is furnished under a license and may be used, copied, or disclosed only in accordance with the terms of such license. This product meets the requirements specified in EMC Directive 89/336/EEC and in Low Voltage Directive 72/23/EEC. Copyright © 2003-2010 by ABB. All rights reserved. Release: June 2010 Document number: 3BSE044222-510 TRADEMARKS All rights to copyrights and trademarks reside with their respective owners. TABLE OF CONTENTS About This Book General ..............................................................................................................................9 Document Conventions ...................................................................................................10 Warning, Caution, Information, and Tip Icons................................................................10 Terminology.....................................................................................................................11 Section 1 - Design Issues Introduction .....................................................................................................................13 Conceptual Issues ............................................................................................................14 Traditional Programming and Object-Oriented Programming ............................14 List-Driven Execution and Data Flow Driven Execution.....................................16 Libraries .............................................................................................................17 Code Organization................................................................................................19 Programming Languages .....................................................................................30 Structured Data Types ..........................................................................................30 Performance Issues..........................................................................................................31 Memory Consumption .........................................................................................32 Calculations and Performance Data .....................................................................32 Choosing Controller Hardware ............................................................................33 Distribution on Applications and Controllers ......................................................35 Limitations.......................................................................................................................39 OPC Server Limitations .......................................................................................40 Application Size Limit .........................................................................................40 Maximum Number of Controllers, Applications, Programs and Tasks ...............41 Maximum Number of POUs and Variables .........................................................42 INSUM Limitations .............................................................................................44 3BSE044222-510 5 Table of Contents Section 2 - Programming Languages General ............................................................................................................................45 Structured Text, ST .........................................................................................................47 Suitable for Complex Calculations and Looping.................................................47 High Threshold for Programmers ........................................................................48 Functions in ST....................................................................................................48 Function Block Diagram, FBD .......................................................................................49 Similar to Electrical Diagrams.............................................................................51 Boolean Functions and Feedback are Easy to Implement ...................................51 Not Suitable for Conditional Statements .............................................................52 Functions in FBD.................................................................................................52 Standard Function Block Types in FBD ..............................................................54 Ladder Diagram, LD .......................................................................................................59 Easy to Understand ..............................................................................................60 Weak Software Structure .....................................................................................61 Limited Support for Sequences............................................................................62 Difficult to Reuse Code........................................................................................64 Functions in LD ...................................................................................................64 Instruction List, IL ..........................................................................................................65 Best System Performance ....................................................................................66 Weak Software Structure .....................................................................................66 Machine-dependent Behavior ..............................................................................66 Functions in IL.....................................................................................................67 Example ............................................................................................................67 Result Register.....................................................................................................68 Sequential Function Chart, SFC......................................................................................69 Powerful Tool for Design and Structuring...........................................................70 Other Programming Languages are Needed........................................................71 Functions in SFC .................................................................................................71 Chart Structure.....................................................................................................73 Steps and Transitions ...........................................................................................74 Action Descriptions .............................................................................................75 6 3BSE044222-510 Table of Contents Sequence Selection and Simultaneous Sequences ...............................................76 Subsequences .......................................................................................................78 Advice on Good Programming Style ...................................................................79 Section 3 - Programming in Practice Introduction .....................................................................................................................81 Organizing Code..............................................................................................................81 Programming with Function Blocks ....................................................................82 Function Block Calls............................................................................................85 Function Block Execution....................................................................................86 Function Block Code Sorting...............................................................................88 Control Modules in Function Blocks ...................................................................89 Continuous and Event-Driven Execution of Function Blocks .............................92 Self-Defined Types...............................................................................................97 Structured Data Type Examples.........................................................................102 Code Sorting..................................................................................................................107 Code Loops ........................................................................................................108 Variable State .....................................................................................................109 NoSort Attribute.................................................................................................110 Interpret and Correct