Fisher ControlWave Designer Reference Manual Manuals & Guides

TION 1 FIRST PAGE HEADER - ODD
A-1SECTION 1 FIRST PAGE FOOTER - ODD
SECTION 1 – EVEN HEADER
NOTICE
The information in this document is subject to change without no tice. Every effort has been made to supply complete and accurate information. However, Bristol Babcock assumes no responsib ility for an y er ror s that may appear in this document.
Th er e are no warranties, expressed or implied, including t ho se of mercha nt ability a nd fitness for a particular purpose, concerning the software and other materials delivered herewith.
Request for Additional Instructions
Additional copies of instruction manuals may be ordered from the address below per attention of the Sales Order P r ocessing Department. List t he instruction book numbers or give the comp lete mod el, serial or softw ar e ve rs ion number . Furnish a r eturn address t hat includes t he name of the pe rson who w ill receive the material. Billing for ex tra copies will be according to current pricing schedules. Only CURRENT revisions of manuals are available.
This manual was adapted from the MULTIPROG wt manual, created by KW Software.
_
MULTIPROG wt is a registered trademark of Kl
Other trademarks or co pyrighted products mentioned in this document are for information only, and belong to their respective companies, or trademark holders.
Copyright (c) 2001, Bristol Babcock, 1100 Buckingham St., Watertown, CT 06795. No part of this manual may be reproduced in any form without the express written permission of Bristol Babc ock.
pper und Weige Software GmbH.
SECTION 1 – FOOTER - EVEN
A Few Words About Bristol Babcock
For over 100 years, Bristol has been providing innovative solutions for the measurement and control industry. Our product lines range from simple analog chart reco r d er s, to so phisticated digital remote process controllers and flow computers, all the way to turnkey SCADA systems. Over the years, we have become a leading supplier to the electro nic gas measurement, water purification, and wastewater t r eatment industries.
On off-shore o il platforms, on natural gas pipelines, and maybe even at your local water company, there are Bristo l Babcock instruments, contr ollers, and systems running year-in and year-out to provide accurate and timely data to ou r customers.
Getting Additional Information
In addition to the information contained in this manual, you may receive additional assistance in using this product from the following sources:
Contacting Bristol Babcock Directly
Bristol Babcock’s world headquarters are located at 1100 Buckingham Street , Water town, Connecticut 06795 USA.
Our main phone numbers are:
(860) 945-2200 (860) 945-2213 (FAX)
Regular office hours are Monday through Friday, 8:00AM to 4:30PM Eastern Time, excluding holidays, and scheduled factory shutdowns. During other hours, callers may leave messages using Bristol’s vo ice mail syst em.
Telephone Support - Technical Questions
During regular business hours, Bristol Babcock’s Application Support Group can pro vide telephone support for your technical questions.
For technical questions about Cont rolWave call (860) 945-2244 or (860) 945-2286.
For technical quest ion s reg ar ding Bristol’s OpenEnterprise product, call (860) 945-2501 or e­mail: openenterprise@bristolbabcock.com
For technical questions regarding ACCOL products, Open BSI Utilities, as well as Bristo l’s
®
Enterprise Server
/ Enterprise Workstation® products, call (860) 945-2286.
-i
For technical questions about Net work 3000 hardware call (860) 945-2502.
For technical questions about TeleFlow products call (860) 945-8604.
You can e-mail the Application Support Group at: bsupport@bristolbabcock.com
The Application Support Group maintains an area on our web site for software updat es and other technical information. Go to: www.bristolbabcock.com/services/techsupport/
For assistance in interfacing Bristol Babcock hardware to r a dios, contact Communication
Technologies in Orla ndo, FL at (407) 629-9463 or (407) 629-9464.
Telephone Support - Non-Technical Questions, Product Orders, etc.
Questions of a non-technical nature (product orders, literature r equests, price and delivery information, etc.) sho uld be directed to the nearest sales office (listed below) or to your Bristol­authorized sales representative.
Major U.S. Sales Offices Major International Sales Offices:
Watertown, CT (860) 945-2262 Bristol Babcock Ltd (UK): (441) 562-820-001 Birmingh a m, AL (205) 980-2010 Bristol Babcock, Canada: (416) 675-3820 Ontario, CA (909) 923-8488 Bristol Babcock Asia Pacific 61-8-9791-3654 Farmingt on, NM (505) 327-3271 BBI, S.A. de C.V. (Mexico) (525) 254-2131 Houston, TX (713) 685-6200 Richardson, TX (972) 238-8935
Please call the main Bristol Babcock number (860-945-2200) if you are unsure which office covers your particular area.
Visit our Site on the World Wide Web
For general information about Bristol Babcock and its products, please visit our site on the World Wide Web a t: www.bristolbabcock.com
Tra ining Courses
Bristol Babc ock’s Tra ining Department offers a wide va riety of co ur ses in Bristol har dwar e and software at our Watertown, Connecticut headquarters, and at selected Bristol regional offices, throughout the year. Contact our Training Department at (860) 945- 2269 for cou rse informatio n , enrollment , pricing , and sch ed ules.
ii

Who Should Read This Document?

Th is document is in tended t o b e r ead by a System E n gineer who will be using Contr olWave Designer software to configure their ControlWave contro ller. This manual was adapted from the Kl_pper und Weige (KW) MULTIPROG wt manual.
Th is document assu mes familiarity with the follo wing subjec ts:
Windows™ applications and PC’s. I n p a rt icular , use rs must b e fa milia r w ith how to p oint a nd
click with a mouse, enter data in dialog boxes, make selections, etc.
IEC 61131 terminology. If you are unfamiliar with the se sub jects , please consult t he help files
(accessible via the question mark '?' menu item in ControlWave Designer).
ControlWav econtro ller hardware . This documen t ass umes the controller has been inst alled
and tested, and t hat ControlWave software has also been installed. For information on the Contro lWave hardware, please consult document# CI-Cont r olWave.
-iii
iv
Contents
INTRODUCTION........................................................................................................... 1-1
ControlWave Designer - a highly efficient, powerful and complete tool.....................1-1
What kind of documentation do you get?..................................................................1-2
Symbols and textual conventions..............................................................................1-3
CONTROLWAVE DESIGNER AND IEC 61131-3.............................................................2-1
What is IEC 61131-3?...............................................................................................2-1
Configuration elements..............................................................................................2-2
Configurations.......................................................................................................2-2
Resources.............................................................................................................2-2
Tasks....................................................................................................................2-2
Configurations elements.......................................................................................2-3
POUs, programs, function blocks and functions........................................................2-4
Program organization units - POUs ......................................................................2-4
POUs....................................................................................................................2-6
Instantiation ..........................................................................................................2-6
Declaration and instruction part of a POU.............................................................2-7
Variables and data types...........................................................................................2-8
Projects ...................................................................................................................2-10
Libraries...................................................................................................................2-10
Programming languages and SFC..........................................................................2-11
GETTING STARTED..................................................................................................... 3-1
System requirements.................................................................................................3-1
Hardware requirements.........................................................................................3-1
Software requirements..........................................................................................3-1
Installing the program................................................................................................3-2
Calling the program...................................................................................................3-2
Using mouse and keyboard.......................................................................................3-3
User interface............................................................................................................3-4
ControlWave Designer Refer ence M anual Contents i
Menu.....................................................................................................................3-5
Toolbars................................................................................................................3-8
Defining keyboard shortcuts with the Shortcut Manager.....................................3-10
Main screen and workspace ...............................................................................3-15
Message window................................................................................................3-16
Cross reference window......................................................................................3-17
Status bar ...........................................................................................................3-21
Using help...............................................................................................................3-22
Editors.....................................................................................................................3-24
The project manager - a powerful tool for program organization.........................3-24
The graphic editor - easy programming in SFC, FBD and LD .............................3-26
The text editor - easy programming in IL and ST................................................3-27
The pagelayout editor - creating pagelayouts for printing...................................3-27
The Edit Wizard .......................................................................................................3-28
Overview window for graphical worksheets.............................................................3-32
Exiting worksheets...................................................................................................3-33
Exiting the program.................................................................................................3-34
HANDLING AND EDITING PROJECTS ............................................................................. 4-1
Creating a new project...............................................................................................4-1
Creating a new project using the Project Wizard ..................................................4-1
Creating a new project using a template...............................................................4-3
Changing the properties of existing POUs.................................................................4-5
Inserting new POUs...................................................................................................4-7
Inserting worksheets..................................................................................................4-8
Announcing libraries................................................................................................4-10
Deleting worksheets, POUs or libraries...................................................................4-12
Saving changes in worksheets while editing...........................................................4-13
Saving the existing project under a new name ........................................................4-14
Zipping the project files into an archive file..............................................................4-15
Saving an existing project as a template.................................................................4-16
Translating the project language.............................................................................4-17
Exporting a project translation file.......................................................................4-17
Importing a project translation file.......................................................................4-19
Switching the project language...........................................................................4-20
ControlWave Designer Refer ence M anual Contents ii
LITERALS, DATA TYPES AND VARIABLES...................................................................... 5-1
Literals.......................................................................................................................5-1
Numeric literals.....................................................................................................5-1
Character string literals.........................................................................................5-2
Duration literals.....................................................................................................5-2
Introduction to the IEC data types.............................................................................5-2
Elementary data types...............................................................................................5-3
Generic data types....................................................................................................5-4
User defined data types ............................................................................................5-4
Array data types........................................................................................................5-5
Declaring arrays....................................................................................................5-5
Programming example..........................................................................................5-6
Multi-dimensional arrays.......................................................................................5-7
Initializing arrays...................................................................................................5-7
Structured data types................................................................................................5-8
Programming example..........................................................................................5-8
Arrays of structures...............................................................................................5-8
Structures with arrays ...........................................................................................5-9
Initializing structures .............................................................................................5-9
String data types .....................................................................................................5-10
Declaring strings.................................................................................................5-10
Programming example........................................................................................5-10
Calling the text editor with the data type worksheet ................................................5-10
Editing type declarations using the Edit Wizard.......................................................5-11
Symbolic, located variables and directly represented variables...............................5-13
Global and local variables .......................................................................................5-14
Retentive variables..................................................................................................5-14
Initializing variables .................................................................................................5-15
Variable declaration keywords.................................................................................5-15
Declaring variables..................................................................................................5-18
Instantiation.............................................................................................................5-20
ControlWave Designer Refer ence M anual Contents iii
EDITING IN ST............................................................................................................6-1
Calling the text editor with a ST worksheet................................................................6-1
Introduction to ST......................................................................................................6-2
Inserting and editing assignment statements............................................................6-3
Inserting and editing further statements....................................................................6-4
Inserting statements using the Edit Wizard ...............................................................6-5
Inserting variables.....................................................................................................6-7
Calling functions or function blocks using the Edit Wizard.......................................6-10
EDITING IN IL............................................................................................................. 7-1
Calling the text editor with an IL worksheet...............................................................7-1
Instructions, operators, modifiers and operands........................................................7-2
Inserting instructions using the Edit Wizard...............................................................7-4
Inserting variables.....................................................................................................7-6
Using jumps and labels .............................................................................................7-9
Calling functions or function blocks using the Edit Wizard.......................................7-10
EDITING IN FBD......................................................................................................... 8-1
Calling the graphic editor with a FBD worksheet.......................................................8-1
Introduction to FBD ...................................................................................................8-2
Inserting functions and function blocks using the Edit Wizard ...................................8-3
Changing the properties of functions and function blocks.........................................8-5
Replacing functions and function blocks ...................................................................8-6
Inserting variables.....................................................................................................8-6
Connecting objects....................................................................................................8-9
Negation of inputs and outputs................................................................................8-13
Duplicating inputs of functions.................................................................................8-14
EDITING IN LD ........................................................................................................... 9-1
Calling the graphic editor with a LD worksheet..........................................................9-1
LD networks, contacts, coils and power rails.............................................................9-2
Inserting contacts and coils.......................................................................................9-4
Inserting serial contacts and coils..............................................................................9-5
Inserting parallel contacts or coils..............................................................................9-6
Using the LD branch edit mode.................................................................................9-7
Changing the properties of contacts and coils...........................................................9-8
Inserting variables...................................................................................................9-11
Calling functions or function blocks using the Edit Wizard.......................................9-11
ControlWave Designer Refer ence M anual Contents iv
EDITING IN SFC....................................................................................................... 10-1
Calling the graphic editor with a SFC worksheet.....................................................10-1
Introduction to SFC .................................................................................................10-2
Inserting a first SFC network...................................................................................10-3
Inserting more steps and transitions........................................................................10-4
Changing an initial step into a normal step or vice versa.........................................10-6
Inserting alternative branches .................................................................................10-7
Inserting simultaneous branches .............................................................................10-9
Using the SFC branch edit mode ..........................................................................10-11
Inserting variables for actions................................................................................10-12
Inserting variables for transitions...........................................................................10-14
Calling functions....................................................................................................10-18
Action and transition details...................................................................................10-18
COMPILING, DOWNLOADING AND DEBUGGING ............................................................11-1
Inserting configurations, resources and tasks.........................................................11-1
Associating programs to tasks.................................................................................11-4
Compiling a project..................................................................................................11-5
Compiling a project using ’Make’.............................................................................11-6
Patching POUs ........................................................................................................11-8
Downloading the project........................................................................................11-10
Calling worksheets in online mode........................................................................11-13
Adjusting the online layout and notation of online values......................................11-17
Switching between online and offline mode ..........................................................11-18
Switching to address status and powerflow...........................................................11-19
Forcing and overwriting variables..........................................................................11-21
Setting and resetting breakpoints..........................................................................11-23
Debugging with set breakpoints ............................................................................11-25
Using the watch window ........................................................................................11-27
Debugging user defined data types using the watch window................................11-29
Using the Logic Analyzer .......................................................................................11-31
ControlWave Designer Refer ence M anual Contents v
PRINTING YOUR PROJECT WITH A CUSTOMIZED PAGELAYOUT...................................... 12-1
Printing the project..................................................................................................12-1
Controlling the print process using the dialog ’Print Project’ ...............................12-1
Defining a pagelayout as default pagelayout......................................................12-4
Using the pagelayout editor.....................................................................................12-6
Creating a new pagelayout.................................................................................12-6
Defining the source area.....................................................................................12-7
Inserting elements in your pagelayout................................................................12-9
Editing environment items.................................................................................12-10
Using preview........................................................................................................12-11
ControlWave Designer Refer ence M anual Contents vi
Introduction

This chapter provides information about...

o
the programming system
o
the system documentation
o
conventions used in this manual
ControlWave Designer Refer ence M a nual Introduction
BLANK PAGE

Introduction

ControlWave Designer - An Introduction
ControlWave Designer was developed using the industry leading KW
Software MULTIPROG wt tools, to provide an IEC 61131-3 programming environment for ControlWave Process Automation Controllers. MULTIPROG wt supports development and debugging of IEC 61131-3 programs. ControlWave Designer extends the capabilities of MULTIPROG wt to provide additional process control, alarming, and historical data storage functionality.
The ControlWave Process Automation Controller uses KW Software’s ProConOS high performance runtime engine to execute the application load programs created using ControlWave Designer. The same ProConOS runtime engine is used within the I/O Simulator to allow the user to run simulations of application load programs, for testing and debugging purposes, on the PC, prior to downloading them into the ControlWave controller.
The programming system offers powerful features for the different developing phases of a PLC application:
Edit Compile Debug Print
The programming system is based on a modern 32 bit windows technology, providing comfortable handling using zooming, scrolling, customizable toolbars, drag & drop operations, a shortcut manager and dockable windows.
The system allows especially handling of several configurations and resources within one project, including libraries and disposes of a powerful debug system. Projects are displayed and can be edited using a comfortable project tree editor in order to make the complexity of the IEC 61131-3 structure as simple and transparent as possible. Owing to the
ControlWave Designer Refer ence M a nual Introduction 1-1
project tree editor easy inserting and editing of POUs, Data Types, Libraries and configuration elements is possible.
The programming system consists of a PLC independent kernel for programming in the various IEC programming languages, such as the textual languages ST and IL as well as the graphical languages FBD, LD and SFC. Each editor provides an Edit Wizard for fast and easy inserting pre-edited keywords, statements, operators, functions and function blocks. The Edit Wizard can also be used to declare variables and data types. The independent kernel is completed with specific parts adapted to the different PLCs.
The new easy Online handling and the 32 bit simulation offers fast powerflow debug functionality and a real time multitasking test environment.
A comfortable tool for project documentation is implemented for printing the project documentation alternatively in a time-saving optimized way (using less paper) or with a stylish customized page layout.
What kind of documentation do you get?
The documentation is divided into several parts. For an understanding of all parts we are assuming knowledge about using MS-Windows.
Getting Started with ControlWave Designer (document# D5085) - This manual contains introductory examples for generating a simple ControlWave program, setting up alarming, and configuring historical data storage.
ControlWave Designer Reference Manual (document# D5088) - THE DOCUMENT YOU ARE READING RIGHT NOW. This manual provides all background information for a better understanding of the concepts of the PLC programming system and of the operations to be done. All steps from starting the program, editing worksheets up to exiting are described with several examples and figures. The manual should be used by users wishing to get a complete overview about how to realize a PLC program.
The context-sensitive Help which can be called by pressing F1 provides detailed and reference information for all program parts. The context-sensitive Help consists of several parts. A general part describes the general programming system features, which are not PLC-specific. The specific part describes all objects, dialogs and operations which differ from PLC to PLC. It should be used by experienced users having a concrete problem and searching for detailed information. Context-sensitive Help is also available for functions and function blocks, which can be inserted using the Edit Wizard.
&
ControlWave Designer Refer ence M a nual Introduction 1-2
Please refer also to your hardware documentation for PLC specific information.
Symbols and textual conventions
The following symbols are used in this manual: * is used for enumeration.
is used for an operation which has to be done.
ß
is used for an operation which is optional.
8 is used for a sequence of operations to be done with the mouse.
In the procedures described in this manual the instructions ’click’ and ’double click’ relate to the left mouse button. If the right mouse button is meant (e.g. to open an object context menu) this is explicitly mentioned.
7 is used for a sequence of operations to be done with the
keyboard.
Notes are used to provide important information.
&
The book symbol is used to introduce references to other documents or chapters of this manual.
The Online help symbol is used to introduce references to the programming system help or PLC h elp.
The following textual conventions have been set up for this manual: ’ commas are used for names of icons, menu items or
proper names of objects e.g. menu item ’Cut’; function block ’Level’.
<ALT> brackets are used for the name of keys on your
keyboard and for words you have to enter. <ALT> + <F4> is used if you have to press two keys at the same time. editor name Italic letters are used as place holders for proper
names.
ControlWave Designer Refer ence M a nual Introduction 1-3
BLANK PAGE
ControlWave Designer and IEC 61131-3

This chapter provides information about...

o purpose and contents of IEC 61131-3 o configuration elements o POUs, programs, function blocks and
functions
o variables and data types o projects o libraries o programming languages and SFC
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3

ControlWave Designer and IEC 61131-3

What is IEC 61131-3?

The standard IEC 61131 has been established to standardize the mult iple languages, sets of instructions and different concepts existing in the field of automation systems. The great variety of PLC concepts has led to an incompatibility between the different PLC plat forms and manufacturers. The result was a great effort to be m ade for training, hard- and software investments.
IEC 61131 standardizes the programming languages, the int er faces between PLC and programming system, the sets of instructions and the handling and structuring of projects. The advantage of using IEC 61131 conform PLCs and programming systems is a port ability of all platforms and the use of same concepts reducing costs for automation systems.
The standard consists of several parts and technical r epor t s . The t hird part of the standard is dedicated to programming languages.
Obviously this standard has a great influence on the concept, st r uct ure, features and the handling of a programming system and the way to program the system.
The main changes that have come with IEC 61131-3 are: Declaration of variables is similar to the variable declaration in higher
programming languages.
Declaration of data types is possible. Global and local data can be differentiated. Programming means symbolic programming.
For a better understanding and an easier programming some IEC basics and their realization in your programming system are described in the following sections.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-1

Configuration elements

An IEC 61131-3 conform PLC programming system reflects the hardware structure with the configuration elem ent s .
These configuration elements are basically:
Configurations Resources Tasks
Configurations
A configuration can be compared to a programmable controller system, e.g. a rack. In a configuration one or several resources can be defined.
Resources
A resource can be compared to a CPU which can be inserted in the rack. In a resource global variables can be declared, which are only valid within this resource. In a resource one or several tasks can be executed.
Tasks
Tasks determine the time scheduling of the programs associated with them. This means that programs have to be associated to tasks. The settings of the task determine the time scheduling.
IEC 61131-3 describes different time scheduling which lead to three different task types:
Cyclic tasks are activated in a certain t ime interval and the program is
executed periodically.
Event or interrupt tasks are activated if a cert ain event has happened. ∗ System tasks will be activated if an error occurs when executing the
PLC program. System tasks are associated with system programs.
Each task has a certain priority. In so called preem pt ive scheduling systems, an active task with low priority is interrupted immediately, when a task with higher priority becomes active due to a certain event. In systems with non-preemptive scheduling, task interruptions by tasks with higher priority are not possible.
The supported task types depend on the used PLC.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-2
Configurations elements
Configuration elements are represented gr aphically in the project tree. They are grouped together in the subtree ’Physical Hardware’.
Configuration Resource
Directory for tasks Task ’DEFAULT’
Program instance of program CONTAIN
Worksheet for global variables Worksheet f or I/O configuration
Tab ’Hardware’ activated
Figure 2-1: An example of configuration elements
The programming system reflects the structure of configuration elements in the subtree ’Physical Hardware’ which may differ from PLC to PLC. In figure 2-1 the subtree ’Physical Hardware’ with the configuration elements for ProConOS is shown.
In general one or several configurations can be used. In ever y configuration one or several resources can be declared. Several tasks with their associated programs can be used within one resource.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-3

POUs, programs, function blocks and functions

Program organization units - POUs
Program organization units or POUs are the language elements of a PLC program. They are small, independent soft war e unit s containing the program code. The name of a POU should be unique within the project.
In IEC 61131-3 three types of POUs are distinguished referring to their different use:
Functions Function blocks Programs
Functions
Functions are POUs with multiple input paramet er s and exact ly one out put parameter. Calling a function with the sam e values r eturns always the same result. Return values can be single data types. Wit hin a function it is possible to call another function but not a function block or a pr ogr am. Recursive calls are not allowed.
Function blocks
IEC 61131-3 lists different types of st andard functions:
Type conversion functions, such as INT_TO_REAL Numerical functions, such as ABS and LOG Standard arithmetic functions, such as ADD and M UL Bit-string functions, such as AND and SHL Selection and comparison functions, such as SEL and GE Character string functions, such as RIGHT and INSERT Functions of time data types, such as SUB with the dat a t ype TIME
Function blocks are POUs with multiple input/output parameters and internal memory. The value returned by a f unct ion block depends on t he value of its internal memory. Wit hin a f unction block it is possible to call another function block or functions. Recursive calls are not allowed.
IEC 61131-3 lists different types of standard function blocks:
Bistable elements, such as SR and RS Edge detection function blocks, such as R_TRIG and F_TRIG Counters, such as CTU and CTD Timer function blocks, such as TON and TOF
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-4
Programs
Programs are POUs which contain a logical combination of f unctions and function blocks according to the needs of the controller process. The behavior and the use of programs are similar to function blocks. Programs can have an internal memory. Programs must be associated to tasks.
Within a program it is possible to call functions and function blocks. Recursive calls are not allowed.
Figure 2-2: Diagram of a default task with two programs
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-5
POUs
Programs, function blocks and functions can be edited in the project tree. You can either display the complete project tree or only t he subtree ’Data Types’ and ’Logical POUs’ by clicking on the tab ’POUs’ as shown in the following figure.
Directory node for POUs Program ’Contain’ Function block ’Level’ Function ’Tempera’
Tab ’POUs’ activated
Figure 2-3: Subtree ’Logical POUs’
Instantiation
For reusing function block definitions IEC 61131-3 provides t he possibilit y of instantiation. This means that the function block code body is defined once and that its internal memory is allocated to different instances, different memory regions. Each inst ance has an associat ed identifier (called instance name) and contains the input and output par am eter and the internal memory of the funct ion block. A f unct ion block can be instantiated in another function block or in a program . The instance name of a function block has to be declared in the VAR declaration of t he program or function block where it is going to be used. Pr ograms can be instantiated within resources.
Instances are also displayed in the project tree window. The r elat ed subtree is made visible by clicking with the left mouse butt on on the tab ’Instances’ as shown in the following figure.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-6
Figure 2-4: Project tree with the instances within the resource ’R_IPC’
Declaration and instruction part of a POU
Every POU consists of two different par t s : The declaration part and the code body part.
Directory node for the resource Global variables of the resource Functions Directory node for the default t ask
Program instance of program CONTAIN
Tab ’Instances’ activated
In the declaration part all necessary variables are declared. The instruction or code body part of a POU is the par t in which the
instructions are programmed in the desired programming language. A POU consists of three types of worksheets . These three worksheets are
represented graphically by icons:
Directory node for POUs
Directory node for FB ’Level’ Description worksheet (optional) Variables worksheet Code body worksheet in FBD
Figure 2-5: Worksheets of a function block in FBD
In the description worksheet annotations can be added for docum entation purposes. In the variable worksheet all variables are going to be edit ed. The code body worksheet contains the instructions.
In the case of a SFC POU you have two more icons: the directory nodes for the action and transition worksheets.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-7
Figure 2-6: Icons of a SFC POU

Variables and data types

In IEC 61131-3 programming systems, variables are used instead of direct addressing of memory regions in former systems. Variables are assigned automatically to a memory region while com piling. IEC 61131-3 distinguishes different types of variable declarat ions e. g. VAR or VAR_INPUT. For PLC inputs and outputs direct addressing is possible using the keyword AT.
Directory node for SFC program Description worksheet (optional) Variable worksheet Code body worksheet in SFC Directory for transiti on works heets Directory for action worksheet s
Variables with their properties are declared in the var iable wor ksheet of the POU.
Data types determine what kind of value the variable can have. Data types define the initial value, range of possible values and the number of bits.
IEC 61131-3 distinguishes three kinds of data types:
Elementary data types Generic data types User defined data types
Elementary data types are data types whose r ange of possible values and number of bits is defined in IEC 61131-3. Elementary data types are e.g. BYTE, WORD or BOOL.
Generic data types are data types which include groups of elementary data types. They are called e.g. ANY_BIT or ANY_INT. ANY_I NT includes e. g. the elementary data types INT, SI NT, DINT, UINT, USINT and UDINT. Generic data types are necessary to define what kind of elementary data types can be connected to inputs or outputs of functions. I f a function can be connected with ANY_INT it means that variables of the data types INT, SINT, DINT, UINT, USINT and UDINT can be connect ed.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-8
User defined data types are data types which can be declared by the user . They have to be defined with a TYPE ... END_TYPE declaration. User defined data types can be structures or arrays.
User defined data types are declared in the data type worksheet in the subtree ’Data Types’. You can either display the complete project tree or only the subtree ’Data Types’ and ’Logical POUs’ by clicking on the tab ’POUs’ as shown in the following figure.
Directory node for data type worksheets
Data type worksheet ’type1’
Tab ’POUs’ activated
&
Figure 2-7: Subtree ’Data Types’
Variables and user defined data types and their declarations are described in the chapter ’Declaring variables and user defined data types’ of this manual.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-9

Projects

An IEC 61131-3 project contains all necessary elements of an automation system. It consists of libraries, data types, POUs and the set of configuration elements (such as resources, tasks and programs) which are represented in the subtree ’Physical Hardware’. A project is represented in the project tree.
Subtree ’Libraries’ Subtree ’Data Types’ Subtree ’Logical POUs’ Subtree ’Physical Hardware’

Libraries

Figure 2-8: The project with its subtrees
Libraries are projects which have been announced as libraries. You can reuse the programs, function blocks, functions and the user defined data types of the library in the project you ar e edit ing.
Firmware libraries are libraries containing POUs prepared by your PLC manufacturer. The file extension for firmware libraries is *.fwl.
User libraries are projects which you have created before and f r om which you want to reuse POUs. The file extension for user libr aries is *.mwt. If a project is created with an earlier programming system version than
1.3.6.14, the project file name has t he extension *.pwt. Projects which are created earlier cannot be announced as libraries.
Libraries have an own subtree in the project tree. You can eit her display the complete project tree or only the subt r ee ’Libraries’ by clicking on the tab ’Libraries’ as shown in the following figure.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-10
Loading...
+ 223 hidden pages