1、 Connect Control Modules to parameters/variables. Use Control Modules in the graphics. Modify a Control Module. Create Control Modules using other Control Modules, in a new library. Visualizing the program using graphics. Describe the idea of object orientation. Describe the advantages/drawbacks of
2、connecting to I/O in different depths (to global variables, to program variables, to FB variables, using an I/O-record etc.). Create simple interaction windows associated to Function Blocks or Control Modules.17.1.3 Reference DocumentationUse the online help: Contents tab, Control Module Diagram Edi
3、tor17.2 Lesson 1 - Using Control Modules17.2.1 DescriptionThis lesson describes the advantages of the ABB Control Modules and is an introduction to how an Application can be organized when using them.17.2.2 ObjectivesOn completion of this lesson you will be able to:17.2.3 GeneralThe Control Module i
4、s the main structuring element for controller application programming. It is a self-executable container for application program code and graphics. Because a Control Module involves graphical objects, you create it by using not only the POU Editor, but also the Control Module editor. Control Modules
5、 are suitable for representing complex process objects and control of large applications. Working with Control Modules involves thorough object oriented programming, as much of the object control as possible should be encapsulated in the Control Module and the outward dependency should be minimized.
6、 Apart from conventional programming, the Control Module design may involve implementation of graphical interactivity.The compiler determines the application data flow and execution order of Control Modules automatically. Therefore, the final application gets flexible and easy to maintain as integra
7、tion of future additional Control Modules are done automatically. Control Modules can be structured hierarchically in a number of levels. You can use the same Control Module Type for several Control Modules, each performing different tasks depending on parameter connections.17.2.4 Difference between
8、 Function Block and Control Module17.2.4.1 General ComparisonThe most important differences between Control Modules and Function Blocks are summarized in the table below.PropertyControl ModuleFunction BlockExecution order*Automatic; compiler determined, based on data flow.Manual; code statements, ba
9、sed on program flow.Execution per scanThe code blocks are always executed once per scan according to data flow analysis.A function block can be called and executed, zero, one, or several times per scan.Static parameter connections*Yes. A most important feature: A static parameter connection does not
10、 change during execution; it can only be changed via code changes and recompilation. The static connections are set at compile time and yields efficient code generation; powerful, compiler-based program analysis; and better performance.No. Parameters are copied each time the Function Block is execut
11、ed according to the IEC61131-3 standard. For deep and complex hierarchies, the parameter copying of function blocks costs significant CPU time.Graphics*Yes, in three different ways; free-layout programming, supervision, and interaction.Indirectly via inclusion of sub Control Modules.ParametersIn_out
12、, can be connected to graphics. Connections cannot be inverted: NOT actual parameter name is invalid.).In, Out, or In_out, only In- and Out parameters can be connected to sub control modules.Together, the properties marked with * facilitate design of application libraries and re-use of complex appli
13、cation building blocks.17.2.4.2 GraphicsYou can design a Control Module to include interactive and supervisory process pictures (such as command buttons, input fields and trend curves). In addition, Control Modules can be represented by certain interactive icons which facilitates the process control
14、 and supervision.17.2.4.3 Execution and code sortingThe main difference between Control Modules and Function Blocks is that Control Modules are executed in an order based on optimal data flow, as determined by the compiler. The execution order of Function Blocks follows the program flow as implement
15、ed by the programmer. Control Modules are only executed once per scan whereas Function Blocks may be executed several times per scan.17.2.5 When is it suitable to use Control ModulesBefore you start to design an application, you should decide whether to use traditional (sequential) program code and
16、function blocks or an object-oriented solution based on control modules. Apart from personal preferences, the choice would typically depend on application size and the need for re-usable objects.As a general guideline, traditional programming is typically suitable for small applications whereas cont
17、rol modules are recommended for large applications. Control modules support object-oriented programming and code re-use to a greater extent and therefore make a large application more flexible and easier to maintain.The subsequent implementation will follow one of the branches in the figure below.Th
18、e figure shows that also the object-oriented solution typically involves function blocks. This is because object orientation below a certain complexity level is not justifiable. In this case, traditional programming with function blocks constitutes the most rational alternative.In summary, it is rec
19、ommended to use control modules rather than function blocks in the following cases: For large applications (increased performance) For process objects (code sorting facilitates application structuring) When a flexible solution is needed (object orientation; re-use is desired) When there is a need to
20、 concentrate the control of a certain object to one code location (facilitates maintenance) 17.2.5.1 The Control Module editorsThe Control Module editor is a combined tool for drawing and programming, it allows you to create and edit the graphical objects of a Control Module and then connect variabl
21、es to these objects. It also gives you direct access to the POU editor, in which you write the Control Module code and declare variables and parameters.You can both create new Control Modules and edit already existing ones with the Control Module editor. The drawing functions include not only basic
22、auto shapes (lines, rectangles, etc.), but also ready to use interaction objects (Option Buttons, Check Boxes, etc.) and composite objects (History Graphs, String Selectors, etc.). The graphical objects are dynamic, that is points can move with changing variable values, colors can change, numerical
23、values can be presented, etc.17.2.6 Creating a Control Module17.2.6.1 IntroductionA Control Module can be created either from the Project Explorer directly (text generated) or from a Control Modules Window (graphics generated). The following general properties apply: A Control Module always has a pa
24、rent POU. This POU Type can be a Control Module Type, Function Block Type, or an application. A Control Module can be shown graphically inside the graphic of the parent (if the parent is a module type or an application). A Control Module can also be shown (stand alone) in an interaction window (in o
25、nline mode only).17.2.6.2 Create a New, Graphics-Generated Control ModuleRight-click on a control module type in the project tree and select the Graphics entry to open the Control Module Type Window. Double-click in the drawing area to activate the grid. Select CreateControl Module. to open the Crea
26、te a Control Module dialog box in which you specify the Control Module name and associated Type. Except for that a graphics-generated Control Module by default becomes graphically visible, the above principles apply.17.2.7 ConnectionsControl Modules can be connected to each other in two different wa
27、ys; via graphics and via text. You implement graphical connections in the control modules window or the control module type window and text-based connections in the Connection Editor.You can reach the Connection Editor via the Connections entry, accessible when a control module is selected, choose (
28、ObjectsConnections) or Connections from right-click pop-up menu. A control module designed to be graphically connected have to be built with the nodes in place, ready for later connection. Graphical connections are suitable for obtaining a comprehensive view of main flows, for example in a PID Contr
29、oller comprising an input control module, a main control module, and an output control module. (Yet, observe that abundant use of graphical connections may slow down the system.)17.2.7.1 Textual connectionParameters can be connected to actual variables in the connection list of the Connection Editor. It is not possible to connect the same parameter both graphically and textually. Textual connection is the only way to connect parameters when the control module is subordinate to a Function Block, as no surrounding graphics then exist.17.2.7.2 Graphical connectionGraphical
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1