Professional Documents
Culture Documents
TABLE OF CONTENTS
Chapter 3 Type design ................................................................................................................................................................... 3-1
3.1 General Information ............................................................................................................................................................. 3-3
3.1.1 Description .................................................................................................................................................................... 3-3
3.1.2 Objectives...................................................................................................................................................................... 3-3
3.1.3 Reference Documentation............................................................................................................................................. 3-3
3.1.4 Steps to go ..................................................................................................................................................................... 3-3
3.2 Control Library..................................................................................................................................................................... 3-4
3.2.1 General .......................................................................................................................................................................... 3-4
3.2.2 Create Control Library.................................................................................................................................................. 3-4
3.2.3 Connect a Library to an Application ............................................................................................................................ 3-5
3.2.4 Versioning ..................................................................................................................................................................... 3-5
3.2.5 Protection ...................................................................................................................................................................... 3-9
3.2.6 Import/Export Library................................................................................................................................................. 3-10
3.3 User Defined Structured Data Types................................................................................................................................. 3-11
3.3.1 Components................................................................................................................................................................. 3-11
3.3.2 Dot Notation................................................................................................................................................................ 3-12
3.3.3 Project Constants......................................................................................................................................................... 3-12
3.4 Function Blocks Types....................................................................................................................................................... 3-14
3.4.1 Creating a Function Block Type................................................................................................................................. 3-14
3.4.2 Function Block Type Editor ....................................................................................................................................... 3-14
3.4.3 Code Block.................................................................................................................................................................. 3-15
3.4.4 Languages.................................................................................................................................................................... 3-15
3.4.5 Protection of code ....................................................................................................................................................... 3-15
3.4.6 Create Function Block Type from existing one ......................................................................................................... 3-17
3.5 Control Modules Types...................................................................................................................................................... 3-18
3.5.1 Create new Control Module Type .............................................................................................................................. 3-18
3.5.2 Open POU editor......................................................................................................................................................... 3-18
3.5.3 Parameters ................................................................................................................................................................... 3-18
3.5.4 Variables...................................................................................................................................................................... 3-18
3.5.5 External Variables....................................................................................................................................................... 3-18
3.5.6 Code Blocks ................................................................................................................................................................ 3-18
3.5.7 Languages.................................................................................................................................................................... 3-19
3.5.8 Protection of code ....................................................................................................................................................... 3-19
3.5.9 Interaction Window..................................................................................................................................................... 3-19
3-1
3-2
3.1.2 Objectives
After completion of this chapter you will be able to
3.1.4 Steps to go
3-3
Library Aspect
Library Structure is the main place where to deal with the operations of the
libraries like open, close or where to connect different libraries to the library.
Object Type Structure is the structure where to build the single object types,
like Function Block Types, Control Module Types and Data Types.
3-4
3. Select the library which should be connected from the list and click OK.
4. Select the Library from the list and click OK. The Library is now connected to
the Application.
3.2.4 Versioning
3.2.4.1 Library States
A Library Version has a state. This state is used to describe how a library (version) can
be used. The states a library can be in are: Open, Closed or Released.
In the open state the contents of the Library Version may be edited. When editing
temporarily is completed, the library can be closed.
When a Library is closed then it cannot be edited but it can be reopened to allow
additional edits.
When a Library Version has been released then it can no longer be changed. If any
modifications are necessary then a new version of the library must be created.
Note that a library cannot be released unless all libraries it depends on are released.
3-5
Open
Create
Edit
Closed
Release
Released
Close
New Version
3.2.4.1.1 Release
Use the Process Portal to release a library.
1. Open the Object Type Structure and here the library Advanced 1.0-0. Select
the aspect Library Version Definition and open the Config View for it.
2. Select the tab card General from the Config View. Close the library by the
state close and click Apply to save the changes.
3. In this state you are able to open the library again. Please try this and after this
select the Close state like before.
4. After a library was set to close the Release state is freed. Please select the
Release state. After clicking Apply the other states of this library are locked
and will not get active again. The only way to change something in this library
is to create a new version of it.
5. Please click Apply to release the library.
3-6
3. In the Object Type Structure there is a new version object Advanced 1.1-0
existing as well. If we compare the old version with the new we can see that
the new version is a copy of the old. The difference is that the new version got
the state Open.
3-7
3-8
1. Select the Control Application Appl_Tank1 in the Control Builder and open
the Context menu for the child object Connected Libraries.
2. Select the entry Connect Library from the list.
3. Connect the new library version by selecting the fitting item from the list.
3.2.5 Protection
You can protect your library so that no other is able to view the content of it.
1. Right click on the library and select Properties Protection
3-9
3-10
3.3.1 Components
The variables in the structured Data Type are called Components.
3.3.1.1 Name
It is best to give the components simple and explanatory names.
3.3.1.3 Attributes
Press < Ctrl+J > in the Attribute column, to find a suitable attribute to be assigned.
Attributes
Name
Description
No attribute
The value of the variable is not maintained after a restart. Instead it is set
to the initial value of the variable. If the variable has no initial value
assigned to it, it will get the default value of the data type (see table in
page 6.3)
retain
The value of the variable is maintained after a warm restart. The system
sets retain on all variables by default. To override this the attribute must be
left empty.
coldretain
constant
3-11
The variable will not be visible to the OPC server, and therefore not
available in the HMI system.
3.3.1.5 Description
In the description fields a short description can be written at declaration of the Data
Type component.
If you want to set the Full component of the Tank variable to 1 (i.e. "True"), write:
tank.full := true ;
The rest of the subordinate variables are accessed in a similar way. A structured data
type is a data type that contains several components and can thus have several values,
one for each component.
3-12
(must be a user defined library) and select Project constants. Any project constant
declared in a library will be a part of that library. They will however also be
incorporated in the main list of project conctants in the Tools>Project Constants
menu.
3-13
3-14
Parameters Variables that passes values in or out from the program. The
parameters have Directions, indication if the parameter is read or written by the
Function Block. The options are: in, out and in_out. N.B.It is not allowed to assign
an initial value to a parameter
Function blocks. You must explicitly declare function blocks to use them inside
the Function Block Type editor. Remember: when using the FBD or LD
languages, the declaration of the function block instance will be made
automatically when the function block is inserted.
Attributes
Name
Description
No attribute
The value of the variable is not maintained after a restart. Instead it is set
to the initial value of the variable. If the variable has no initial value
assigned to it, it will get the default value of the data type (see table in
page 6.3)
retain
coldretain
The value of the variable is maintained after a warm restart. The system
sets retain on all variables by default. To override this the attribute must be
left empty.
The value of the variable is maintained after a warm or cold restart.
This attribute overrides the retain attributes in a structured data type.
You cannot change the value of the variable once given.
constant
hidden
Direction
Available: IN, OUT and IN_OUT.
Initial Value
The initial values of this function block type.
3.4.4 Languages
The Code Block supports five different languages.
The languages are described in the T300 course: Engineering an 800xA system.
3-15
3-16
3-17
3.5.3 Parameters
The Parameters of a Control Module Type are approximately identical to the
parameters of a Function Block Type. Chapter 3.4 Function Blocks Types provides
detailed information.
Two additional parameter properties exist for Control Module types, Attributes and
Direction.
3.5.4 Variables
The Variables of a Control Module Type are identical to the Variables of a Function
Block Type. Chapter 3.4 Function Blocks Types provides detailed information.
3-18
3.5.7 Languages
The Code Block Languages of a Control Module Type are identical to a Function
Block Type. Chapter 3.4 Function Blocks Types provides detailed information.
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.
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..
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.
3-19
Command button
Input field
Text tool
Oval tool
Polygon tool
Interaction objects make it possible for the user to change the value of variables, open
and close windows or open (not close) any text editor/word processor in online mode.
Interaction objects used for changing values of variables are available as two types;
graphical and non-graphical.
This chapter introduces the setup of a graphical Interaction Window.
3-20
4. Right click on the outline of the new Input Field and select the menu item
Interaction Attributes
3-21
5. The Interaction Attributes defines the kind of data (property) the Input Field
should be connected to.
6. Select the Input Field data type Real
7. Click on the question mark for Variable. All variables with the data type real
are shown in a window. These variables are localized in our Control Module
Type CM_GenGeneration.
3-22
9. The allocation to the variable Output is placed. Please accept the dialog by
clicking the OK button.
10. Close the CMD Editor by clicking the Windows Close Icon
11. The setup of our Interaction Window is finished now
3-23