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
Directory node for libraries Announced library ’example’
Tab ’Libraries’ activated
Figure 2-9: Subtree ’Library’
The subtree ’Library’ consists of two or more icons. The first icon is a directory node. The icons within this directory node r epr esent the announced libraries. In figure 2-9 you can see the announced user library ’example’.

Programming languages and SFC

IEC 61131-3 defines the syntax, the representat ion and the available language elements of 4 programming languages.
The programming languages can be differentiated into 2 textual languages and 2 graphical languages:
The textual languages are Structured Text ( ST) and I nst ruction List
(IL).
The graphical languages are Function Block Diagram (FBD) and
Ladder Diagram (LD).
For structuring the internal organization of pr ograms and function blocks SFC or Sequential Function Chart elements are defined in I EC 61131- 3.
&
SFC and the 4 programming languages are described in the corresponding chapters of this manual.
ControlWave Designer Reference Manual ControlWave Designer and IEC 61131-3 2-11
BLANK PAGE
Getting started
This chapter provides information about...
o
system requirements
o
installing the program
o
calling the program
o
using mouse and keyboard
o
the user interface
o
using the help syste m
o
the editors
o
the Edit Wizard
o
overview window for graphical worksheets
o
exiting worksheets
o
exiting the program
ControlWave Designer Refer ence M anual Getting star t ed
BLANK PAGE
Getting started
System requirements
Hardware requirements
To run ControlWave Designer, the following workstation requirements must at least be fulfilled:
Device Minimum Recommended
IBM compa tible PC with Pentium processor
System RAM 32 MB 64 MB Hard disk 60 MB free
CD ROM drive or floppy disk drive
VGA Monitor
Color settings
Resolution RS232 interface optional Mouse recommended
Softw are requirements
To run ControlWave Designer, the following software requirements must at least be fulfilled:
Microsoft Windows NT
133 MHz 200 MHz
memory sp ace
256 colors 800 x 600
95, Microsoft Windows 98 or Microsoft Windows
True color 1024 x 768
The installation of Microsoft
ControlWave Designer Refer ence M anual Getting star t e d 3-1
smartdrive cache is recommended
Installing the program
Follow the installation instructions in Chapter 2 of the Open BSI Utilities
Manual (document# D5081). Choose the ’ControlWave Designer’ installation option.
Calling the program
To call the program open the Windows ’Start’ menu, choose the menu
’Program’ and select ’OpenBSI Tools’, then ’ControlWave Programs’ and ’ControlWave Designer’.
Th e program will be opened with the last project you have used. If you
start the program for the first time it will be opened without any project.
To open an existing project, you have to perform the steps, which are
described in the example of the following section ’Using mouse and keyboard’.
NOTE: To run the program, you must have the software copy protection key (dongle) installed in the parallel port of your computer.
ControlWave Designer Refer ence M anual Getting star t e d 3-2
Using mouse and keyboard
The program supports full use of the mouse or the keyboard. For
beginners it may be easier to start working with the mouse because it does not make necessary to learn the keyboard shortcuts. In rough industrial environments the keyboard may be more appropriate.
This manual explains both: the use of mouse and keyboard. In the next
sections the general use of mouse and keyboard for the menu and toolbars is described.
The following is an example, how the usage of mouse and keyboard is
described in this manual:
8 Opening a n existing project us i ng the mouse
Click on the icon ’Open Project / Unzip Project’ in the
toolbar. The dialog ’Open project’ appears.
In the list box ’File type’ select the desired file type.
Browse to the corresponding project folder and
locate the desired files (.mwt file for project file or .zwt file for zipped project files).
Double click on the desired file name. The
corresponding project is opened. If you choose a zipped project, the unzipping process is started automatically.
7 Opening an existing project using k eyboard shortcuts
Press <CTRL> + <O>.
The dialog ’Open project’ appears.
In the list box ’File type’ select the desired file type.
Browse to the corresponding project folder by typing
the folder names into the field ’file name’ and pressing <↵>. Locate the desired files (.mwt file for project file or .zwt file for zipped project files).
Open the desired project by typing the
corresponding file name and pressing <↵>.
The usage of mouse and keyboard in the different editors is described in
the following chapters.
ControlWave Designer Refer ence M anual Getting star t e d 3-3
User interface
The program user interface consists basically of six parts: Menu, toolbars,
main screen, status bar, message window and cross reference window.
Figure 3-1: Program user int er f ace with sam ple project ’example’
ControlWave Designer Refer ence M anual Getting star t e d 3-4
Customizing the user interface You can customize the user interface to meet your personal requirements.
For that purpose the dialog ’Options’ is provided, containing several pages on which you can define the appearance and some preferences for the different parts of the system.
Using the ’Options’ dialog it is possible to
create new toolbars and populate them with the desired icons
define general settings for the user interface (such as the appearance
of the workspace)
set compiler and debugger options
set up the default paths for the project, for libraries and pagelayouts
define default pagelayouts
set up the automatic backup feature and the Autosave function
set up the appearance of the text editor as well as the graphic editor
(such as used colors, fonts, default worksheet size, etc.)
Menu
De tailed information a bout customizing the use r interface can be found in the general programming system help file.
Please refer to the topic ’Customizing the user interface’.
The menu is located below the title bar. It contains several submenus.
The menu items of these submenus change according to the
program part or editor you are working with.
The submenu ’File’ can be used to handle, save and zip/unzip projects.
It also contains commands for printing, print setup and print preview. Additionally this submenu contains a menu item for exporting and importing. Using this menu items it is possible to export a translation file (*.csv) which contains all comments within the worksheets as well as the contents of the description worksheets. This csv-file can be translated into any language, e. g. by using a translation software. After (re)importing the translated file you can switch the project language by selecting the language in the project properties dialog.
The submenu ’Edit’ contains all commands which are necessary for
editing such as marking, choosing different working modes or cutting and pasting. Additionally it provides functionality for searching and replacing text strings used to edit textual worksheets (e. g. description worksheets, variables worksheets, ST worksheets or IL worksheets) and graphical worksheets. Depending on the active editor the menu contains also commands for handling objects (e. g. selecting, moving, enabling branch modes, etc.).
ControlWave Designer Refer ence M anual Getting star t e d 3-5
The submenu ’View’ can be used to hide or show the different windows
of the user interface (project tree window, message window, cross reference window, watch window, Edit Wizard, Logic Analyzer) and the status bar.
The submenu ’Project’ can be used to insert new objects (such as data
type worksheets and announced libraries), POUs and configurations.
The submenu ’Build’ consists of different commands for starting the
compilation after editing.
The submenu ’Objects’ is available if you are using an editor. The menu
item ’Variable’ can be used to insert a new variable into the variable list of the current POU. When editing a graphical worksheet, the submenu provides additional menu items to insert and edit graphical objects, such as connectors, jumps, contacts, coils, etc. Depending on the graphical language you are using, some items may be grayed (i.e. inactive).
The submenu ’Layout’ is available if you are using the graphic editor. It
contains several design ing utilities. Y ou can displa y e.g. page borders or a grid for better organizing the content of your worksheets. Furthermore you can zoom into and out of the worksheet, modify the worksheet size, the autoscroll speed and the object size. This submenu also disposes of some features for the online layout.
The submenu ’Online’ offers you commands for debugging a project,
calling the Resource Control and activating the powerflow. In addition the command ’Online Layout’ allows to set the appearance of graphical worksheets in online mode and a second submenu named ’Logic Analyzer’ is available, containing the commands for controlling the Logic Analyzer.
The submenu ’Extras’ can be used to call the dialogs ’Shortcut Keys’
and ’Options’ as well as other optional tools, such as the pagelayout editor. The dialog ’Shortcut Keys’ (also known as Shortcut Manager) allows you to define your own keyboard shortcuts or customize the default shortcuts. The d ia log ’Options’ provides th e facility to custo mize the menus, toolbars, text editors and text colors.
The submenu ’Window’ can be used to arrange the windows and
symbols on your screen and to close all open windows in one step.
The submenu ’Help’ contains all commands for calling help.
The following procedures illustrate , how to call a menu item using the
mouse and the keyboard.
ControlWave Designer Refer ence M anual Getting star t e d 3-6
8 Calling the menu item ’New Project...’ with the mouse
Click on the submenu ’File’. The submenu is opened and you can see the menu items.
Select the menu item ’New Project...’ with a left mouse click. The dialog ’New Project’ appears.
7 Calling the menu item ’New Project...’ using the keyboard
Press <ALT> + <F>. The submenu is opened and you can see the menu items.
Press <w> as it is the underlined character of the menu item ’New Project...’. The dialog ’New Project’ appears.
All submenus or menu items and dialog fields and boxes can be
called pressing the underlined character of the corresponding word.
Using shortcuts is the easiest way of calling a menu item with the
keyboard. For that reason the above mentioned method how to open a submenu and to choose an item is described only one time in this manual. In the following procedures the usage of shortcuts is described.
7 Calling the menu item ’New Project...’ using the keyboard shortcut
Press <CTRL> + <N>. This is the default shortcut for creating a new project. The dialog ’New Project’ appears.
Default shortcuts are already associated to the most important
menu items. If not, you can open the dialog ’Shortcut Keys’ (Shortcut Manager) and assign the corresponding menu item to your own shortcut.
ControlWave Designer Refer ence M anual Getting star t e d 3-7
Toolbars
The toolbars are located below the menu bar. By default all available
toolbars are visible, providing two lines of different icons.
If you place the mouse cursor on any icon (without clicking it), a short
description text, the so called tooltip appears. These tooltips display the name of the current icon. Additionally the status bar displays the function of the desired icon. The following figure shows an example:
Figure 3-2: Sample tooltip (icon ’Save’) and the corresponding description displayed in the status bar
If the tooltips are not shown, open the dialog ’Options’ by
selecting the menu item ’Options’ in the submenu ’Extras’. Activate the checkbox ’Show Tooltips’ on the page ’Toolbars’ and press ’OK’ to confirm the dialog.
The toolbars have been implemented for realizing quickly often used
operations with the mouse. In those cases one mouse click on a toolbar icon leads to the same result as doing several steps without the toolbar. You can adapt the toolbars corresponding to your needs. For this purpose you have to call the dialog ’Options’ by selecting the menu item ’Options’ in the submenu ’Extras’. In order to hide one certain toolbar, deselect the corresponding checkbox on the page ’Toolbars’.
Two different toolbar parts can be distinguished: General toolbars and
specific toolbars. General toolbars contain icons which are available everywhere in the
program.
Specific toolbars contain icons which can be used only in specific
editors. All icons are visible but the icons which cannot be used in a specific editor are grayed. You can hide each toolbar by using the dialog ’Options’ as mentioned above.
ControlWave Designer Refer ence M anual Getting star t e d 3-8
You can detach every toolbar from the other toolbar by double
clicking on the gray toolbar background. The toolbar is then displayed in a window, which can be resized and moved to any position on your screen. To reinsert the toolbar window, just double click on the blue toolbar window title bar.
Toolbar ’Compile/Debug’ attached with other toolbars
Doubl e cl i c k on blue to ol bar window title bar
Double click on toolbar background
Figure 3- 3: Exam ple of a det ached t oolbar window
8 Using the tool bar for creating a new project
Click on the icon ’New Project’.
The dialog ’New Project’ appears, to select a template for the new project.
Toolbar window, mova bl e and resizable
How to create a new toolbar The procedure to create a new, customized toolbar and to
populate it with the desired icons is described in detail in the general online help.
ControlWave Designer Refer ence M anual Getting star t e d 3-9
Defining keyboard shortcuts with the Shortcut Manager
As already mentioned in the section ’Menu’ in this chapter, you can select
certain menu items easier and faster by using keyboard shortcuts. A keyboard shortcut performs the same operation as the menu item to which it is assigned by simply pressing only one key or a key combination. In ControlWave Designer several keyboard shortcuts can be used. The most important menu items (i. e. operations) are already associated to shortcuts by default. Assigned shortcuts are shown beneath the corresponding menu item in the submenus.
Using the Shortcut Manager, you can add new shortcuts for a specific
menu item or modify existing shortcuts. For this purpose call the Shortcut Manager as follows.
Many keyboard shortcuts are defined by default. Keep in mind,
that this manual describes those default shortcuts. After modifying the default setting, some descriptions may not match your actual setting.
8 Calli ng the Shortcut Manager for a dding/modifying shortcuts
Click on the submenu ’Extras’ to see the menu items.
Select the menu item ’Shortcuts’. The dialog ’Shortcut Keys’ appears.
Figure 3- 4: The ’Shortcut M anager’ for adding/modifying keyboard shortcuts The dialog shown in figure 3-4 is divided into three areas: The selection list
’Select a macro’ contains a list of operations, which can be assigned to a shortcut. Most of these entries are available as menu items in the submenus. The field ’Description’ displays a short text, describing the functionality of the selected macro (if available). If a shortcut is already assigned to the selected macro, this shortcut is displayed in the field ’Assigned shortcuts’.
ControlWave Designer Refer ence M anual Getting star t e d 3-10
8 Adding/modifying a keyboard s hortcut
Click on the desired operation/menu item in the list ’Select a macro’. The entry is highlighted. If available a short description is shown in the field ’Description’. If a shortcut is already assigned, it is shown in the field ’Assigned shortcuts’.
To modify a shortcut, you have to remove the current shortcut and assign a new shortcut (refer to the steps below).
To remove a certain shortcut, select it with a left mouse click and press ’Remove’.
To add a new shortcut, perform the steps described in the following procedure. In this example, it is assumed, that you want to assign an additional shortcut to the menu item ’Stop Compile’ in the submenu ’Build’.
To reset all shortcuts to their default settings, click on the button ’Reset All’. All shortcut s you have cre ated will be overwritten.
8 Assigning the shortcut <ALT> + <F6> to the macro
’Build:Stop Compile’
For the following description it is assumed, that the dialog ’Shortcut Keys’
is already opened.
Double click on the desired macro ’Build:Stop Compile’ in the field ’Select a macro’. The dialog ’Assign Shortcut’ appears.
Figure 3-5: Dialog ’Assign Shortcut’ before pressing
the desired shortcut keys
Press the desired shortcut keys (in our example <ALT> and <F6>). They are shown in the text field. Below the text field the Shortcut Manager shows, whether the desired keys are already assigned to another macro.
ControlWave Designer Refer ence M anual Getting star t e d 3-11
Figure 3-6: Dialog ’Assign Shortcut’ after pressing the
desired shortcut keys
Confirm the new shortcut by clicking on ’OK’.
If the desired keys are already assigned to another macro and
you confirm your current sele ction, the shortcut keys will be
The dialog ’Assign Shortcuts’ is closed and the new assigned shortcut
reassigned without a warning message.
is shown in the dialog ’Shortcut Keys’.
The following list contains the default shortcuts in alphabetical order,
assigned by the software manufacturer:
This operation/ menu item is assigned to . .. ... this default shortcut
Activate: Cross References <ALT> + <4> Activate: Edit Wizard <ALT> + <3> Activate: Editor Window <ALT> + <0> Activate: Logic Analyzer <ALT> + <6> Activate: Message Window <ALT> + <2> Activate: Overview Window <ALT> + <9> Activate: Project Tree Window <ALT> + <1> Activate: Watch Window <ALT> + <5> Build: Build Cross References <F12> Build: Compile Worksheet <SHIFT> + <F9> Build: Go to next Error <CTRL> + <F12> Build: Go to Previous Error <SHIFT> + <F12> Build: Make <F9> Build: Patch POU <ALT> + <F9> B uild: Rebuild Project <CTRL> + <F9> Cross References: Next Reference <ALT> + <F12> Cross References: Previous Reference <SHIFT> + <CTRL> +
<F12>
Edit: Copy <CTRL> + <C>
<CTRL> + <INS>
Edit: Cut <SHIFT> + <DEL>
<CTRL> + <X>
ControlWave Designer Refer ence M anual Getting star t e d 3-12
This operation/ menu item is assigned to . .. ... this default shortcut
E dit: Delete <DEL> Edit: Find Next (global) F3 Edit: Find Next (local) <CTRL> + <F3> Edit: Find Previous (global) <SHIFT> + <F3> Edit: Find Previous (local) <ALT> + <F3> Edit: Insert <INS> Edit: Modes: Connect Objects <CTRL> + <L> Edit: Modes: Insert LD Branch <CTRL> + <T> Edit: Modes: Insert SFC branch <CTRL> + <B> Edit: Modes: Mark Object <CTRL> + <M> Edit: Paste <CTRL> + <V>
<SHIFT> + <INS>
Edit: Select all <CTRL> + <A> E dit: Stretc h/Compress: Delete Colu mns <CTRL> + <4> E dit: Stretc h/Compress: Delete Rows <CTRL> + <2> E dit: Stretch/Compress: Inse rt Columns <CTRL> + <3> Edit: Stretch/Compress: Insert Rows <CTRL> + <1> Edit: Undo <CTRL> + <Z> File : New Project <CTRL> + <N> File: Open Project / Unzip Project <CTRL> + <O> File : Print <CTRL> + <P> File : Save <CTRL> + <S> Help <SHIFT> + <F1> Help <F1> Layout: Grid <CTRL> + <.> Layout: Overview Window <ALT> + <9> Layout: Previous View <CTRL> + <<> Layout: Zoom in <CTRL> + <+> Layout: Zoom out <CTRL> + <-> Objects: Action block <ALT> + <F8> Objects: Contact below <CTRL> + <F7> Objects: Contact left <ALT> + <F7> Objects: Contact network <F6> Objects: Contact right <F7> Objects: Duplicate FP <CTRL> + <F5> Objects: Function/Function block <ALT> + <F5>
ControlWave Designer Refer ence M anual Getting star t e d 3-13
This operation/ menu item is assigned to . .. ... this default shortcut
Objects: Simultaneous / Alternative
<CTRL> + <F8>
Divergence
Objects: Step/Transition <F8> Objects: Toggle contact/coil properties <SHIFT> + <F7> Objects: Toggle FP negation <SHIFT> + <F5> Obje cts: Variable <F5> Online: Debug <F10> Online: Logic Analyzer: Insert/Delete
<CTRL> + <F11>
Variable
Online: Logic Analyzer: Start Recording <F11> Online: Logic Analyzer: Trigger conditions <SHIFT> + <F11> Online: Resource Control <CTRL> + <F10> View: Cross References Window <ALT> + <F2> View: Edit Wizard <SHIFT> + <F2> View: Logic Analyzer <ALT> + <F11> View: Message Window <CTRL> + <F2> View: Project Tree Window <F2> View: Watch Window <ALT> + <>F10 Window: Close All F4
Figure 3- 7: Def ault shor t c ut s in alphabetical order
ControlWave Designer Refer ence M anual Getting star t e d 3-14
Main screen and workspace
The main screen (see figure 3-1) is divided into two parts: The project tree
window and the workspace. The workspace contains the opened worksheets. You can open a worksheet by double clicking on the corresponding worksheet icon in the project tree.
If several worksheets are opened only one worksheet is visible. A sheet
tab is assigned to every opened worksheet as shown in the following figure. You can select (activate) a particular worksheet by clicking on the corresponding tab or by pressing <CTRL> + <TAB>.
Figure 3- 8: Wor ksheet tabs in the workspace
If the worksheet tabs are not visible, open the dialog ’Options’ by
selecting the menu item ’Options’ in the submenu ’Extras’. Click on the tab ’General’ and activate the checkbox ’Workbook style’. Confirm your selection with ’OK’.
It is also possible to arrange several worksheet windows in a desired
combination. For this purpose choose the menu items ’Cascade’ and ’Tile’ in the submenu ’Window’. This way you can easily prepare the workspace for different working phases.
You can maximize the workspace, which means, that the project tree is
not displayed and the workspace is enlarged to the whole main screen width. This could be useful for displaying large networks in the graphical editor.
8 Displaying/Hiding the proje ct tree window with the mouse
Click on the icon ’Project Tree’.
Depending on the previous state, the project tree window is now visible or hidden.
7 Displaying/Hiding the proje ct tree window with the keyboard
Press <F2>.
Depending on the previous state, the project tree window is now visible or hidden.
ControlWave Designer Refer ence M anual Getting star t e d 3-15
Message window
The message window is located below the main screen. It contains several
pages, which are activated by clicking on the corresponding tab.
Figure 3- 9: M essage window with its differ ent page tabs
The message window allows to display different steps during compiling,
the compiler errors and warnings and some other information.
One of the main benefits of the message window is the possibility of direct
accessing the worksheets in which the compiler detected errors. For this purpose you just have to double click on the corresponding error.
You can toggle between hidden and visible message window.
8 Displaying/Hiding the message window with the mouse
Click on the icon ’Messages’.
Depending on the previous state, the message window is now visible or hidden.
7 Displaying/Hiding the message window with the keyboard
Press <CTRL> + <F2>.
Depending on the previous state, the message window is now visible or hidden.
The message window is a dockable window. This means, that you can detach the window from the desktop by double clicking on the gray window border. It is then displayed as a usual window, i.e. you can change the size and move the window to any position on the screen. To reattach it into the desk, just double click into the blue window title bar. The handling is similar as for the toolbars.
How to use the message window Detailed information about using the message window are
described in the general programming system online help.
ControlWave Designer Refer ence M anual Getting star t e d 3-16
Cross reference window
The cross reference list contains all external variables, local variables and
function blocks, which are used within the current project. It is a helpful tool for debugging and fault isolation.
Every POU contains its own local data. That means if you open
a particular worksheet, the local variables in the cross reference
To use the cross reference list in an existing or a new project, you have to
list are updated.
build the cross references in order to display the required information in the cross reference window.
In addition the program allows to toggle between hidden and visible cross
reference window.
8 Building the cross reference list with the mouse
If the cross reference window is not visible, click on
the icon ’Cross References’. The cross reference window is now visible.
Place the mouse cursor in the cross reference
window.
Click with the right mouse button on the window
background to open the context menu.
Select the menu item ’Build Cross References’.
The cross reference list is created automatically as shown in the following figure.
It is also possible to call the menu item ’Build
Cross References’ in the submenu ’Build’ or in the editor context menu.
ControlWave Designer Refer ence M anual Getting star t e d 3-17
7 Displaying/Hiding the cross reference window with the keyboard
Press <ALT> + <F2>. Depending on the previous state, the cross reference window is now visible or hidden.
Figure 3- 10: Cross r ef er ence window
For each entry the following information are available:
A symbol at the beginning of each line allows a fast overview on the
displayed variable types. The various symbols are described in the table shown below.
’POU/Worksheet’: POU name in which the variable/FB is declared and
the particular worksheet name where it is implemented.
’Access’: The access of the variable is ’Read’ (Load) or ’Write’ (Stored). ’Command’: Command in which the variable is used (only applicable for
IL and LD code body worksheets).
’I/O Address’: Physical PLC address. ’Global Path’: Instance path of global variables, consisting of the
configuration name and the resource name, where the global variable is declared.
’Type’: The associated data type. ’Comment’: User-defined comment. ’Line/Position(X/Y)’: Line number in textual worksheets or element
position in graphical worksheets.
To open the corresponding worksheet in which a particular
variable is used, just double click on the required line in the cross reference window. The worksheet is opened automatically and the variable is marked. Furthermore a variable is marked in the cross reference window, if you select the variable in an editor.
ControlWave Designer Refer ence M anual Getting star t e d 3-18
Symbols in the Cross Reference Window In order to get a fast overview of the objects which are displayed, each
item is shown with a symbol representing its type. The following table lists the different items and their corresponding symbol shown in the column ’Variable’:
Symbol Meaning Symbol Meaning
lo cal variable global variable input variable
(VAR_IN)
output variable
(VAR_OUT)
in-/output
variable (VAR_IN_OUT)
Figure 3- 11: Sym bols in the cross r ef er ence window
8 Filtering the cross reference list
You can filter the cross reference list to show only a particular subset of
function block
variables or function blocks.
Move the mouse cursor into the cross reference window.
Click with the right mouse button on the window background to open
the context menu.
step transition detail action detail
jump
label
connector
Choose the menu item ’Filter...’. The dialog ’Cross Reference Filter’ appears.
Figure 3-12: Dialog ’Cross Reference Filter’, used to filter the
displayed entries in the cross reference list
ControlWave Designer Refer ence M anual Getting star t e d 3-19
Choose the desired filter settings by selecting one or several checkboxes.
To filter the list for a specific name, address or access, mark the corresponding checkbox in order to activate the text field and enter the desired text. For that purpose you can us e wildcards (refer to the note below). On ly elements matc hing this name will be displa yed.
After confirming the dialog the cross reference window contains only elements which match the filter settings. The column ’Variable’ indicates in its column head, that filter settings are applied.
Using wildcards in the dialog ’Cross Reference Filter’: In the text fields you can use the wildcard symbol ’*’. A wildcard serves as a placeholder for any character and is used in conjunction with other characters. You can u s e a wildcard at the beginning of an identifier as well as at the end.
Example: Let us assume, that you want to filter the cross reference list
in a way, that it displays the variables var1, var2 up to var10. For this purpose enter the string ’var*’ in the input field.
Figure 3-13: Using the wildcard symbol in the
dialog ’Cross Reference Filter’
8 Sorting the cross reference list
It is possible to sort the list entries alphabetically. Each column can be
used as sort criterion. The entries can be sorted in ascending and descending order. To sort the list, perform the following steps:
Click on the column name, which is intended to be the sort criterion. It is marked by an arrow, which indicates the sort order:
Ascending or descending sort order.
If you have specified a filter string this button would appear as follows:
This figure corresponds to the described example where the
checkboxes ’Local’, ’External’ and ’FBs’ were activated and the string ’var1’ was used.
Click once more on the same column name to reverse the sort order.
ControlWave Designer Refer ence M anual Getting star t e d 3-20
8 Undocking/ Docking the cross reference window
Like the output window the cross reference window is dockable. This
means, that you can detach the window from the desktop by double clicking in the gray window border. It is then displayed as a usual window, i.e. you can change the size and move the window to any position on the screen. To reattach it into the desk, just double click into the blue window title bar. The handling is similar as for the toolbars.
8 Using the cross reference toolbar
It is possible to display a toolbar which allows fast access on the
references shown in the cross reference list.
To display the cross reference toolbar, call the dialog ’Options’ by selecting
the menu item ’Options...’ in the submenu ’Extras’.
Open the dialog page ’Toolbars’, activate the checkbox ’Cross references’
and confirm the dialog. The cross reference toolbar is now visible on the desktop:
Status bar
From left to right the icons have the following meaning:
Go to the first/previous/next/last reference.
The status bar displays different messages while you are working with the
program.
The left part of the status bar provides information about operations you
have done or displays system messages. If your mouse pointer is placed on an icon or a menu item (without selecting it) the status bar displays a short description concerning the icon or menu item under the cursor.
The fields on the right show the cursor position in the editor: When using
the graphical editor x-y-coordinates are shown, in the text editor the fields display the current row and column. Beneath the cursor position the free hard disk space is displayed. If there is not enough disk space available, this field appears red.
The d ifferen t sta t e s o f th e programming system are represented in the
status bar by colors. The following colors are used for the different states:
gray: offline green: online red: timeout
It is possible to hide the status bar by selecting the menu item ’Status Bar’
in the submenu ’View’.
ControlWave Designer Refer ence M anual Getting star t e d 3-21
Using help
Which kind of help files are available? The context-sensitive help system provides to pics for each program part.
The help is separated into two or more parts:
A general help file describes the general programming system features, which are not PLC-specific.
One or more specific help files contain the description of all objects, dialogs and operations which differ from PLC to PLC.
Help on functions and function blocks. The software provides full help on all functions and function blocks. These help topics are available for IEC standard functions/FBs, PLC specific and firmware functions/FBs as well as for user defined functions and function blocks (please refer to the section below).
Using the general and the PLC specific help The general and the specific help are arranged in a hierarchical structure
using three types of topics: Main topics: These help topics describe the general handling of the
editors. Main topics are called by pressing F1 while an editor is opened.
Object topics. These help topics give background information about an
object used in an editor. Object topics are called by marking the object in the worksheet and pressing <SHIFT> + <F1>.
Dialog topics: These help topics explain the meaning and the usage of
the dialog fields. Dialog topics are called by clicking the button ’Help’ in the dialog.
All these topics can be called context-sensitive. But it is also possible to
call the help contents or help index for getting an overview and then choosing the desired topics. For this purpose you have to select the menu item ’Help Topics’ in the submenu ’Help’.
Us i ng help on functions and func tion blocks In the Edit Wizard you can call specific help to each function and function
block by performing the following steps:
Click with the right mouse button on the specific function or function block
in the Edit Wizard selection area. The context menu appears. Select the menu item ’Help on FU/FB’. The related help topics will be displayed.
The help topics for IEC 61131-3 functions and function blocks can also be
called choosing the menu item ’Help on IEC firmware’ in the submenu ’Help’.
ControlWave Designer Refer ence M anual Getting star t e d 3-22
For standard, firmware and PLC specific functions and function blocks the
context sensitive help topic of the file ’Help on FU/FB’ is called, which is part of the programming system. If you call h elp for an user defined function or function block, either the contents of the description worksheet within this POU or the contents of an user edited HTML file is opened in a specific help window, which differs from the standard help window.
How to set up the desired help file for user defined
functions and FBs
The procedures to set up the desired help file for user defined
functions and function blocks are described in the general programming system help.
8 Searching a topic in the help system
Select the menu item ’Help topics’ in the submenu ’?’. The general help contents appears displaying the contained topic titles with the hierarchical structure.
If you are searching for an entire topic, click on the tab ’Index’ and enter the desired topic title.
Further information to a specific topic can be called by clicking on the hypertext jumps within the text or at the end of a topic. These jumps to other related topics appear as colored or underlined phrases.
If you are searching for a specific information or a specific word within the help file, you can use the AnswerWorks feature as follows: In the help window click on the button ’Ask me...’. The AnswerWorks dialog appears. Type your request into the text field and click on ’Search’. The help system displays a list of topics, which contain a n answer to your request. To display the desired help topic, click on the related jump in the result list.
ControlWave Designer Refer ence M anual Getting star t e d 3-23
Editors
The project manager - a powerful tool for program organization
The project manager is a comfortable and powerful tool for program organization and project management. It includes the project tree editor and the instance tree.
Every project is represented with its own project tree in the project manager. The project tree allows you to edit the structure of your project.
It is recommended to leave the project manager open the whole time while you are working with the program, because it gives you a better orientation at what level you are working and what is left to do.
Project tree
You can edit your project within four subtrees. In the subtree ’Library’ libraries can be announced. In the subtrees ’Data Types’ and ’Logical POUs’ new POUs and worksheets can be added for editing data type, variable and code body worksheets. In the subtree ’Physical Hardware’ all configuration elements can be inserted, global variables can be declared and programs can be associated to tasks.
Proj ec t - shows th e compl ete tree POUs - shows subtrees ’Data Types’ and ’L ogical POUs’ Libraries - shows the subtr ee ’Lib r aries’ Hardware - shows the subtree ’Physical Hardware’ Instances - shows the instance tree
Figure 3-14: Project tree window with sheet t abs
The project tree allows to select several objects, i. e. you can select several icons and apply a command (such as copying, cutting or deleting icons, printing worksheets, global searching/replacing of text, etc.) on each selected object at the same time. For marking several objects in the project tree you can either keep the <SHIFT> key pressed while clicking on each desired icon (to select adjacent icons) or keep the <CTRL> key pressed (in order to mark icons which are not side by side in the tree).
ControlWave Designer Refer ence M anual Getting star t e d 3-24
Detailed i nformation about the project tree functionality
can be found in the general programming system help. Please refer to the topic ’General features of the project tree’.
Instance tree
The instance tree displays the project structure in the PLC and is used to open the worksheets in online mode.
It is possible to display the complete project tree or only particular subtrees. For this purpose the project tree window provides several tabs at it’s bottom. They can be used to switch between the various views.
ControlWave Designer Refer ence M anual Getting star t e d 3-25
The graphic editor - easy programming in SFC, FBD and LD
The graphic editor is one of the editors which have been implemented for programming graphical code body worksheets of the POUs. The system supports three graphical programming languages: SFC, FBD and LD.
The follo wing features facilitate editing in graphical languages: An Edit Wizard provides full edit functionality for inserting and replacing
functions and function blocks.
Full drag & drop functionality is provided for moving and copying
objects using the mouse.
All graphical editors provide simple keyboard operation for inserting and
scrolling. The following modes are available:
Object mode by pressing Cursor keys or
<CTRL> + Cursor keys
Mouse cursor mode by pressing <SHIFT> or
<SHIFT> + <CTRL> + Cursor keys.
Duplication of function inputs can be done directly via keyboard, toolbar
and menu.
Negation of Inputs, Outputs, Contacts and Coils can be done directly
via keyboard, toolbar and menu.
Easy auto routing for standard editing cases is possible. Items can be inserted directly on a line or to the inputs or outputs of
already existing items (only in FBD editor).
Splitter and overview windows are available. Freestyle editing allows to arrange items smoothly wherever you want. Grid for adjusting new inserted objects. Jump into the code body worksheets of user defined POUs are possible
by double clicking on the corresponding object in the graphical worksheet or by using the object context menu item ’Object Open’.
De tailed information a bout the graphic editor functi onality can be found in the general programming system help. Please
refer to the topics ’Graphic editor’ and ’General editing operations in the graphic editor’.
It is possible to mix the graphical programming languages. The system
checks all user entries to detect and avoid invalid connections (e.g. connection between two outputs). While inserting new graphical elements the layout of the already existing network is adapted automatically.
ControlWave Designer Refer ence M anual Getting star t e d 3-26
The text editor - easy programming in IL and ST
The text editor is used for programming textual code body worksheets of
the POUs. The system supports two textual programming languages: IL and ST.
The text editor is also used to edit data type worksheets, variable
worksheets and I/O configuration worksheets.
The handling of the text editor is similar to the handling of a normal ASCII-
editor. The following features facilitate editing in IL and ST: An Edit Wizard provides full edit functionality for inserting pre-edited
Data types, Operands, Keywords, functions and function blocks.
Full drag and drop functionality is provided for moving and copying text
elements using the mouse.
Optional line numbers can be displayed. Syntax highlighting is possible. Multiple Undo/Redo. Multiple Zooms. Different views via splitter window are possible. Jump into the code body worksheets of user defined function blocks are
possible using the context menu item ’Open FB’ of the instance name in a textual worksheet.
De tailed information about the text editor functi onality can be found in the general programming system help. Please
refer to the topics ’Text editor’ and ’General editing operations in the text editor’.
The pagelayout editor - creating pagelayouts for printing
The pagelayout editor provides an easy way to create pagelayouts for
printing the project documentation.
A pagelayout represents a template which is used to print the contents of
a code body worksheet. It defines an area in which the content of the worksheet is going to be printed.
ControlWave Designer Refer ence M anual Getting star t e d 3-27
The Edit Wizard
Th e Edit Wizard is a useful to ol, which facilitates the insertion and
replacement of
keywords and statements (in ST), operators (in IL), function and function blocks (all languages).
The Edit Wizard for the various languages and worksheets is shown in the
following figure.
In general, the Edit Wizard is used as follows: Locate the code body
position in your worksheet, where a new keyword, statement, function or function block has to be inserted and place the text cursor or insertion mark at this position. Then determine the desired keyword, statement, function or function block in the Edit Wizard selection area and insert it into the code body with a left mouse double click.
Especially in text editors the usage of the Edit Wizard provides the
following advantages: It prevents from entering syntactical faults, such as forgotten
semicolons, selection or iteration statements without end statement, etc. This is done by inserting pre-edited statements, functions or function blocks, i. e. the statement structure is already prepared with place holders. The variables and values are inserted as comments, which the user simply has to overwrite.
It is not necessary, that the user knows the syntax of all different
statement types, such as fu nctions or function blocks.
Edit Wizard in ST, displaying ST keywords.
Edit Wizard in FBD, LD and SFC, displaying functions and function blocks.
Edit Wizard in IL , displaying LD operators.
Selection area
Figure 3- 15: Edit W izard f or the different languages
ControlWave Designer Refer ence M anual Getting star t e d 3-28
The Edit Wizard can also be used to insert variable definitions in the
various variable worksheets as well as data types in a data type worksheet.
Edit Wizard in a variable worksheet (al l l a ng uages), displaying variabl e declarat ion keywords.
Figure 3- 16: Edit Wizar d f or var iables and data t ype wor ksheet s
The dockable Edit Wizard window is divided into two areas: The list box
Edit Wizard in a data type worksheet (subtree ’Data Type’).
’Group’ and the selection area. Depending on the selected group the selection area displays the elements which can be inserted into the code body.
The list box ’Group’ contains the available groups of code body elements
for the corresponding language. The selection area displays the available elements contained in the selected group.
Depending on the editor, the following groups are provided in the list box:
’Keywords’, represented by the key symbol: ’Operators’, represented by the key symbol:
(only in ST).
(only in IL).
’<all FUs and FBs>’, where functions are represented by the symbol
, and FBs are represented by the symbol .
The color of a symbol points to the origin of the related FU or FB:
FIRMWARE FUs and FBs are displayed in red. LIBRARY FUs and FBs are displayed in blue. USER FUs and FBs are displayed in green.
’Function blocks’. The selection area o nly offers function blocks. The
symbols and their colors are described above.
’Functions’. The selection area only offers functions. The symbols and
their colors are described above.
’PLC specific’. The selection area offers elements only available for a
specific PLC.
ControlWave Designer Refer ence M anual Getting star t e d 3-29
’PROCESSOR specific’. The selection area offers elements only
available for a specific processor.
’String FUs’. The selection area only offers string functions. The
symbols and their colors are described above.
project name’. One group is designated with the name of the project
file. This group only contains the user defined functions and function blocks, which have already been created within the actual project. This is why only green symbols are available.
’Favorites’. This group contains objects which you have added before
as favorites.
How to add objects to the ’Favorites’ group For detailed information about ’Favorites’ please refer to the
corresponding help topic.
’Type conv. FUs’. This group contains type converting functions, such
as ’Bool to Integer’ or ’Bool to Word’.
Libraries name’. Each announced library is represented as an own
group.
If the Edit Wizard is not visible in the main screen area, perform the
following steps:
8 Calling the Edit Wizard with the mouse
Click on the icon ’Edit Wizard’ in the toolbar.
7 Calling the Edit Wizard with the keyboard
Press the shortcut <SHIFT> + <F2>.
De tailed information about the Edit Wizard The usage of the Edit Wizard is described in detail for each editor in the
particular editor description chapter.
ControlWave Designer Refer ence M anual Getting star t e d 3-30
8 Calli ng help on a function or function block using the Edit Wiza rd
Before inserting a function or function block into a code body worksheet,
you can call help information to the desired object.
For that purpose, mark the function/function block in the Edit Wizard
selection area and open its context menu using the right mouse button. Select the context menu item ’Help on FB/FU’.
The context sensitive help topic appears. These help topics are available
for IEC standard functions/FBs, PLC specific and firmware functions/FBs as well as for user defined functions and function blocks.
&
Which help topic appears and how to set up the different help
files for user defined functions and function blocks is described in the section Using help in this chapter. Further detailed information are contained in the programming system online help.
ControlWave Designer Refer ence M anual Getting star t e d 3-31
Overview window for graphical worksheets
When using the graphic editor you can call the overview window to get an
overview of the complete contents of the worksheet. This simplifies navigation in your worksheet.
8 Calli ng the overview w indow with the mouse
Open a graphical worksheet in the graphic editor by double clicking on the desired worksheet icon in the project tree.
Click on the submenu ’Layout’.
Select the menu item ’Overview window’.
The overview window appears.
7 Calli ng the overview window with its shortcut
Open a graphical worksheet in the graphic editor. For this purpose mark the desired worksheet icon in the project tree and press <↵>.
Press <ALT> + <6>. The overview window appears.
The overview window shows the entire contents of the current graphical
worksheet. You can use the overview window to move the worksheet area which is visible in the editor.
8 Navigating in graphical worksheets using the overvie w window
Click on the drawing in the overview window. A hand symbol is added to the cursor and the visible area is represented as a rectangle.
Keep the left mouse button pressed and drag the rectangle to the area you want to be visible in the editor. When releasing the mouse button, the area which is covered by the rectangle is visible in the editor window.
The worksheet area which is covered by this r ec tangle i s visible in the gra phic editor
Figure 3- 17: Navigating in a graphical worksheet using the over view window
ControlWave Designer Refer ence M anual Getting star t e d 3-32
Exiting worksheets
If you have finished editing the worksheet you can close the worksheet. A
dialog appears where you can save your changes or not.
For saving and exiting all opened worksheets choose the menu
item ’Close all’ in the submenu ’Window’.
8 Exiting the worksheet with the mouse
Click on the submenu ’File’.
Select the menu item ’Close’.
The dialog ’ControlWave Designer’ appears.
7 Exiting the worksheet with the keyboard
Press <CTRL> + <F4>.
The dialog ’ControlWave Designer’ appears.
Figure 3-18: Dialog ’ControlWave Designer’
8 7 Using the dialog ’ControlWave Designer’
Click ’Yes’ to exit the worksheet with saving the changes.
Click ’No’ to exit the worksheet without saving the changes.
Click ’Cancel’ to return to the worksheet without exiting.
NOTE: When the worksheet is closed, an automatic compilation will be
carried out.
ControlWave Designer Refer ence M anual Getting star t e d 3-33
Exiting the program
If you exit the program, it does not matter whether one or several editors
are still open or all windows are already closed. If you have not saved the changes you have done, a dialog appears and you can either save the changes or close the corresponding windows without saving any changes.
8 Exiting the program with the mouse
Choose the menu item ’Exit’ in the submenu ’File’. The program is closed.
7 Exiting the program using the keyboard
Press <ALT> + <F4>. The program is closed.
To exit the program you can also double click on the icon of the system menu in the upper left window corner or click on the icon ’Close’ in the upper right corner of the program window.
ControlWave Designer Refer ence M anual Getting star t e d 3-34
Handling and editing projects
This chapter provides information about...
o
creating a new project
o
changing properties of POUs
o
inserting POUs
o
inserting worksheets
o
announcing libraries
o
deleting worksheets, POUs or libraries
o
saving changes in worksheets while editing
o
saving the project under a new name
o
zipping the project into an archive file
o
saving a project as a template
o
translating the project language
o
ControlWave Designer Refer ence Manual Handling and editing projects
BLANK PAGE
Handling and editing pr ojects
Creating a new project
The first step you have to do after calling the program is creating a new project or opening an existing project. This section describes the steps, which are necessary to create a new project.
There are two possibilitie s for creating a new project: Either by using the Project Wizard (recommended) or by manually selecting a template. Both methods are described in the following subsections.
Creating a new project using the Project Wizard
The easiest way of creating a new project is using the Project Wizard which guides you in 6 steps through the creation process. You can simply define the name and type of the project, the first POU, the configuration, the first resource and the first task.
8 Ca lling the Project Wizard with the mouse
Click on the icon ’New Project’ in the toolbar. The dialog ’New Project’ appears, as shown in the following figure.
In the dialog ’New Project’ double click on the icon ’Project Wizard’. The dialog ’Project Wizard (Step 1 of 6)’ appears.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-1
Figure 4- 1: Dialog ’New Project’ containing the available project templates and the Project
Wizard
7 Calling the Project Wizard with the keyboard
Press <CTRL> + <N>. The dialog ’New Project’ appears.
In the dialog ’New Project’ use the cursor keys to mark the ic on ’Project Wiz ard’.
Press <ENTER> to confirm the dialog. The dialog ’Project Wizard (Step 1 of 6)’ appears.
8 7 Using the Project Wizard
Enter the desired information in the different step dialogs and confirm each step dialog by clicking on the button ’Next’.
For detailed information about the various
step dialogs please refer to the online help system.
After you have confirmed the last step (6 of 6) by clicking on the button ’Finish’, the new project is created automatically and appears in the project tree with the previously entered settings and identifiers.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-2
Creating a new project using a template
Using this way for creating a new project the program copies the template
you have chosen to a project named ’Untitled’. The template consists of POUs, worksheets or configuration elements necessary for the PLC type.
You can edit the project ’Untitled’ and save it afterwards under the name
you want to use.
8 Creating a new project with the mouse
Click on the icon ’New Project’ in the toolbar. The dialog ’New Project’ appears.
7 Creating a new project with the ke yboard
Press <CTRL> + <N>. The dialog ’New Project’ appears.
Figure 4- 1: Dialog ’New Project’ containing the available project templates and the Project
Wizard
8 7 Using the di alog ’New Project’
Choose the template for your PLC type with a left mouse click.
Confirm the dialog.
The new project with the name ’Untitled’ is created.
Your project tree should look like the following figure now:
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-3
Figure 4- 2: Pr oject ’Untitled’ with program ’Untitle’ and its worksheets
The project ’Untitled’ includes automatically one POU: the program
’Untitle’. The program has 3 worksheets: The description worksheet ’UntitleT’ for the POU documentation
(optional).
The variables worksheet ’UntitleV’ for the declaration of variables and
function block instances.
The code body worksheet ’Untitle’ for the code body definition.
Some properties of this program can be changed. The default
language for the first autoinserted program is IL, thus the language cannot be changed. If a program in another language is required, you have to insert a new POU.
Saving an existing project as a template
You can save an existing project as a template. After saving a project as
template, the new template is contained in the dialog ’New Project’ and can be used to create a new project.
8 7 Saving an existing project as a template
Choose the menu item ’Save As Template...’ in the submenu ’File’. The dialog ’Save As Template’ appears.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-4
Figure 4- 3: Dialog ’Save As Template’
Enter the desired name for the new template.
Confirm the dialog.
The new template is automatically saved in the default template directory.
How to delete an existing template
For detailed information about deleting templates please refer to the online he lp system.
Changing the properties of existing POUs
Let us assume that you want to use the program ’Untitle’ just with a
different name. In this case you have to change the properties of this program.
Everywhere in the program you can change the properties of
existing objects choosing ’Object Properties...’ in the context menu of the object. In order to open the context menu of an object, mark the object and click the right mouse button. The context menu appears. The menu items always relate to the marked object.
8 Changing the properties of existing POUs with the mouse
Choose ’Properties...’ in the context menu of the icon ’Program name’. The dialog ’Properties’ appears.
Or
Click with the right mouse button on the icon ’Program name’ in the project tree, to open its context menu.
Select the menu item ’Properties...’. The dialog ’Properties’ appears.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-5
7 Changing the properties of existing POUs with the keyboard
Press <
Ç
> or <Æ> to mark the icon ’Program name’.
Press <ALT> + <>. The dialog ’Properties’ appears.
Figure 4- 4: Dialog ’Properties’ for changing the properties of exist ing POUs
8 7 Using the dialog ’Properties’ for changing the properties of
existing POUs
If desired, enter a new name for the POU.
If required, change the POU type. The preselected language cannot be
changed for this POU.
Confirm the dialog.
You can also edit the name of a particular worksheet in the
dialog ’Properties’. To perform this, mark the desired worksheet icon in the project tree, open its context menu using the right mouse button and select the menu item ’Properties...’. The dialog ’Properties’ appears as shown above. Enter the new name for the worksheet in the field ’Name’ and confirm the dialog.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-6
If you have changed the name of a program, you also have to
change the name of the instantiated program in the task. Otherwise an error occurs when compiling the project, because the system is unable to find the renamed POU. The steps to be performed for associating a program to a task are described in section ’Associating programs to tasks’ in the chapter ’Compiling, downloading and debugging’.
Inserting new POUs
The next steps you would certainly like to do is to insert new POUs in
different programming languages.
8 Inse r ti ng a POU with the mouse
To insert a new program click on the icon ’Add program’. The dialog ’Insert’ appears.
To insert a new function block click on the icon ’Add function block’. The dialog ’Insert’ appears.
To insert a new function click on the icon ’Add function’. The dialog ’Insert’ appears.
7 Inserting a POU with the keyboard
Press <
Ç
> or <Æ> to mark the icon ’Logical POU’.
Press <INS>. The dialog ’Insert’ appears.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-7
Figure 4- 5: Dialog ’Insert’ for inserting a new POU
8 7 Using the dialog ’Insert’ while inser ting a new POU
Enter a name for your new POU.
Choose the POU type.
Choose the programming language. The default language for a new
inserted POU is FBD.
Confirm the dialog. The new POU with its worksheets is inserted in the project tree.
Some programming languages may be grayed according to the
number of the available editors.
The new worksheets are marked with an asterisk in the project
tree. These asterisks mean that the worksheets have been inserted or changed but not yet compiled.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-8
Inserting worksheets
It is also possible to insert new worksheets in POUs. This feature is
necessary if you have large code bodies and you want to split them into several parts for better orientation. If you want to insert new worksheets in POUs the language of the new worksheet is determined by the POU language. This means all worksheets of a POU have the same language e.g. FBD. The language of a new inserted worksheet is set automatically.
8 Inser ting a code body worksheet in a POU with the mouse
Click on the code body worksheet icon where the new worksheet has to be inserted in the project tree.
Choose the menu item ’Insert’ from the context menu.
Or:
Click on the icon ’Add Object’. In both cases, the dialog ’Insert’ appears.
Enter a name for the new worksheet in the field ’Name’.
Determine, whether the new worksheet should be inserted after (’Append’) or before (’Insert’) the marked worksheet.
Confirm the dialog ’Insert’. The new code body worksheet is inserted in the project tree.
8 Inserting a variable worksheet in a POU with the mouse
Click on the variable worksheet icon where the new worksheet has to be inserted in the project tree.
Choose the menu item ’Insert’ from the context menu.
Or:
Click on the icon ’Add Object’. In both cases, the dialog ’Insert’ appears.
Click on the radio button ’VAR’ in the ’Language’ area of the dialog.
Enter a name for the new worksheet in the field ’Name’.
Determine, whether the new worksheet should be inserted after (’Append’) or before (’Insert’) the marked worksheet.
Confirm the dialog ’Insert’. The new variable worksheet is inserted in the project tree.
The steps to insert a new description worksheet are similar to the steps described for code body or variable worksheets. The only difference is, that you have to mark an existing description worksheet before calling the dialog ’Insert’.
ControlWave Designer Refer ence M a nual Handli ng and editing projects 4-9
The steps to be done for inserting new data type worksheets in the
subtree ’Data Types’ are also similar to the steps described for inserting new code body worksheets.
8 Inserting a data type worksheet with the mouse
Click on the icon ’Data Types’ in the project tree.
Choose the menu item ’Insert’ from the context
menu.
Or:
Click on the icon ’Add Object’. In both cases, the dialog ’Insert’ appears.
Choose a name and confirm the dialog. The new data type worksheet is inserted in the subtree ’Data Types’.
Inserting of worksheets (i. e. all types of worksheets) can also be done
using the keyboard.
7 Inserting a worksheet with the keyboard
Press <
Ç
> or <Æ> to mark the desired icon. Which icon you have to mark depends on the worksheet type you want to insert (refer to the preceding descriptions).
Press <INS>. The dialog ’Insert’ appears.
Fill in and confirm the dialog ’Insert’.
Announcing libraries
Having already finished one project, you can reuse these POUs and
worksheets in a new project. This feature makes it unnecessary to define code bodies which already exist.
User libraries To reuse POUs and worksheets of an existing project you have to
announce this project as an user library. The file extension for user libraries is *.mwt. If a project is created with an earlier programming system version than 1.3.6.14, the project file name has the extension *.pwt. Projects which are created earlier cannot be announced as libraries.
The worksheets of user libraries can be opened in view mode
using the corresponding editor. View mode means, that the worksheet can be displayed but not edited.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-10
Firmware libra ries It is also possible to use firmware functions and function blocks which are
prepared by your PLC manufacturer. Firmware functions and function blocks have to be announced as firmware libraries. The file extension for firmware libraries is *.fwl.
Worksheets of firmware libraries cannot be opened, neither in
view mode nor in online mode.
In the following section it is described how to announce an user defined
library. For announcing firmware libraries just choose a different file extension.
8 Announcing a l i brary with the mouse
Click on the icon ’Libraries’ to mark it.
Choose the menu item ’Insert’ from the context
menu.
Or:
Click on the icon ’Add Object’. In both cases, the dialog ’Include library’ appears.
Choose the project you want to announce as a library.
Click on the button ’OK’ to confirm the dialog.
7 Announcing a l i brary with the keyboard
Press <
Ç
> or <Æ> to mark the icon ’Libraries’.
Press <INS>. The dialog ’Include library’ appears.
Choose the project you want to announce as a library.
Press <> to confirm the dialog.
Your project tree should look like the following figure now:
Figure 4- 6: Pr oject with announced librar y ’Contain’
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-11
8 Opening an user library worksheet in view mode with the mouse
Mark the library you want to view. If not already opened double click on the ’Libraries’ node icon.
Browse to the desired library and open the POU folder.
Double click on the desired worksheet icon. The worksheet is opened in the related editor. It cannot be edited.
Since user library worksheets can be opened in view mode, it is
also possible to switch them into online mode, i. e. it is possible to debug them.
&
The general procedure of switching library worksheets into
online mode is equal to the handling of any other worksheet in your project. Please refer to the section Calling worksheets in
online mode in the chapter Compiling, downloadi ng and debugging.
Deleting worksheets, POUs or libraries
It is possible to delete worksheets, whole POUs or libraries. In every case
you first have to mark the object, which has to be deleted.
For the following description let us assume, that you want to delete the
POU ’Untitled’.
When deleting a whole POU, keep in mind, that all worksheets
contained in this POU are deleted too.
87 Deleting the POU ’Untitled’
Click on the POU icon to be deleted. Or:
Ç
Press <
> or <Æ> to mark the POU to be deleted.
Press <DEL>. A message box appears in which you can confirm or abort the deletion.
Confirm the dialog. The POU is deleted.
Having confirmed the message box there is no way of restoring
the data. Use this feature very carefully!
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-12
Saving changes in worksheets while editing
While you are editing you should regularly save the changes you have
done. In case of a power failure or other events you risk loss of data if you do not save your work. You can save the changes of the current worksheet at any time.
The project tree is saved automatically.
8 Saving the changes in the current worksheet with the mouse
Click on the icon ’Save’ in the toolbar. The worksheet is saved.
7 Saving the changes in the current worksheet with the keyboard
Press <CTRL> + <S>. The worksheet is saved.
Autosave feature
The system provides an Auto save feature for unsaved worksheets. To enable this feature and to set the time interval call the dialog ’Options’ and open the page ’Backup’. In the related dialog area activate the radio button ’Every’ and enter a value.
Automatic compilation when closing
When saving a worksheet, the system automatically compiles this worksheet, i.e. a syntax checking is performed. Any detected errors are displayed in the error sheet of the message window. Additionally the first variables worksheet within the same POU is compiled. Therefore it is important, that the Input/Output parameters used are declared in the first variables worksheet of the POU. Due to this automatic compilation each user defined function or function block is available in the Edit Wizard immediately after closing the corresponding worksheet.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-13
Saving the existing project under a new name
The program provides the possibilit y to save an existing project under a
new file name. This means that all files, belonging to the project (such as the project files, the POUs, etc.) are copied to a new project folder. The origin project is not changed.
8 Calling the dialog ’Save/Zip project as’ with the mouse
Click on the submenu ’File’.
Select the menu item ’Save Project As/Zip Project as...’.
The dialog ’Save/Zip project as’ appears.
7 Calling the dialog ’Save/Zip project as’ with the keyboard
Press <ALT> + <F>. The submenu ’File’ is opened.
Press <
Æ
> or <Ç> to mark the menu item ’Save Project As/Zip Project
as...’.
Press <↵>. The dialog ’Save/Zip project as’ appears.
8 7 Using the dialog ’Save/Zip project as’
In the dialog ’Save/Zip project as’ make sure that the entry ’Project Files (*.mwt)’ is selected in the list bo x ’File ty pe’ .
Enter the new project name in the field ’File name’. Use the extension ’mwt’. The entered name is used for the new project folder as well as for the new project file.
Choose a new path if you want.
Confirm the dialog.
The entire project is now copied to a new project folder and the copied
project file is renamed. After saving the new project, the origin project is closed and the copied project remains opened with an empty workspace.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-14
Zipping the project files into an archive file
Th e system provides the possibility to zip a whole project into an a rchive
file using the dialog ’Save/Zip project as’. This zip archive contains then all files which belong to the project, i. e. the project file ’projectname.mwt’ itself, the code body files, variable declarations and some internal files which are necessary to restore the project from the archive. Therefore the zip functionality can be used to create project backups.
It is recommended to zip your files regularly, e.g. once a day,
and to save your archive on a floppy disk to make sure that no loss of data occurs.
Additionally to the possib ilit y of zipping a project manually into an
archive file, the system provides an automatic b ackup functionality. Using this feature you can create project backups automatically in certain time intervals or when closing a project. For details please refer to the procedure at the end of this section.
8 Zipping the project files with the mouse
Click on the submenu ’File’.
Select the menu item ’Save Project As/Zip Project as...’.
The dialog ’Save/Zip project as’ appears.
In the list box ’File type’ select the entry ’Zipped Project Files (*.zwt)’. The checkboxes ’Zip user libraries’, ’Zip frontend code’ and ’Zip pagelayouts’ are now available.
Enter a name for the zip file in the field ’File name’. Use the extension ’zwt’ (for example contain.zwt).
Activate the checkbox ’Zip user libraries’ if you want to zip the library too.
Activate the checkbox ’Zip frontend code’ if you want to zip the compilation files too.
Activate the checkbox ’Zip pagelayouts’ if you want to zip pagelayouts and bitmaps too.
Press ’Zip’ to start the zipping process. The progress of the zipping process is displayed in the status bar.
Confirm the message box after zipping.
Detailed information about the dialog ’Save project as’ can be
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-15
found in the programming system help. The procedure how to unzip project files is also described in the help.
8 Activating the automatic backup feature
The system provides an automatic backup feature. This means that you
can define, whether the system shall crea te a project backup each time you close the project or after an user defined time interval has elapsed.
To define these settings,
call the dialog ’Options’ by selecting the menu item ’Options...’ in the submenu ’Extras’.
Open the dialog page ’Backup’.
In the dialog area ’Backup’ select the desired option and confirm the
’Options’ dialog.
Important: If the automatic backup feature is activated, the
system does not overwrite backups which are created manually using the menu item ’Save project as/Zip project as...’. The system rather creates a backup file which is named project_name_back.zwt.
Translating the project language
Assume that a project was developed in German, i.e. all comments and description worksheets are written in this language. Further assume that the maintenance staff has to expand or change this project but is not able to understand German.
Due to the system feat u re wh ich allows you to translate project comments and descriptions into any language, situations like the above described are no problem any more.
Basically the translation process is divided into four steps.
1. Exporting all translatable text strings into a project translation export file with the file extension ’txt’. This file then contains all comments and the contents of the description worksheets.
2. Translating the project translation file. The translation can be done manually or by the help of a specific tool, such as a database supported translation tool.
3. Selecting the new project language and re-importing the translated txt­file into the prog ramming syste m.
4. Switching the project language in the project properties dialog.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-16
Exporting a project translation file
In order to translate a project into another language, you first have to export all translatable texts into a so called project translation file. Translatable texts are comments and the contents of the description worksheets. Of course it is not possible to translate text elements which are programming language specific.
The translation file is a usual ASCII-file with the extension ’txt’, i.e. it can be opened and edited with any ASCII-editor. Therefore it is also possible to use customary translation tools for translating the file into the target language.
NOTE: Before exporting the file, the project default language has to be
chosen from the Project Properties’ dialog. (For further information refer to the chapter Switching the project language on page 4-20).
8 E xporting a project trans lation file
Open the submenu 'File' and select the menu item 'Export...'. The dialog 'Import / Export' appears, showing all system add-ins which can be used for exporting files from the project.
Figure 4- 7: Dialog Import / Export when selecting the menu item ’Export...
In the dialog list box mark the entry 'Project translation export' (as shown in the figure) and confirm the dialog. The browse dialog 'Project translation export' appears.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-17
Translatio n File (*txt)
Figure 4- 8: Dialog Project translation export
In the dialog ’Project translation export’ browse to the desired destination directory and enter the name of the export file into the dialog field ’File name’.
Confirm the browse dialog. The system exports all translatab le te xts from the project into the project translation export file.
The next step is to open the export file and translate it either manually or
with the help of a translation tool.
Importing a project translation file
txt
txt
When you have translated the project translation file, you first have to
select the language of the file to be imported and then import the file into the project, before you can switch the project language.
8 Importing a project translation fi le
Open the submenu ’File and select the menu item ’Import...’. The dialog ’Import / Export’ appears, showing all system add-ins which can be used for importing files into the project.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-18
Figure 4- 9: Dialog Import / Export when selecting the menu item Import...
In the dialog list box mark the entry Project translation import (as shown in the figure) and confirm the dialog. The browse dialog Project translation import appears.
txt
txt
(*.txt)
Figure 4- 10: Dialog Project translation import
In the dialog ’Project translation import select the language of the text file to be imported. For that purpose open the list box ’Language’ and choose the desired entry.
The language selected here is then available in the properties
dialog of the project, where you can switch the language.
Browse to the desired directory and select the desired import file.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-19
Confirm the dialog. The project translation file is imported into the project. The system displays a message after the successful import process.
The language is now available in the project, but it is not switched
automatically. The next step is to open the properties dialog and switch the project language.
Switching the project language
When you have imported a project translation file, you can switch the
project language.
8 Switchi ng the project language
In the project tree open the context menu of the folder icon ’Project’ by clicking with the right mouse button on it.
In the context menu select the menu item ’Properties...’. The dialog ’Project Properties appears.
Figure 4- 11: Dialog Project Properties
In the dialog open the list box ’Language and select the desired language.
The list box only contains languages, which have been selected
in the dialog ’Project translation import’ before re-importing the
The project language is switched to the selected language.
ControlWave Designer Refer ence M a nual Handling and edit ing projects 4-20
translation file.

Literals, data types and variables

This chapter provides information about...

o literals o data types o editing user defined data types o ways how to declare variables o types of variables and keywords o instantiation
ControlWave Designer Reference Manual Literals, data types and variables
BLANK PAGE

Literals, data types and variables

Literals

Literals can be used to enter external represent at ion of data. Literals are necessary for the representation of numer ic, char acter strings and time data. Every time you have to enter values you have to use liter als.
Numeric literals
The numeric literals which can be used are shown in the following table:
Type Examples
Integer literals -12 0 123_456 +986 Real literals -12.0 0.0 0.4560 3.14159_26 Real literals with exponents -1.34E-12 -1.34e-12 1.0E+6 Base 2 literals INT#2#1111_1111 Base 8 literals INT#8#377 Base 16 literals INT#16#FF SINT#16#ff Boolean FALSE and TRUE FALSE TRUE Boolean 0 and 1 0, 1
Figure 5-1: Numeric literals
Literals which are used in variable worksheets, literals of dat a type INT or BOOL can be used without keyword as it is shown in the following examples: For INT#16#ff you can use 16#ff For BOOL#FALSE you can use FALSE.
In variable declarations you can use "var1 : DINT :=10" but in the code body you have to use "LD DINT#10".
ControlWave Designer Reference Manual Literals, data types and variables 5-1
Character string literals
A character string literal is a sequence of zero or m ore characters included in two single quote characters.
The character string literals which can be used are shown in the f ollowing table:
Type Examples
Empty string ’’ String with a blank ’ ’ Not empty string ’this is a text’
Figure 5-2: Character string literals
Duration literals
Duration data can be represented in hours, minutes, seconds, m illiseconds and in combination.
The duration literals which can be used are shown in the following table:
Type Examples
Short prefix T#14ms t#14ms t#12m18s3.5ms
T#25h_15m t#25h_15m
Long prefix TIME#14ms tim e#14m s TIME#25h_15m
time#25h_15m
Figure 5-3: Duration literals

Introduction to the IEC data types

Data types define the bitsize, the value range and the initial value of a variable. Elementary and user defined data types can be used. Generic data types are basically used for describing the available data types of inputs and outputs of functions.
ControlWave Designer Reference Manual Literals, data types and variables 5-2

Elementary data types

The value ranges and the bitsize of elementary data types are described in IEC 61131-3.
Elementary data types are shown in the following table:
Data type
BOOL Boolean 1 0 up to 1 0 SINT Short integer 8 - 128 up to 127 0 INT Integer 16 -32768 up to 32767 0 DINT Double
USINT Unsigned
UINT Unsigned
UDINT Unsigned
REAL Real
TIME Duration 32 about 24 days t#0s BYTE Bit string of
Description Size Range Default
initial value
integer
short integer
integer
double integer
numbers
length 8
32 -2.147.483.648 up to
+2147.483.647
8 0 up t o 255 0
16 0 up to 65535 0
32 0 up to 4.294.967.295 0
32 3.4E-38 up to
3.40E+38
8 00 up t o FF 0
0
0.0
WORD Bit string of
length 16
DWORD Bit string of
length 32
Figure 5-4: Elementary data types
The use of data types also depends on your hardware. Please refer to your hardware documentat ion f or information about the supported data types.
The data type STRING is also an elementary data type but does not belong to the above mentioned group. Its format in the memory depends on your PLC type. The data type STRING has the following struct ure: Byte 0-1 offset to maximum lengt h (0 corresponds to 80) Byte 2-3 current length Byte 4-83 characters Byte 84 zero terminator
16 0000 up to FFFF 0
32 00000000 up to
FFFFFFFF
0
ControlWave Designer Reference Manual Literals, data types and variables 5-3

Generic data types

Generic data types are data types which include hierarchical groups of elementary data types. ANY_INT includes the element ary data types DINT, INT, SINT, UDINT, UINT and USINT. If a function can be connected with ANY_INT it means that variables of the data types DINT, INT, SINT, UDINT, UINT and USINT can be handled.
Generic data types are shown in the following table:
ANY
ANY_NUM
ANY_BIT
STRING TIME
Figure 5-5: Generic data types
ANY_REAL
REAL
ANY_INT
DINT, INT, SINT UDINT, UINT, USINT
DWORD, WORD, BYTE, BOOL
The use of data types also depends on your hardware. Please refer to your hardware documentation f or restrictions concerning data types.

User defined data types

User defined data types can be declared to create new data t y pes in addition to the elementary data types defined in IEC 61131- 3. This is useful because new data types with different propert ies can be cr eat ed f or an easier and quicker programming. User defined data t y pes ar e also called derived data types.
Three types of user defined data types can be declared:
Array data types Structured data types String data types
&
Please refer to your PLC documentation for inform at ion about available
user defined data types and restrictions. I t is possible that the PLC does not support all described possibilities of using user defined data t y pes!
ControlWave Designer Reference Manual Literals, data types and variables 5-4

Array data types

Declaring arrays
Arr ay data types include several elements of the same data type. The
particular elements within one array are identified and accessed using an array index. An array can be used to declare several elements of the same type with only one line in the type declaration.
TYPE graph : ARRAY[1..23] OF INT; END_TYPE
Figure 5-6: Type declaration of an array data type
In t he example the array ’graph’ contains 23 elements of the data type
’INT’. All elements of an array are stored continuously one after another in the PLC memory.
In or der to declare an array, you first have to declare the array in
the type declaration of the data type worksheet. Subsequently you can declare a variable in the variable worksheet of the POU (refer to the following programming example).
ControlWave Designer Reference Manual Literals, data types and variables 5-5
Programming example
An arr ay should be typically used for data describing the same subject. Let
us imagine that a process changes an input value every 3 seconds. It is necessary to store each of these input values to compar e t hem wit h set points. All input values are of the same data ty pe. I n this case it is useful to declare an array because in the code body declaration the two values can be easily compared using an iteration statement ( e.g. a FOR loop). The single components of the array can be accessed using the array index.
Type declaration: TYPE graph : ARRAY[1..23] OF INT; set_point : ARRAY[1..23] OF INT; END_TYPE
Variable declaration: VAR input : graph;(* incoming values of the machine *) values : set_point; (* values to compare with *) i : INT :=1; (* variable for array index *) run : BOOL :=TRUE; ERROR : BOOL; timer : FB_TIMER; (* declare FB instance *) END_VAR
Code body declaration in ST: timer (pt:=t#3s;in:=run); IF timer.Q THEN (* provide input values to array ’graph’ *) input[i] := %IW0; (* assign input value to array *) run := 0; (* edge detection to start timer again *) i := i+1; (* higher array index *) ELSE run :=1; (* count up *) END_IF; IF i = 23 FOR i:=1 TO 23 BY 1 DO IF input[i] <> values[i] THEN (* comparing array
ERROR := TRUE; END_IF; END_FOR; i := 1; END_IF;
’graph’ to ’set point’ *)
Figure 5-7: Programming example of an array data type
ControlWave Designer Reference Manual Literals, data types and variables 5-6
Mult i-dimensional arrays
If multi-dimensional arrays are needed, arrays of arr ays can be used. An
example for an array of an array is shown in the f ollowing figure:
TYPE graph : ARRAY [1..10] OF INT; my array : ARRAY [1..3] OF graph; END_TYPE
Figure 5-8: Type declaration of an array of array
In an ar r ay of an array a single element is accessed using two indexes as
shown in the following figure:
Variable declaration: VAR var1 : my_array; var2 : INT; END_VAR
Code body declaration in ST: var2 := var1[1] [3];
Figure 5-9: Accessing elements of an array of array
Initializing arrays
Arr ays can be initialized, i. e. to each element contained in the array, a
value can be assigned. As already mentioned above, each single element is accessed using its index. The initialization of an array can be done while editing the code body declaration.
Variable declaration: VAR graph : ARRAY [1..10] OF INT; END_VAR
Code body declaration in ST: graph[1]:=7; graph[2]:=1092; . . . graph[10]:=13;
Figure 5-10: Initializing elements of an array It is not necessary to initialize all elements of an array. I f no initial value is
used, the array element is initialized with t he default initial value when starting the program execution.
ControlWave Designer Reference Manual Literals, data types and variables 5-7

Structured data types

Declaring structures
Str uctured data types include several elements of the same or of dif f erent
data types.
TYPE machine: STRUCT x_pos : REAL; y_pos : REAL; depth : INT; rpm : INT; END_STRUCT; END_TYPE
Figure 5-11: Declaration of a structured data type In t he example the structure ’machine’ consists of 4 components. All
components describe the characteristics of the machine.
Programming example
Str uctures should be used if data describing the same objects have to be
declared. For example a drilling machine drills several holes in one work piece. All holes have a position in x and y position on the work piece, a drilling depth and different revolutions per minutes to drill with. The concrete values for the holes are different but t he variables which are needed are always the same. In this case it is useful to declar e a st r ucture consisting of three components for the posit ion, dr illing depth and revolutions per minute. For each hole different values can be assigned t o the components. The function block for the drilling pr ocess is just working on the same variable being a structure.
Arrays of structures
It is possible to use a structure within arrays as it is shown in the f ollowing
example:
TYPE machine: STRUCT x_pos : REAL; y_pos : REAL; depth : INT; rpm : INT; END_STRUCT; my array : ARRAY[1..10] OF machine; END_TYPE
Figure 5-12: Declaration of an array of structure
An application exam ple for arrays of structures could be a transfer line with
several drilling machines. Via the array index the concrete drilling machine
ControlWave Designer Reference Manual Literals, data types and variables 5-8
Loading...