Sie sind auf Seite 1von 22

Course T300, Engineering an 800xA System

Chapter 10 Control Modules

TABLE OF CONTENTS
Chapter 10 Control Modules........................................................................................................................................................ 10-1
10.1 General Information......................................................................................................................................................... 10-3
10.1.1 Description ................................................................................................................................................................ 10-3
10.1.2 Objectives.................................................................................................................................................................. 10-3
10.1.3 Reference Documentation......................................................................................................................................... 10-3
10.2 What are Control Modules? ............................................................................................................................................. 10-4
10.3 Difference between Function Block and Control Module .............................................................................................. 10-5
10.3.1 General Comparison ................................................................................................................................................. 10-5
10.3.2 Graphics .................................................................................................................................................................... 10-5
10.3.3 Execution and code sorting....................................................................................................................................... 10-5
10.4 When is it suitable to use Control Modules?................................................................................................................... 10-7
10.5 Using Control Modules.................................................................................................................................................... 10-8
10.5.1 Introduction ............................................................................................................................................................... 10-8
10.5.2 The Control Module editors...................................................................................................................................... 10-9
10.5.3 Create Control Module Instance............................................................................................................................... 10-9
10.5.4 Delete Control Module Instance............................................................................................................................. 10-11
10.5.5 Copy / Paste............................................................................................................................................................. 10-11
10.5.6 Connect Parameters ................................................................................................................................................ 10-12
10.6 Single Control Modules ................................................................................................................................................. 10-16
10.6.1 General .................................................................................................................................................................... 10-16
10.6.2 Create Single Control Module ................................................................................................................................ 10-16
10.6.3 Delete Single Control Module ................................................................................................................................ 10-18
10.6.4 Copy / Paste............................................................................................................................................................. 10-18
10.6.5 Create Control Modules below Single Control Module ........................................................................................ 10-20
10.6.6 Create Functions/Function blocks below a Single Control Module...................................................................... 10-20
10.6.7 Interaction Window ................................................................................................................................................ 10-21

10-1

Course T300, Engineering an 800xA System

10-2

Engineering an 800xA System

10.1 General Information


10.1.1 Description
This chapter describes the advantages of Control Modules and how to use and modify
them.

10.1.2 Objectives
On completion of this chapter you will be able to:

Describe the differences between Control Modules and Function Blocks.

Describe when it is suitable to use Control Modules.

Instantiate Control Module types.

Connect Control Modules to parameters/variables.

Use the graphical Control Module Diagram editor.

Create simple interaction windows associated to Single Control Modules.

10.1.3 Reference Documentation


Use the online help: Contents tab, Control Module Diagram Editor

10-3

Engineering an 800xA System


Chapter 10 Control Modules

10.2 What are Control Modules?


Control modules are suitable for representing complex process objects and for the
control of large applications. Working with control modules involves thorough objectoriented programming. As much of the object control as possible should be
encapsulated in the control module and the external dependency be minimized. Apart
from conventional programming, the control module design process may include
implementation of graphical interactivity.
The compiler determines the application data flow and execution order of control
modules automatically. Therefore, the final application becomes flexible and easy to
maintain as future additional control modules are integrated 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.

10-4

Engineering an 800xA System

10.3 Difference between Function Block and Control Module


10.3.1 General Comparison

10.3.2 Graphics
You 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 and supervision.

10.3.3 Execution and code sorting


A principal difference between control modules and function blocks is that code
blocks in 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 implemented by the programmer. Control modules are only executed
once per scan, whereas function blocks may be executed several times per scan.

10-5

Engineering an 800xA System


Chapter 10 Control Modules

Each task forms its own group of co-sorted control modules. One code sorting is
therefore performed for each group of control modules connected to the same task.
For control modules, the compiler analyzes each code block separately ( ST, IL, FBD,
and LD. The compiler then determines the optimal execution order; a code block that
assigns a value to a variable has to be executed before the block that reads the value.
This technique is called code sorting and means that the optimal execution order will
be based on data flow instead of program flow (as is the case for function blocks).
Code sorting guarantees that the code will be executed in the correct order. Code
sorting suppresses time-delays and results in that a new control module automatically
being correctly placed in the process.
For any function blocks called from control modules, only the parameter interface (in,
out, or in_out) affects the code block sorting. That is, no analysis is made of how the
function blocks actually use the parameters. In addition, function block references to
external variables do not affect the execution order of control module code blocks.
Within an SFC code block, only the N action parts (not P1 or P2 actions) are sorted.

10-6

Engineering an 800xA System

10.4 When is it suitable to use Control Modules?


Before you start to design an application, you should decide whether to use traditional
(sequential) program code and function blocks or an object-oriented solution based on
control modules.
As a general guideline, traditional programming is typically suitable for small
applications whereas control 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.

The 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 recommended 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 concentrate the control of a certain object to one code
location (facilitates maintenance)

10-7

Engineering an 800xA System


Chapter 10 Control Modules

10.5 Using Control Modules


10.5.1 Introduction
A Control Module can be created either from the Project Explorer directly (text
generated) or from a Control Module Diagram (graphics generated). The following
general properties apply:

A Control Module always has a parent 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


belonging to a function block (in online mode only).

Communication between two adjacent Control Modules is accomplished by


connecting the parameters of the Control Modules to common variables. These
variables must be declared in the surrounding POU. For Control Modules on the
first level in the application, variables can be declared by double-clicking on the
application name in the Project Explorer. Select the tab Variables.

10-8

If a global variable is going to be used inside a Control Module, an external


variable with the same name and data type must be declared in the Control
Module.

Engineering an 800xA System

10.5.2 The Control Module editors


The 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
variables 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 auto shapes
(lines, rectangles, etc.), but also ready to use interaction objects (Option Buttons,
Check Boxes, etc.) and composite objects (Bar Graphs, String Selectors, etc.). The
graphical objects are dynamic, that is points can move with changing variable values,
colors can change, numerical values can be presented, etc.

10.5.3 Create Control Module Instance


1. Right mouse click onto Control Modules folder and click onto CMD Editor.

Right
click

Left
click

10-9

Engineering an 800xA System


Chapter 10 Control Modules

2. The CMD editor window opens.

Left
click

3. Left mouse click onto the New Control Module icon and the Create a Control
Module window opens.
4. Select the AnalogInCC control module type in the ControlStandardLib library
5. Type in the instance name FI1001 and press the OK button.

6. Click onto the grid of the CMD editor window to place the control modul
symbol at a certain place.
7. The Connections window opens to create parameters related to your control
module.
8. Select the Name parameter field and type in FIC1001
9. Select the Description parameter field and type in TempTank1

10-10

Engineering an 800xA System

10. Click onto the Save and Close icon in the toolbar of the Connections window.
11. The control module symbol is placed on the CMD editor window.

10.5.4 Delete Control Module Instance


Open the folder Control Modules in an application and right click onto the control
module. Please click onto Delete then.

10.5.5 Copy / Paste


Create a copy of a control module instance:
1. Right click onto Control Modules folder and select CMD Editor.

10-11

Engineering an 800xA System


Chapter 10 Control Modules

Right
click

Left
click

2. The CMD editor window opens.


3. Left mouse click onto the control module symbol in the CMD editor window.
4. Right mouse click onto the control module symbol and left mouse click onto
Copy.
5. Left mouse click onto the free grid beside the symbol to delete any selection
by pointing to an empty space. Open the Context Menu then.

Left
click

6. Left mouse click on Paste and a copy of the control module is created.

10.5.6 Connect Parameters


Control modules can be connected to each other in two different ways; via graphics
and via text. Graphical connections are implemented in the application window or the
control module type window, and text-based connections in the connection editor.

10.5.6.1 Graphical Connection


A connection node consists of a small circle and associated text. The node can be
created in a control module and the text has to match a variable or parameter name in

10-12

Engineering an 800xA System

the control module. The name of a component of a structured data type variable can
also be used. The node will serve as a connector for the specified variable. A
connection is established by connecting two nodes with a graphical connection, drawn
as a polyline whose ends are within the node circles.
Connect two control modules graphically:
1. Right mouse click onto Control Modules folder and select CMD Editor.
2. Create an instance of the control module type AnalogInCC ( Name:FIC1001 )
3. Create an instance of the control module type Level6CC (
Name:FIC1001_AL)

Left
click

4. Left click onto the Graphical Connection icon from the Graphics Toolbar on
left side
5. Draw the connection: Double left click on the Output of AnalogInCC and then
double left click on the input of Level6CC

10-13

Engineering an 800xA System


Chapter 10 Control Modules

10.5.6.2 Textual Connections


Parameters 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 graphics then exist.
Connect a parameter to a variable textually:
1. Create a variable ( FIC1001 ) on application level ( see chapter 4 )
2. Right mouse click onto a control module ( FIC1001) and select Connections
Enter.

Right
click

Left
click

3. Select the Name parameter field and type in FIC1001


4. Select the Description parameter field and type in TempTank1
5. Select the AnalogInput parameter field and Press CTRL+J. This displays a
tree control from which you can select the variable.

10-14

Engineering an 800xA System

6. Double click onto the variable FIC1001 to assign it to the AnalogInput


parameter.
7. Create a new variable FIC1001_OUT and assign it to the Out parameter.

10-15

Engineering an 800xA System


Chapter 10 Control Modules

10.6 Single Control Modules


10.6.1 General
A certain kind of control module type - the Single control module - constitutes a way
of grouping graphical objects, variables, parameters, and other control modules into a
single unit. Function and Function blocks can also assigned to a Single control modul.
Single control modules are intended to be used only once and are thus not re-usable. A
single control module can be regarded as a control module type and a control module
at the same time. Optionally, a single control module can be regarded as a control
module type from which only one control module is derived.

10.6.2 Create Single Control Module


Create a Single Control Module:
1. Right mouse click onto Control Modules folder and select CMD Editor.

Right
click

Left
click

2. The CMD editor window opens.

10-16

Engineering an 800xA System

Left
click

3. Left click onto the New Empty Single Control Modul icon .
4. Left click onto the grid of the CMD editor window to place the Single control
modul symbol at a certain place.
5. The Control Module Name window opens.
6. Select the Name field and type in FIC1002 and press the OK button.

7. The Single control module editor window opens.

10-17

Engineering an 800xA System


Chapter 10 Control Modules

10.6.3 Delete Single Control Module


1. Open the folder Control Modules in an application.
2. Right mouse click onto the Single control module and click onto Delete.

Right
click

10.6.4 Copy / Paste


Create a copy of a Single control modul instance:
1. Open the Control structure in PP.

10-18

Left
click

Engineering an 800xA System

2. Right mouse click onto the Single Control Module ( FIC1002 ) and click on
Copy.

Right
click

Left
click

3. Right mouse click onto Control Modules folder and click on Paste.

4. A copy is created with the name FIC1002_1.

10-19

Engineering an 800xA System


Chapter 10 Control Modules

10.6.5 Create Control Modules below Single Control Module


Create a new control modul instance below a Single Control Module:
1. Right mouse click onto a Single Control Module and click onto CMD Editor.
2. With the CMD editor create a new instance of a control module ( see chapter
5.2.1 )

Right
click

Left
click

10.6.6 Create Functions/Function blocks below a Single Control Module


Application programming with Single control modules can be performed with any of
the five languages specified in the IEC 61131-3 standard.
Create a new Function below a Single Control Module:
1. Right mouse click onto a Single Control Module and left mouse click onto
Editor.

Right
click

10-20

Left
click

Engineering an 800xA System

2. The Editor window opens.


3. Do the configuration as described in chapter 3

10.6.7 Interaction Window


The CMD editor makes it possible to add graphical contents to a Control Module. A
number of interaction objects such as push buttons, input fields etc. can be used. For
status indication, color-coded circles, polygons etc. can be used. Control Module
graphics is a useful feature in for example the following cases:

During the development of the application, an interaction window makes it easy to


manipulate variable and parameter values.

During commissioning, the graphics can be used for simulating the response from
parts of the plant that may not be available yet.

As a maintenance tool for process objects, a graphical faceplate can show the
status of interlocks, allow manual operation etc.

By creating hierarchic graphical structures, navigation in the application becomes


very quick. As soon as the wanted Control Module is located, the POU editor for
this CM is directly available by pressing [Ctrl+M] and right clicking on it.

Hierarchic structures, where you zoom into a Control Module to see any objects
within, is accomplished by allowing each Control Module to have two layers of
graphical content: one directly visible to the user and one hidden beneath. The latter is
then reached by using the zoom tool or by using an interaction object on the first layer.
The picture below shows two examples of interaction windows, one for manual
operation of a process object and the other for tuning a PID controller..

10-21

Engineering an 800xA System


Chapter 10 Control Modules

Note that the Control Module graphics is not intended as a substitute to an HMI. It is
meant to be a complementary tool, to be used for testing, maintenance and navigation.

Tools in the CMD Editor


A number of tools are available in the CMD editors toolbox. Some of the more
important are mentioned here:

10-22

Command button

Input field

Text tool

. Used for creating static or dynamic texts.

Oval tool

. Used for drawing circles and ovals.

Polygon tool

. Used for manipulating Boolean variables.

, for input of string or real values.

. Used for drawing triangles etc.

Das könnte Ihnen auch gefallen