Lenze DDS User Manual

L
Show/Hide Bookmarks
Manual
Global Drive PLC Developer Studio
Global Drive
Drive PLC Developer Studio
Show/Hide Bookmarks
Important note
The software is supplied to the user as described in this document. Any risks resulting from its quality or use remain the responsibility of the user. The user must provide all safety measures protecting against possible malopera tion.
We do not take any liability for direct or indirect damage, e.g. profit loss, order loss or any loss regarding business.
ã 2005 Lenze Drive Systems GmbH
No part of this documentation may be copi ed or made available to third parties without the explicit written approval of Lenze Drive Systems GmbH.
All information given in this online documentation has been carefully selected and tested for compliance with the hardware and software described. Nevertheless, discrepancies cannot be ruled out. We do not accept any responsibility or liability for any damage that may occur. Any correc tions required will be implemented in subsequent editions.
Windows, Windows NT and MS-DOS are either registered trademarks or trademarks of Microsoft Corporation in the U.S.A a nd/or other coun­tries. IBM and VGA are registered trademarks of International Business Machines, Inc. All other product names are trademarks of the c o rrespondi ng owners.
Version
:
2.3 01/2005
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
1 Preface and gener al information 1-1...........................................
1.1 About this manual 1-1................................................................
1.1.1 T erminology used 1-1.........................................................
1.2 Applied conventions 1-1...............................................................
2 Introduction 2-1...........................................................
2.1 Function overview 2-1................................................................
2.2 Project co mponents 2-2...............................................................
2.2.1 Project 2-2.................................................................
2.2.2 Organization unit (POU) 2-2.....................................................
2.2.3 Function 2-2................................................................
2.2.4 Function block 2-4............................................................
2.2.5 Program 2-6................................................................
2.2.6 PLC_PRG 2-7...............................................................
2.2.7 System POUs 2-7............................................................
2.2.8 Resources 2-8...............................................................
2.2.9 Libraries 2-8................................................................
2.2.10 Data types 2-8..............................................................
2.2.11 Visualization 2-8.............................................................
2.3 Debugging, online functionality 2-9.......................................................
2.3.1 Debugging 2-9...............................................................
2.3.2 Breakpoint 2-9..............................................................
2.3.3 Single step 2-9..............................................................
2.3.4 Single cycle 2-9..............................................................
2.3.5 Changing values online 2-10.....................................................
2.3.6 Monitoring 2-10..............................................................
2.3.7 Simulation 2-10...............................................................
2.3.8 Log 2-10....................................................................
3 Program example “Traffic light” 3-1...........................................
3.1 Introduction 3-1.....................................................................
3.2 Programming 3-2....................................................................
3.2.1 Starting the DDS 3-2..........................................................
3.2.2 Creating a new project 3-2......................................................
3.2.3 Selecting PLC 3-2............................................................
3.2.4 Creating organization units 3-2...................................................
3.2.5 The organization unit TRAFFICLIGHT 3-3............................................
3.2.6 The organization unit WAIT 3-6...................................................
3.2.7 The main program PLC_PRG 3-8.................................................
3.2.8 Extending the program with an alternative branch 3-11..................................
3.3 Simulation 3-14......................................................................
3.4 Visualization 3-15....................................................................
3.4.1 Creating a new visualization 3-15.................................................
3.4.2 Inserting and configuring elements in the visualization 3-15..............................
3.4.3 Visualization in online mode 3-16..................................................
l DDS EN 2.3
i
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
4 Programming languages 4-1.................................................
4.1 The standard IEC 61131-3 4-1..........................................................
4.2 Instruction list (IL) 4-2................................................................
4.2.1 Operators and modifiers 4-2.....................................................
4.3 Structured text (ST) 4-4...............................................................
4.3.1 Expressions 4-4..............................................................
4.3.2 Evaluating expressions 4-4.....................................................
4.3.3 Instructions (overview) 4-5......................................................
4.3.4 Assignment operator 4-5.......................................................
4.3.5 Calling a function block in ST 4-6.................................................
4.3.6 RETURN instruction 4-6........................................................
4.3.7 IF instruction 4-6.............................................................
4.3.8 CASE instruction 4-7..........................................................
4.3.9 FOR loop 4-8................................................................
4.3.10 WHILE loop 4-9..............................................................
4.3.11 REPEAT loop 4-10.............................................................
4.3.12 EXIT instruction 4-10...........................................................
4.4 Sequential Function Chart (SFC) 4-11......................................................
4.4.1 Step 4-11...................................................................
4.4.2 Action 4-11..................................................................
4.4.3 Entry and exit action 4-12.......................................................
4.4.4 Transition/transition condition 4-12................................................
4.4.5 Active step 4-12..............................................................
4.4.6 IEC step 4-13................................................................
4.4.7 Qualifiers 4-14...............................................................
4.4.8 Implicit SFC variables 4-15......................................................
4.4.9 SFC flags 4-15...............................................................
4.4.10 Alternative branch 4-17.........................................................
4.4.11 Parallel branch 4-17...........................................................
4.4.12 Jump 4-17..................................................................
4.5 Function block diagram (FBD) 4-18........................................................
4.6 The Continuous Function Chart editor (CFC) 4-19..............................................
4.7 Ladder diagram (LD) 4-20...............................................................
4.7.1 Contact 4-20.................................................................
4.7.2 Coil 4-20....................................................................
4.7.3 Set/Reset coil 4-21............................................................
4.7.4 Function blocks in LD 4-21......................................................
4.7.5 LD as FBD 4-21...............................................................
5 Desktop 5-1..............................................................
5.1 User interface 5-1...................................................................
5.1.1 Menu bar 5-1...............................................................
5.1.2 Tool bar 5-2................................................................
5.1.3 Object Organizer 5-2..........................................................
5.1.4 Vertical screen divider 5-3......................................................
5.1.5 Desktop 5-3................................................................
5.1.6 Message window 5-3.........................................................
5.1.7 Status bar 5-4...............................................................
5.1.8 Shortcut menu 5-4............................................................
ii
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
5.2 Arrange windows 5-5.................................................................
5.2.1 Commands in the “Window” menu 5-5.............................................
5.3 Basic settings 5-6...................................................................
5.3.1 DDS options 5-6.............................................................
6 Working with projects and objects 6-1.........................................
6.1 Managing projects 6-1................................................................
6.1.1 Commands in the “File” menu 6-1................................................
6.1.2 Commands in the “Project” menu 6-8.............................................
6.1.3 User groups 6-21..............................................................
6.2 Working with objects 6-24..............................................................
6.2.1 Object 6-24..................................................................
6.2.2 Folders 6-25.................................................................
6.2.3 Commands in the shortcut menu 6-25..............................................
6.2.4 Commands in the “Project” menu 6-26.............................................
6.3 Working in online mode 6-32............................................................
6.3.1 Commands in the “Online” menu 6-32..............................................
6.4 Log 6-42...........................................................................
6.4.1 Log characteristics 6-42........................................................
7 Editors 7-1...............................................................
7.1 General edit functions 7-1.............................................................
7.1.1 Commands in the “Edit” menu 7-1................................................
7.2 Declaration editor 7-10.................................................................
7.2.1 Declaration part 7-11...........................................................
7.2.2 Input variables 7-11............................................................
7.2.3 Output variables 7-11..........................................................
7.2.4 Input / output variables 7-12.....................................................
7.2.5 Local variables 7-12...........................................................
7.2.6 Retentive variables 7-12........................................................
7.2.7 Constants, typed literals 7-13....................................................
7.2.8 Retentive constants 7-13........................................................
7.2.9 Keywords 7-13...............................................................
7.2.10 Identifiers 7-14...............................................................
7.2.11 Variable declaration 7-14........................................................
7.2.12 AT declaration 7-15............................................................
7.2.13 Syntax colouring 7-15..........................................................
7.2.14 Short mode 7-16..............................................................
7.2.15 Auto declaration 7-16..........................................................
7.2.16 Line numbers in the declaration editor 7-18..........................................
7.2.17 Declarations as tables 7-18......................................................
7.2.18 Declaration editor in online mode 7-19..............................................
7.2.19 Comment 7-19...............................................................
7.3 Text editors 7-22.....................................................................
7.3.1 Commands in the “Insert” menu 7-22..............................................
7.3.2 Text editors in online mode 7-23..................................................
7.3.3 Breakpoint positions 7-24.......................................................
7.3.4 What happens at a breakpoint? 7-25...............................................
7.3.5 Line numbers of the text editor 7-25...............................................
l DDS EN 2.3
iii
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
7.4 Network editors (general) 7-26...........................................................
7.4.1 Jump labels 7-26.............................................................
7.4.2 Network comments 7-26........................................................
7.4.3 Inserting a new network 7-26....................................................
7.4.4 Inputs/Outputs on the fly 7-27....................................................
7.4.5 Network editors in online mode 7-28...............................................
7.5 Function block diagram editor 7-29.......................................................
7.5.1 Cursor positions in FBD 7-29.....................................................
7.5.2 Placing the cursor 7-30.........................................................
7.5.3 Commands in the “Insert” menu 7-30..............................................
7.5.4 Commands in the “Extras” menu 7-33..............................................
7.5.5 Commands in the “Edit” menu 7-34................................................
7.5.6 The FBD editor in online mode 7-35................................................
7.6 Ladder diagram editor 7-36.............................................................
7.6.1 Cursor positions in LD 7-36......................................................
7.6.2 Commands in the “Insert” menu 7-37..............................................
7.6.3 Organization units with EN inputs 7-38..............................................
7.6.4 Commands in the “Extras” menu 7-39..............................................
7.6.5 The LD in online mode 7-41......................................................
7.7 CFC editor 7-42......................................................................
7.7.1 Cursor positions in CFC 7-43.....................................................
7.7.2 Selecting elements 7-43........................................................
7.7.3 Copying and deleting elements 7-43...............................................
7.7.4 Moving elements 7-44..........................................................
7.7.5 Commands in the “Insert” menu 7-44..............................................
7.7.6 Commands in the “Extras” menu 7-46..............................................
7.7.7 Creating connections 7-48.......................................................
7.7.8 Changing connections 7-49......................................................
7.7.9 Deleting connections 7-49.......................................................
7.7.10 Feedbacks 7-50..............................................................
7.7.11 Processing sequence 7-50.......................................................
7.7.12 Commands in the “Extras” menu, submenu “Order” 7-51................................
7.7.13 CFC in online mode 7-55........................................................
7.8 SFC editor 7-56......................................................................
7.8.1 Selecting blocks 7-56..........................................................
7.8.2 Commands in the “Insert” menu 7-57..............................................
7.8.3 Commands in the “Extras” menu 7-59..............................................
7.8.4 Commands in the “Project” menu 7-63.............................................
7.8.5 SFC flags 7-63...............................................................
7.8.6 Sequential function chart in online mode 7-65........................................
8 Resources 8-1............................................................
8.1 Global variables 8-2..................................................................
8.1.1 Several variable lists 8-2.......................................................
8.1.2 Document template 8-3........................................................
8.2 Code initialization values 8-4...........................................................
8.3 Parameter monitor 8-6................................................................
8.3.1 System codes/User codes 8-7...................................................
8.3.2 Parameterizing codes 8-7......................................................
8.3.3 Differentiating between online and o ffl ine mode 8-7...................................
iv
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
8.4 Parameter Manager 8-8...............................................................
8.4.2 Terminology used by the Parameter Manager 8-10.....................................
8.4.3 Instance Parameter Manager 8-11.................................................
8.4.4 Type Parameter Manager 8-18....................................................
8.4.5 Scale functions 8-18...........................................................
8.5 Process image 8-20...................................................................
8.5.1 Generating the process image 8-21................................................
8.6 PLC configuration 8-23.................................................................
8.6.1 Working in the PLC configuration 8-24..............................................
8.6.2 Touch probe interface 8-26......................................................
8.6.3 Configuring an I/O module 8-26...................................................
8.6.4 Configuring a channel 8-26......................................................
8.7 Task monitor 8-28....................................................................
8.8 Task configuration 8-29................................................................
8.8.1 Task definition 8-29............................................................
8.8.2 Data consistency 8-30..........................................................
8.8.3 Normal data processing/IPO principle 8-30...........................................
8.8.4 If a task overflow leads to a system error 8-31........................................
8.8.5 Task declaration 8-31..........................................................
8.8.6 Working in the task configuration 8-32..............................................
8.9 Watch and Receipt Manager 8-35.........................................................
8.9.1 Watch and Receipt Manager in offline mode 8-35......................................
8.9.2 Watch and Receipt Manager in online mode 8-36......................................
8.9.3 Command overview 8-36........................................................
8.10 Target Settings 8-38...................................................................
8.11 Library Manager 8-41.................................................................
8.11.1 Library Manager window 8-41....................................................
8.11.2 Included libraries 8-43..........................................................
8.11.3 User-defined libraries 8-43......................................................
9 Visualization 9-1...........................................................
9.1 Inserting visualization elements 9-2......................................................
9.1.1 Commands in the “Insert” menu 9-2..............................................
9.2 Editing visualization elements 9-5........................................................
9.2.1 Information in the status bar 9-5.................................................
9.2.2 Expressions 9-5..............................................................
9.2.3 Selecting visualization elements 9-6...............................................
9.2.4 Changing size and shape of visualization elements 9-7.................................
9.2.5 Moving visualization elements 9-7................................................
9.2.6 Copying, cutting, inserting visualization elements 9-7..................................
9.2.7 Deleting visualization elements 9-7...............................................
9.2.8 Commands in the “Extras” menu 9-8..............................................
9.3 Configuring visualization elements 9-10....................................................
9.3.1 Commands in the “Extras” menu 9-10..............................................
9.3.2 Formatted text display 9-14......................................................
9.4 Visualization in libraries 9-21............................................................
l DDS EN 2.3
v
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
10 IEC 61131-3 data types 10-1..................................................
10.1 Standard data types 10-1...............................................................
10.1.1 BOOL 10-1..................................................................
10.1.2 Integer data types 10-1.........................................................
10.1.3 REAL and LREAL 10-1..........................................................
10.1.4 String 10-2..................................................................
10.1.5 Time data types 10-2...........................................................
10.2 Defined data types: 10-2...............................................................
10.2.1 Array 10-2...................................................................
10.2.2 Pointers 10-4................................................................
10.2.3 Enumeration type 10-5.........................................................
10.2.4 Structures 10-6...............................................................
10.2.5 References 10-7..............................................................
10.2.6 Subrange types 10-7...........................................................
11 Operator list 11-1...........................................................
11.1 DDS-integrated IEC operators 11-1........................................................
11.2 Standard.lib-integrated IEC operators 11-3..................................................
12 IEC 61131-3 operators 12-1...................................................
12.1 Arithmetic operators 12-1...............................................................
12.1.1 ADD 12-1...................................................................
12.1.2 MUL 12-1...................................................................
12.1.3 SUB 12-1...................................................................
12.1.4 DIV 12-1....................................................................
12.1.5 MOD 12-3...................................................................
12.1.6 INDEXOF 12-3................................................................
12.1.7 SIZEOF 12-4.................................................................
12.2 Bit-string operators 12-4...............................................................
12.2.1 AND 12-4...................................................................
12.2.2 OR 12-5....................................................................
12.2.3 XOR 12-5...................................................................
12.2.4 NOT 12-5...................................................................
12.3 Bit-shift operators 12-6................................................................
12.3.1 SHL 12-6...................................................................
12.3.2 SHR 12-6...................................................................
12.3.3 ROL 12-6...................................................................
12.3.4 ROR 12-7...................................................................
12.4 Selection operators 12-8...............................................................
12.4.1 SEL 12-8....................................................................
12.4.2 MAX 12-8...................................................................
12.4.3 MIN 12-9...................................................................
12.4.4 LIMIT 12-9..................................................................
12.4.5 MUX 12-10...................................................................
12.5 Comparison operators 12-10.............................................................
12.5.1 GT 12-10....................................................................
12.5.2 LT 12-11.....................................................................
vi
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
12.5.3 LE 12-11.....................................................................
12.5.4 GE 12-11....................................................................
12.5.5 EQ 12-11....................................................................
12.5.6 NE 12-11....................................................................
12.6 Addressing operators 12-12..............................................................
12.6.1 ADR 12-12...................................................................
12.6.2 Contents operator 12-12.........................................................
12.7 Call operator 12-12....................................................................
12.7.1 CAL 12-12...................................................................
12.8 Assignment operator 12-13..............................................................
12.8.1 MOVE 12-13..................................................................
13 IEC 61131-3 operands 13-1...................................................
13.1 Constants 13-1......................................................................
13.1.1 Number constants 13-1.........................................................
13.1.2 BOOL constants 13-1...........................................................
13.1.3 TIME constants 13-1...........................................................
13.1.4 DATE constants 13-2...........................................................
13.1.5 TIME_OF_DAY constants 13-2....................................................
13.1.6 DATE_AND_TIME-Konstanten 13-2................................................
13.1.7 REAL and LREAL constants 13-3..................................................
13.1.8 STRING constants 13-3.........................................................
13.1.9 Type constants (Typed Literals) 13-3...............................................
13.2 Variables 13-4.......................................................................
13.2.1 System variable 13-4...........................................................
13.2.2 Access to variables of arrays, structures and organization units 13-4........................
13.2.3 Addressing bits in variables 13-4..................................................
13.2.4 Identifiers 13-4...............................................................
13.3 Addresses 13-5......................................................................
13.3.1 Address 13-5................................................................
13.3.2 Flags 13-6..................................................................
13.4 Function calls 13-7...................................................................
14 IEC 61131-3 standard functions 14-1...........................................
14.1 Type conversion functions 14-2..........................................................
14.1.1 Converting between integer number types 14-2.......................................
14.1.2 BOOL_TO 14-2...............................................................
14.1.3 TO_BOOL 14-3...............................................................
14.1.4 TIME_TO / TIME_OF_DAY 14-3....................................................
14.1.5 DATE_TO / DT_TO 14-4.........................................................
14.1.6 STRING_TO 14-4..............................................................
14.1.7 TRUNC 14-4.................................................................
14.2 Numerical functions 14-5...............................................................
14.2.1 ABS 14-5...................................................................
14.2.2 SQRT 14-5..................................................................
14.2.3 LN 14-5....................................................................
14.2.4 LOG 14-5...................................................................
14.2.5 EXP 14-5....................................................................
l DDS EN 2.3
vii
Drive PLC Developer Studio
Show/Hide Bookmarks
Contents
14.2.6 SIN 14-6....................................................................
14.2.7 COS 14-6...................................................................
14.2.8 TAN 14-6...................................................................
14.2.9 ASIN 14-6...................................................................
14.2.10 ACOS 14-6..................................................................
14.2.11 ATAN 14-7...................................................................
14.2.12 EXPT 14-7...................................................................
14.3 STRING functions 14-7.................................................................
14.3.1 LEN 14-7...................................................................
14.3.2 LEFT 14-7...................................................................
14.3.3 RIGHT 14-8..................................................................
14.3.4 MID 14-8...................................................................
14.3.5 CONCAT 14-8................................................................
14.3.6 INSERT 14-8.................................................................
14.3.7 DELETE 14-9.................................................................
14.3.8 REPLACE 14-9................................................................
14.3.9 FIND 14-9...................................................................
14.4 Bistable function blocks 14-10............................................................
14.4.1 SR 14-10....................................................................
14.4.2 RS 14-10....................................................................
14.4.3 SEMA 14-11..................................................................
14.5 Edge detection 14-12...................................................................
14.5.1 R_TRIG 14-12.................................................................
14.5.2 F_TRIG 14-13.................................................................
14.6 Counters 14-14.......................................................................
14.6.1 CTU 14-14...................................................................
14.6.2 CTD 14-14...................................................................
14.6.3 CTUD 14-15..................................................................
14.7 Timers 14-16.........................................................................
14.7.1 TP 14-16.....................................................................
14.7.2 TON 14-17...................................................................
14.7.3 TOF 14-18...................................................................
15 Appendix 15-1.............................................................
15.1 Command line commands 15-1..........................................................
15.2 Command file (Cmdfile) commands 15-2....................................................
15.3 IEC keywords 15-5....................................................................
15.4 Key combinations and function keys 15-7...................................................
15.5 Error messages 15-10..................................................................
15.5.1 Warnings 15-10................................................................
15.5.2 Compile errors 15-11...........................................................
15.5.3 Communication errors 15-20......................................................
15.5.4 System-oriented communication error 15-22..........................................
15.6 Glossary 15-23.......................................................................
16 Index 16-1................................................................
viii
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Preface and general information

1 Preface and general information

1.1 About this manual

This Manual offers detailed information on the Drive PLC Developer Studio (DDS).
The Drive PLC Developer Studio is a powerful development environment for your PLC programs on Lenze IEC 61131 systems.
The Drive PLC Developer Studio utilizes the powerful IEC language tools, offering individual editors for the six IEC 61131-3 languages as well as commissioning support through monitoring and debugging functions. The Drive PLC Developer Studio provides all the comfort and ease of fully matured development environments offered by higher-level programming languages under Windows.

1.1.1 Terminology used

Term In the following text used for DDS Drive PLC Developer Studio GDC Global Drive Control
GDO Global Drive Oscilloscope (for servo PLC devices) SB System block FB Function block Parameter codes Codes for setting the functionality of function blocks

1.2 Applied conventions

This Manual applies the following conventions to distinguish between different types of information:
Type of information Print Example
Names of dialog boxes, input fields and selection lists
Buttons bold Click OK to... Menu commands bold Use the command Messages to ...
Keyboard commands <fett> Use <F2> to open the Help Manager.
Program listings Courier IF var1 < var2 THEN... Keywords Courier bold ...starts with FUNCTION and ends with END FUNCTION. Important note Caution!
italics The dialog box Options
(parameter setting program for Lenze PLCs/Lenze automation systems)
If the execution of a function requires several commands, the individual commands are separated by an arrow: Select File
If a command requires a combination of keys, a ”+” is placed between the key symbols: Use <Shift>+<ESC> to ...
Do not use the command Online PC since this command reaches the controller with a time delay.
WOpen to...
WController inhibit for an emergency stop through the
l DDS EN 2.3
Tip TIP!
Positioning the mouse pointer briefly over an icon in the tool bar will display a ”tool tip” with the associated command.
1-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Preface and general information
1-2
DDS EN 2.3
L

2 Introduction

Show/Hide Bookmarks

2.1 Function overview

Project structure
The project is saved in a file that is named after the project. The first organization unit created in the new project is automatically called PLC_PRG. Other
organization units (programs, function blocks and functions) can be called from here. The DDS uses the Object Organizer to differentiate between the different object types within a
project:
Organization units
Data types
Visualization elements (visualization)
Resources.
Object Organizer
The
following objects, among others:
Libraries
Codes
Task configurations
etc.
allows fast access to all objects of your project. Resource structuring uses the
Drive PLC Developer Studio
Introduction
Project generation
Addresses not included in the PLC configuration cannot be used. First configure the control to facilitate access to the system organization units during programming. Then generate the organization units required for your application, or copy them from existing
projects. Program the required organization units in the desired language. On completion of the programming process, compile the project and eliminate any reported errors.
Simulation with the DDS
Once allerrors have been eliminated, activate the simulation, log in to the simulated control and start the project. The DDS is now in online mode.
The window with the PLC configuration can now be opened, and the project can be checked for correct operation. For this purpose, assign the inputs manually and check that the outputs are set as required. The organization units also allow a monitoring of local variable current values. Use the Watch and Receipt Manager to configure the data records to be monitored.
Note!
Lenze function blocks are not simulated. Simulation is generally restricted.
Debugging with the DDS
In the event of a programming error, breakpoints can be set. If program execution stops at a breakpoint, the values of all project variables as at that time can be inspected. Logical correctness of the program can be checked by step-by-step processing (single-stepping).
Program variables and inputs / outputs can be set to specific values.
(^ 6-37)
l DDS EN 2.3
Project documentation using the DDS
The entire project can be documented or exported to a text file at any time.
2-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction

2.2 Project components

2.2.1 Project

A project includes all objects of a control program. Links with the libraries are saved in a file bearing the project name.
A project includes the following objects that can be accessed via the Object Organizer:
Organization units
Data types
Visualizations
Resources
LibrariesCodes

2.2.2 Organization unit (POU)

Functions, function blocks and programs are organization units of a project and referred to as program organization units (POU) in the IEC 61131 programming language.
Every organization unit consists of a declaration part and a body. The body is written in one of the IEC programming languages (IL, ST, SFC, FBD, LD or CFC).
The DDS supports all IEC standard organization units as well as Lenze-specific organization units. Use of these organization units in your project requires the associated function library to be linked to your project with the help of the Library Manager.
Organization units can call other organization units. Recursions cause a compiler error and must be avoided.

2.2.3 Function

A function is asoftware organization unit that returns exactly one data element (that may also consist of several elements such as fields or structures, for example) on execution and whose call may occur in textual languages as an operator in expressions.
Note when declaring a function that a type must be assigned to the function, i.e. the function name must be followed by a colon plus type.
The names of function and function output are identical.
Example of a correct function declaration:
FUNCTION Fct: INT
A function declaration starts with the keyword FUNCTION.
A result must be assigned to the function, i.e. the function name is used like an output
variable.
In ST, a function call may occur as an operand in expressions.
Functions cannot save their internal statuses. Function calls using the same input parameters
always return the same value.
No functions can be programmed in SFC.
2-2
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Function CheckBounds
Tip!
Definition of a function with the name CheckBounds in your project will automatically check whether the boundaries have been exceeded on access to an array in your project! (refer example below). Also refer the Checkbound library (Checkbound.lib).
The function name is defined and must not be changed.
The following program example to test the CheckBoundsfunction corrects access outside defined array boundaries.
The function CheckBounds ensures that the value TRUE is not assigned to position A[10],butto the upper permissible range limit A[7].
Use the function CheckBounds to correct accesses outside array boundaries.
2.2.3.1 Example of a function
Example of a function in IL: Example of the function call of the function shown on the left:
IL LD 7
Fct 4,2 ST result
ST result := Fct(7, 4, 2);
FBD
l DDS EN 2.3
2-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction

2.2.4 Function block

A function block is a software organization unit whose execution returns one or several values.
Unlike a function, a function block does not supply a return value.
A function block declaration starts with the keyword FUNCTION_BLOCK.
The creation of instances (data records) of a function block is a prerequisite.
2.2.4.1 Function block instances
Every instance has its own identifier (instance name) and a data structure which includes its
inputs, outputs and internal variables.
Instances are locally or globally declared like variables by giving the function block name as
identifier type.
Example of an instance named INSTANZ of function block FUB:
INSTANZ: FUB;
The instances described above are always used to call function blocks.
Only input and output parameters can be accessed from outside an instance of a function
block, not its internal variables.
Example with the help of a data model:
Instances L_ABS1 ... L_ABSn are instances of the function block type L_ABS. Instance as many instances as required.
2-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Example of access to an input variable:
(* The function block fb has an input variable in1 of type int. *) PROGRAM prog VAR
inst1:fb;
END_VAR
LD 17 ST inst1.in1 CAL inst1
END_PROGRAM
The declaration parts of function blocks and programs may contain instance declarations.
Instance declarations are not allowed in functions. A function cannot call a function block.
Access to the instance of a function block is restricted to the organization unit in which it was
instanced, unless it was globally declared. Function blocks should never be globally declared as this would lead to logical errors.
The instance name of a function block may be used as input for a function or a function
block.
Counter
bExecute
byNodeAdr
byAnalogModuleNr
byFunction_CH1
byFunction_CH2
L_IOParCounterModule
CTRL
nState
EPM-T110
Ixxxh
Counter is the instance name of function block L_IOParCounterModule and can be used as input in the code.
PROGRAM Counter VAR
Counter: DINT;
END_VAR
Note!
All values remain the same from one execution of the function block to the next. Therefore function block calls with the same arguments do not necessarily return the same output values!
Should the function block include at least one Retain variable, the whole instance is stored in the Retain area.
2.2.4.2 Calling a function block
The input and output variables of a function block can be approached by another organization unit. For this purpose, a function block instance must be generated and the desired variable specified with the help of the following syntax:
<Instance name>.<Variable name>
Input writes only
Input and output reads
To set the input parameters on call in the IL and ST text languages, assign values to the
parameters in brackets after the function block instance name (assignment via := as for the initialization of variables at the point of declaration).
Tip!
SFC allows function block calls in steps only.
l DDS EN 2.3
2-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Declaration part: Instruction part:
PROGRAM test VAR
quad: BOOL; instanz: fub; value: INT:=0;
END_VAR

2.2.5 Program

A program is an organization unit that returns one or several values on execution.
A program declaration starts with the keyword PROGRAM.
Programs are known globally throughout the entire project.
Programs can be called by programs and function blocks. Program calls in a function are not
allowed. Programs do not have instances.
If an organization unit calls a program, thus changing program values, these changes remain
active for the next program call, even if the program is called by another organization unit.
IL CAL instanz(par1:=5,par2:=5)
LD instanz.varout2 ST quad LD instanz.varout1 ST value
ST instanz(par1:=5,par2:=5);
quad:=instanz.varout2; value:=instanz.varout1;
FBD
Tip!
Only the values in the associated instance of a function block are changed on function block call.
These changes are significant only if the same instance is called.
2.2.5.1 Program example
Example of a program in IL: Examples of calling the program shown on the left:
Example of a possible call sequence from a main program:
LD 0 ST PRGexample.par (* par is preset with 0 *) CAL AWLexample (* result in AWLexample=1*) CAL STexample (* result in STexample=2*) CAL FUPexample (* result in FUPexample=3*)
If the variable par of the program PRGexample is initialized with 0 from the main program, and programs are then called successively
by means of the above program calls, the
Changing the call sequence will also change the values of the associated result parameters.
IL CAL PRGexample
LD PRGexample.par ST result
ST PRGexample;
result:=PRGexample.par;
FBD
result will have the values 1, 2, and 3 in the programs.
Note!
The string length is limited by the applied automation system.
2-6
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction
Restrictions occur through limited lengths in the string routines. Only 20 characters can be processed before the string is cut.
The example below illustrates the restriction in online mode.

2.2.6 PLC_PRG

PLC_PRG is a special predefined organization unit for a cyclical task. This organization unit is called exactly once per control cycle.
If Project
dialog box Program. This pre-assignment should not be changed!
Insert object is run for the first time after a new project has been created, the
➞➞
Organization unit
Caution!
Do not delete or rename the organization unit PLC_PRG if you do not use a task configuration. Do not attach PLC_PRG to an already created task as PLC_PRG will then be called several times, leading to logical errors.
PLC_PRG is generally the main program in a single task program.

2.2.7 System POUs

System POUs are hardware-dependent POUs (program organization units) with special functions which are provided by the associated PLC (e.g. 9300 Servo PLC, Drive PLC). (Also refer associated PLC manual)
is pre-assigned with an organization unit called PLC_PRG of type
l DDS EN 2.3
2-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction

2.2.8 Resources

Resources are required to configure and organize your project and to trace variable values:
Global variables to be used throughout the entire project.
PLC configuration to configure your hardware.
Task configuration to control your program through tasks.
Task monitoring to monitor the task runtimes.
Watch and Receipt Manager to display and pre-assign variable values
Automation system settings for selection and, if appropriate, for final configuration of the
automation system

2.2.9 Libraries

The Library Manager can link your project to several libraries whose organization units, data types and global variables can be used in addition to the user-defined ones.
The register card Global Variables contains the variable
Depending on the selected PLC, some libraries are automatically linked when a new project is created (the library standard.lib, for example).

2.2.10 Data types

In addition to the standard data types, users can define some data types of their own. Structures, enumeration types and references can be created.

2.2.11 Visualization

The DDS provides visualization to monitor and modify project variables. The visualization allows offline drawing of geometrical elements that can then change their
shape/colour/text output online, depending on certain variable values.
g_ErrorCheckBounds
.
2-8
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks

2.3 Debugging, online functionality

2.3.1 Debugging

The DDS debugging functions assist troubleshooting.
Introduction
To allow debugging, go to dialog box
Debugging.
Note!
The check box Debugging should be ticked for debugging only. Breakpoint on, Single step or Single cycle are possible only if Debugging is active.

2.3.2 Breakpoint

A breakpoint is a point in the program where processing stops.
Breakpoints enable the user to look at variable values at a certain program location.
Breakpoints can be set in all editors. In the text editors, breakpoints are set to line numbers,
in FBD and LD to network numbers, in CFC to organization units, and in SFC to steps.
Breakpoints may be set in the implementation of an initialized function block. No breakpoints
may be set in function block instances.

2.3.3 Single step

Single step means in:
Options
, category
Build options
and tick check box
IL: Execute program to next CAL, LD or JMP command.
ST: Execute next instruction.
FBD, LD: Execute next network.
SFC: Execute action to next step.
CFC: Execute next organization unit (box) in the CFC program.
The logical correctness of a program can be checked by step-by-step processing.

2.3.4 Single cycle

Selection of Single cycle will stop processing after every cycle.
Caution!
If a breakpoint isset, the useof tasks will lose the real-time response. A 1ms-cycle task will no longer be started every millisecond. If breakpoints are set, all tasks will be started one after the other after the main program PLC_PRG has been processed. Event-controlled tasks will be started upon a valid start event only. This, among other aspects, influences the functionality of the generated overall project.
l DDS EN 2.3
2-9
Drive PLC Developer Studio
Show/Hide Bookmarks
Introduction

2.3.5 Changing values online

Variables can be set once-only to a specific value during operation after the command Write values was transmitted to the control. The value of a variable can also be changed online by simply double-clicking it. Boolean variables thus change from TRUE to FALSE and viceversa. For the other variables, the system will display a dialog box

2.3.6 Monitoring

In online mode, the current valuesfor all variables displayed on screen will be continuously read from the control and displayed. Refer declaration and program editor for this display.
Current variable values may be output in the Watch and Receipt Manager and in a visualization. The display and monitoring of variables from function block instances requires the associated
instance to be opened. The implementations show the pointer value. The dereferenced value is shown for dereferenced
variables.
Monitoring VAR_IN_OUT variables
When monitoring VAR_IN_OUT variables, the de-referenced value is output in the declaration part and the program part.
Write variable xy
to edit the variable value.
Monitoring Pointers
Warning!
Monitoring of de-referenced pointer values is not supported by all Lenze target systems. In online mode, it depends on the target system which de-referenced pointer values (pointer
variable^ ) are indicated. Some Lenze target systems indicate the pointer value itself.
During monitoring the pointer and the de-referenced value are output in the declaration part. In the program part, only the pointer is output.
pointervariable= <pointer value>
Pt= <value>
The value of the pointer is indicated in the implementations, whereas in the case of de-referencing only the de-referenced value is indicated.
Monitoring ARRAY components
The following components are displayed:
Array components indexed via a constant. anarray[1] = 5
The following components are not displayed:
Array components with extended index. anarray[i+j] = 5 or anarray[i+1] = 5

2.3.7 Simulation

During a simulation onthe processor,the generated control program will be processed together with the DDS, offering complete online functionality. Thelogical correctness of the program can be tested to a limited extent only without control hardware.

2.3.8 Log

The log records user actions, internal processes, status changes and exceptions chronologically in online mode and serves monitoring and error tracing.
2-10
DDS EN 2.3
(^ 6-37)
(^ 6-42)
l
Drive PLC Developer Studio
Show/Hide Bookmarks
3 Program example “Traffic light”

3.1 Introduction

This chapter includes a program tutorial for an easier start with the DDS.
The setup calls for the programming of a mini traffic control system for two traffic lights at an intersection.
Both traffic lights will alternate their red/green phases.
To avoid accidents, the traffic lights will also include amber and amber/red between the red
and green phases, with the amber/ red phase being shorter than the amber phase.
This example illustrates
how to implement time-controlled programs using IEC 61131-3 language tools.
how to edit the various standard languages using the DDS.
how to link the different languages.
how to simulate a program in the DDS and visualize it on screen.
Program example
l
DDS EN 2.3
3-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example

3.2 Programming

3.2.1 Starting the DDS

1. In the Windows Start menu, select submenu
Programs➞➞➞LenzeWDrive PLC Developer Studio and click Drive PLC Developer Studio to
start the DDS.
Tip!
If under Project➞➞➞Options, category the project last edited is opened automatically on DDS start.

3.2.2 Creating a new project

2. Select File➞➞➞New to create a new project.
Load & Save
, the check box Automatic loading is selected,

3.2.3 Selecting PLC

3. Open dialog box Configuration (e.g.the9300 Servo PLC) and confirm with OK:
Automation system settings

3.2.4 Creating organization units

4. The dialog box do not change name and type of the organization unit (Program).
New POU
already displays the name of the first organization unit as PLC_PRG;
and select a PLC from the combination box
3-2
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Tip!
Only the organization unit named PLC_PRG of type Programwill be processed by the cyclical task. The cyclical task does not need to be explicitly created.
5. Select Sequential function chart (SFC) as the language for this organization unit and confirm with OK.
6. Now create two further objects in the of Project➞➞➞ObjectWInsert:
TRAFFICLIGHT type Function block in the language Function block diagram (FBD)WAIT type Function block in the language Instruction list (IL)
Object Organizer
on tab
Organization units
with the help
TRAFFICLIGHT
In the organization unit TRAFFICLIGHT, the individual light phases will be assigned to the traffic lights, i. e., the red light will be on during the red and amber/red phases, the amber light will be on during the amber and amber/ red phases, etc.
WAIT
In the organization unit WAIT, a simple timer will be programmed to receive as input the phase duration in milliseconds and to return an output TRUE as soon as the time has expired.
PLC_PRG
The organization unit PLC_PRG links the organization units with each other so that the traffic light emits the correct colour at the correct time and for the specified time. It processes the entire project during the cyclical task.

3.2.5 The organization unit TRAFFICLIGHT

7. To edit the organization unit TRAFFICLIGHT, activate its editor window by selecting
Object Organizer
,tab
Organization units
and double-clicking TRAFFICLIGHT.
3.2.5.1 Declaration
8. In the declaration editor, declare – as input variable (between the keywords VAR_INPUT and END_VAR) a variable named
STATE of type INT.
as output variables (between the keywords VAR_OUTPUT and END_VAR) the variables RED,
AMBER, GREEN and OFF of type BOOL.
l DDS EN 2.3
3-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Thestatusof thevariableSTATE is used to switch the output variables for the associated light colour:
Traffic light phase Input variable Output variables
STATE RED AMBER GREEN OFF
Green 1 FAL SE FA LSE TRUE FAL SE Amber 2 FALSE TRUE FALSE FAL SE Red 3 TRUE FALSE FALSE FAL SE Amber/red 4 TRUE TRUE FAL SE FALS E Off 5 FALSE FA LSE FALS E TRUE
The declaration part of the function block TRAFFICLIGHT nowlooksasfollows:
3.2.5.2 Function block diagram
Now use the input variable STATE of the organization unit to determine the values of the output variables.
9. In the lower half of the editor window for the organization unit TRAFFICLIGHT, click the field to the left of the first network (grey field with number 1) to select the network.
10.Select Insert➞➞➞Operator.
A box with the operator AND and two inputs is inserted in the first network:
11.Click ANDand change the text to EQ”.
12.Select the text ???of the upper input and enter the variable STATE .
13.Select the three bottom question marks and name the input 1.
3-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
14.Click behind the EQ box to select the output.
15.Select Insert➞➞➞Assignment.
16.Change the text ???at the output to GREEN”.
Program example
STATE is compared to 1. If the result is TRUE, GREEN will be assigned.
This network will switch the traffic light to green if the status value input is 1.
The other traffic light colours RED, AMBER and OFF require three more networks.
17.Select Insert➞➞➞Network (after) to create a new network.
18.Select Insert➞➞➞Operator.
19.Click ANDand change the text to OR”.
20.Click behind the OR box to select the output.
21.Select Insert➞➞➞Assignment.
22.Change the text ???at the output to AM BER”.
23.Select the upper input of the OR box and then Insert➞➞➞Operator to insert another operator before the selected input.
l DDS EN 2.3
3-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
24.Use the above procedures and commands to complete the organization unit as follows:
The first organization unit is complete. TRAFFICLIGHT controls the traffic light colours depending on the input of value STATE.

3.2.6 The organization unit WAIT

The organization unit WAIT is to be a timer to control the duration of the different traffic light phases.
25.To edit the organization unit WAIT, activate its editor window by selecting tab
Organization units
and double-clicking WAIT.
3.2.6.1 Declaration
26.In the declaration editor, declare – as input variable (between the keywords VAR_INPUT and END_VAR) a variable named
SETTIME of type TIME.
– as output variable (between the keywords VAR_OUTPUT and END_VAR) a variable named
OK of type BOOL.
27.Pre-assign the output variable OK with FALSE by inserting :=FALSE” at the end of the declaration (but before the ;).
The output variable OK is to output the value TRUE as soon as the time specified with SETTIME has expired. For this function use the organization unit TP, a pulse encoder.
Object Organizer,
3-6
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Pulse encoder TP
The pulse encoder TP has two inputs ( IN, PT) and two outputs ( Q, ET).
If at the input IN TRUE is applied, the output Q ,forthetimePT (in milliseconds) will return the
value TRUE.
ET outputs the time already expired in milliseconds.
Input variable Status Output variables Status/value
IN FAL SE
IN TRUE (ET < PT)
IN (ET = PT)
* The output ET counts the t ime in milliseconds.
To use the pulse encoder TP in the organization unit WAIT we must create a local instance of TP :
28.Use the declaration editor to declare as local variable (between the keywords VAR and END_VAR) a variable named DELAY of type TP.
Q FAL SE ET 0 Q TRUE ET 0 ì PT* Q FAL SE ET PT
3.2.6.2 Instruction list
To implement the timer, the instruction list for the organization unit WAIT must be as follows:
l DDS EN 2.3
3-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
Process
The first interrogation establishes whether Q is already set to TRUE ( TRUE: timer running). [
If QisTRUE, we will not change the assignment of DELAY but instead call function block
DELAY without input (to check whether the time has already expired). [
If QisFALSE, we will set the variable IN in DELAY to FALSE and thus at the same time ET
to 0 and Q to FALSE.[ All variables are now set to the desired initial status.
– Now save the time required from variable SETTIME in variable PT [
with IN:= TRUE.[
– In the function block DELAY , the variable ET will now be counted up until it reaches the
value SETTIME ; then Q will be switched to FALSE .
The negated value of Q will be saved after every WAIT cycle in OK [
As soon as Q becomes FALSE, OK becomes TRUE.
The timer is complete.

3.2.7 The main program PLC_PRG

Line 4
Line 7
]
]
Line 10
Line 5/6
Line 14/15
Line 1
]
], and call DELAY
]
]
The organization unit PLC_PRG is the main program for calling the two function blocks WAIT and TRAFFICLIGHT .
29.To edit the organization unit PLC_PRG, activate its editor window by selecting
Object Organizer,
tab
Organization units
3.2.7.1 Declaration
To ensure that the function blocks created before can be used inPLC_PRG , it is necessary to declare instances of these function blocks. The traffic light example requires two instances of the function block TRAFFICLIGHT ( LIGHT1, LIGHT2) and one instance of the function block WAIT ( WAIT1).
30.Use the declaration editor to declare as local variable (between the keywords VAR and END_VAR) the variables for the required instances.
3.2.7.2 Sequential function chart
The start-up diagram of an organization unit in SFC always consists of an action Init, a subsequent transition Tr a ns0 and a jump back to Init.
and double-clicking PLC_PRG .
3-8
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
The traffic light example requires a step for every traffic light phase.
31.Select the transition Tr ans 0 (click the horizontal line to the left of Tra ns0 )toframeitwitha dotted line.
32.Select Insert➞➞➞Step transition (after) to insert a step transition after Tra ns0.
33.Repeat the above step seven times to create the following sequential function chart: – To delete a step or transition, select the step and the associated transition, otherwise they
cannot be deleted.
– First click the step, press <Shift>, then click the transition.
Clicking the name of a transition or step directly will invert the text for editing.
34.Change the name of the first transition after Init to TRUE.
35.Change the names of all subsequent transitions to WAIT1.OK” .
The first transition switches all the time, all other transitions when WAIT1 in OK becomes
TRUE , i.e. when the specified time has expired.
36.Change the names of the steps as described below (from top to bottom):
Init (remains unchanged)CHANGE1GREEN1CHANGE2RED1CHANGE3GREEN2CHANGE4RED2
”CHANGExstands for a amber phase each time, GREEN1means that traffic light 1 will be
green and GREEN2applies for traffic light 2, RED1means that traffic light 1 will be red and RED2applies for traffic light 2.
l DDS EN 2.3
3-9
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
37.Change the return jump address (underneath the arrow) from Initto CHANGE1to create the following sequential function chart:
Now the individual steps must be programmed.
Double-clicking a step field will open a dialog box to create a new action.
We will use IL throughout our example.
38.Double-click the step Initto open the dialog box
39.Select IL as the language for the action and confirm with OK.
New action
.
3-10
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
40.Enter the following actions for the step Initinto the editor window and define the actions for the other steps in the same way.
Step Actions Status Light1/Light2
Init CAL LIGHT1(STATE:=3)
CAL LIGHT2(STATE:=3)
CHANGE1 CAL LIGHT1(STATE:=4)
GREEN1 CAL LIGHT1(STATE:=1)
CHANGE2 CAL LIGHT1(STATE:=2)
RED1 CAL LIGHT1(STATE:=3)
CHANGE3 CAL LIGHT1(STATE:=3)
GREEN2 CAL LIGHT1(STATE:=3)
CHANGE4 CAL LIGHT1(STATE:=3)
RED2 CAL LIGHT1(STATE:=3)
CAL LIGHT2(STATE:=3) CAL WAIT1(SETTIME:=t#2s)
CAL LIGHT2(STATE:=3) CAL WAIT1(SETTIME:=t#5s)
CAL LIGHT2(STATE:=3) CAL WAIT1(SETTIME:=t#2s)
CAL LIGHT2(STATE:=3) CAL WAIT1(SETTIME:=t#1s)
CAL LIGHT2(STATE:=4) CAL WAIT1(SETTIME:=t#2s)
CAL LIGHT2(STATE:=1) CAL WAIT1(SETTIME:=t#5s)
CAL LIGHT2(STATE:=2) CAL WAIT1(SETTIME:=t#2s)
CAL LIGHT2(STATE:=3) CAL WAIT1(SETTIME:=t#1s)
This completes the first phase of our program. You can now compile the program and test it in a simulation.

3.2.8 Extending the program with an alternative branch

To include at least one alternative branch in our chart so that we can turn the traffic lights off over night, we will include a counter to deactivate thesystem after a specific number of traffic light cycles.
Firstly, we will need a new variable COUNTER of type INT.
41.To edit the organization unit PLC_PRG, activate its editor window by selecting
Organizer
42.Use the declaration editor to declare as local variable (between the keywords VAR and END_VAR) the variable COUNTER of type INT.
43.Initialize the variable COUNTER in the step Initwith 0:
Step Actions Status Light1/Light2
Init CAL LIGHT1(STATE:=3)
,tab
Organization units
CAL LIGHT2(STATE:=3)
LD 0 ST COUNTER
and double-clicking PLC_PRG .
Object
l DDS EN 2.3
3-11
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
44.Select the transition after CHANGE1and then Insert➞➞➞Step transition (after) to insert a step transition.
45.Select the newly new created transition and then Insert➞➞➞Alternative branch left to insert an alternative branch to the left of it.
46.Select the left transition and then Insert➞➞➞Step transition (after) to insert a step transition.
47.Select the newly new created transition and then Insert➞➞➞Jump to insert a jump.
3-12
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
48.Name the newly inserted steps/transitions as shown below:
Program example
49.Define the following actions for the two new actions and the new transition condition:
Step Actions Information
COUNT
OFF
Transition Actions Information
LIGHTOFF
Counter increased by 1.
Both traffic lights will be switched off for 10 seconds, and the counter will be reset to 0.
Transition checks whether COUNTER is greater than a certain number (in this example: 7).
Our example switches the traffic light to night mode after seven cycles, then off for 10 seconds before the system switches to day mode and the process starts again.
Tip!
Select File➞➞➞Save as to save the project under a new name.
Use the dialog box
box with Save.
Save as
, input field File name to enter a name and then close the dialog
l DDS EN 2.3
3-13
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example

3.3 Simulation

Now test the program.
1. Select Project➞➞➞Compile all to compile the program.
2. Select Online➞➞➞Simulation to test the program in simulation mode.
3. Select Online➞➞➞Log in to log into the control.
4. Select Online➞➞➞Start to execute the program.
Since the simulation mode is activated, the program will be executed in the DDS instead of the control.
Monitoring
You can follow the sequence of the individual steps of your main program PLC_PRG in the editor window.
The active step is displayed blue.
Double-click the plus sign in the declaration editor to open the variable declaration and
monitor the current individual variable values.
3-14
DDS EN 2.3
l

3.4 Visualization

Show/Hide Bookmarks
Now that the traffic light system has been programmed in the DDS and tested in simulation mode, we can use the DDS to visualize traffic light operation on screen.

3.4.1 Creating a new visualization

The DDS visualization feature is located on tab Visualization in the Object Organizer.
1. Select
2. Select Project➞➞➞Object➞➞➞➞Insert to create a new visualization.
3. Use the dialog box with OK.
The system will open a window to help create the new visualization:
Object Organizer
New visualization
and then tab Visualization.
Drive PLC Developer Studio
Program example
to enter a new name for the visualization and confirm
Tip!
Use the command Extras➞➞➞Settings to open a dialog box to set the representation, frame and grid for the visualization.

3.4.2 Inserting and configuring elements in the visualization

The elements circle (ellipse) and rectangle are rquired to represent the traffic lights. The approach below is one of several:
1. Select InsertWEllipse to draw a circle.
2. Double-click the circle to open the dialog box Configure element .
3. Use the category Variables, input field Change colour to enter the variable
PLC_PRG.LIGHT1.RED .
4. Use the category Colours toselectadarkshadeforColour inside (fill colour) .
5. Use the category Colours to select a red shade for Signal colour inside (fill colour) .
6. Copy the selected circle to the clipboard using <Ctrl>+<C>.
7. Insert the copied circle twice into the drawing using <Ctrl>+<V> and position the inserted
circles as shown on the left, keeping the left mouse key depressed.
8. Configure the inserted circles as follows with a double-click: – Middle circle:
Category Variables, input field Change colour: PLC_PRG.LIGHT1.YELLOW Category Colours, Colour inside (fill colour): select a dark shade Category Colours, Signal colour inside (fill colour): select yellow shade
– Bottom circle:
Category Variables, input field Change colour: PLC_PRG.LIGHT1.GREEN Category Colours, Colour inside (fill colour): select a dark shade Category Colours, Signal colour inside (fill colour): select green shade
l
DDS EN 2.3
3-15
Drive PLC Developer Studio
Show/Hide Bookmarks
Program example
9. Select InsertWRectangle to draw a rectangle over the three circles.
10.Double-click the rectangle to open the dialog box Configure element .
11.Use the category Colours toselectadarkgreyshadeforColour inside (fill colour).
12.Select ExtrasWTo the background to put the rectangle behind the circles.
13.Use the mouse pointer to draw a frame around the elements to select all elements within the frame.
14.Copy the selected elements to the clipboard using <Ctrl>+<C>.
15.Insert the copied elements into the drawing using <Ctrl>+<V> and position the inserted elements as shown on the left, keeping the left mouse key depressed.
16.Configure the three circles of the traffic light on the right as follows with a double-click:
– Upper circle:
Category Variables, input field Change colour: PLC_PRG.LIGHT2.RED
– Middle circle:
Category Variables, input field Change colour: PLC_PRG.LIGHT2.YELLOW
– Bottom circle:
Category Variables, input field Change colour: PLC_PRG.LIGHT2.GREEN
17.Select InsertWRectangle to draw a rectangle underneath each traffic light.
18.Configure the rectangles as follows with a double-click:
– Use the category Colours to select No frame colour. – Use the category Tex t to enter a text for each traffic light
(example: “LIGHT1” and “LIGHT2”).

3.4.3 Visualization in online mode

Restart the program, and the traffic lights will be ”on” in the visualization for the specified times, and correct functioning of the traffic control system can be very simply tested.
Tip!
For a detailed description of the visualization process refer chapter (^ 9-1)
3-16
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks

4 Programming languages

4.1 The standard IEC 61131-3

The standard IEC 61131-3 is an international standard for PLC programming languages.
The programming languages implemented in the DDS are in conformity with the requirements of this standard.
According to this standard, a program consists of the following elements:
Structures
Organization units
Global variables
Local variables
Configuration
etc.
Programming languages
l DDS EN 2.3
4-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.2 Instruction list (IL)

An instruction list (IL) consists of a sequence of instructions.
Each instruction starts with a new line, contains an operator and - depending on the type of
operation - one or several comma-separated operands.
An instruction may be preceded by a jump label followed by a colon (;).
Additional comments can be entered.
Blank lines may be inserted between instructions.
All commands are saved in an accumulator where intermediate results and the result of the
last command are stored.
Example:
LD 17 ST lint (* comment *) GE 5 JMPC next LD idword EQ istruct.sdword STN test next:

4.2.1 Operators and modifiers

The following operators and modifiers can be used in IL.
Modifiers
C: conditional for JMP, CAL, RET:
The instruction will only be carried out if the result of the preceding expression is TRUE.
N for JMPC, CALC, RETC:
The instruction will only be carried out if the result of the preceding expression is FALSE.
N otherwise
Negation of the operand (not of the accumulator).
4-2
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages
The table lists some IL operators along with possible modifiers and their respective meaning:
Operator Modifiers Meaning
LD N (=”NOT”) Load Load instruction ST N Store Save the current result in the operand location S Set Set Boolean operand to TRUE exactly if the current result is TRUE. R Reset Set Boolean operand to FALSE exactly if the current result is TRUE. AND N,( Bit-by-bit AND OR N,( Bit-by-bit OR XOR N,( Bit-by-bit exclusive OR ADD ( Addition SUB ( Subtraction MUL ( Multiplication DIV ( Division GT ( > Greater than GE ( >= Greater than or equal to EQ ( = Equal to NE ( <> Not equal to LE ( <= Less than or equal to LT ( < Less than JMP/JMPC N Jump Jump to label CAL/CALC N Call Call program or function block RET/RETC N Return Return from calling a function block
) Evaluate operation that has been deferred
For a more comprehensive IEC operator list refer chapter 12.
Example
IL program using several modifiers
LD TRUE (* Load TRUE to the accumulator *) ANDN BOOL1 (* Execute AND with the negated value
of the variable BOOL1 *)
JMPC label (* If the result was TRUE
jump to the label “label” *)
LDN BOOL2 (* save the negated value of *) ST ERG (* BOOL2 in ERG *)
Label:
LD BOOL2 (* save the value of *) ST ERG (* BOOL2 in ERG *)
IL also allows the setting of parentheses after an operation. The value in parentheses is taken as operand.
Example 1 Example 2
LD 2 LD 2 MUL 2 MUL (2 ADD 3 ADD 3
)
ST Result ST
l DDS EN 2.3
In example 1, the value of Result is 7.
In example 2 with parentheses the value for Result is 10, because the operation MUL will
only be evaluated on reaching ” )” ; the operand for MUL is 5.
4-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.3 Structured text (ST)

Structured text consists of a series of instructions that can be executed as conditioned in very high-level languages (IF..THEN..ELSE)or inloops (WHILE..DO). An instruction is completed with a semicolon;.
Example:
IF value < 7 THEN
WHILE value < 8 DO
value := value + 1;
END_WHILE;
END_IF;

4.3.1 Expressions

An expression returns a value on evaluation and consists of operators and operands.
An operand can be
a constant,
a variable,
a function call
or another expression.

4.3.2 Evaluating expressions

Expressions are evaluated by processing operators following certain priorities. Operators with the highest priority are processed first followed by operators with the second highest priority and so on, until all operators are processed. Same-priority operators are processed from left to right.
The following table lists ST operators in the order of their priority.
Operation Symbol Priority (ranking)
Parentheses (Expression) Highest priority Function call Function name (parameter list)
Exponentiation EXPT Negation ­Complementation NOT Multiplication * Division / Modulo MOD Addition + Subtraction ­Compare <, >, <=, >= Equal to = Not equal to <> Bool AND AND Bool XOR XOR Bool OR OR Lowest priority
4-4
DDS EN 2.3
l

4.3.3 Instructions (overview)

Show/Hide Bookmarks
The following instructions are available in ST:
Instruction type Example
Assignment by assignment operator A:=B;
Function block call use of the FB output
RETURN RETURN; IF condition D:=B*B;
CASE s election CASE INT1 OF
FOR loop J:=101;
WHILE loop J:=1;
REPEAT loop J:=-1;
EXIT EXIT;
Dummy instruction ;
Drive PLC Developer Studio
Programming languages
CV:=CV+1; C:=SIN(X);
CMD_TMR(IN:=%IX1.0.1, PT:=T#300ms); A:=CMD_TMR.Q
IF D<0.0 THEN
C:=A;
ELSIF D=0.0 THEN
C:=B;
ELSE
C:=D;
END_IF;
1: BOOL1:=TRUE; 2: BOOL2:=TRUE;
ELSE
BOOL1:=FALSE; BOOL2:=FALSE;
END_CASE;
FOR I:=1 TO 100 BY 2 DO
IF ARR[I]=70 THEN J:=I; EXIT;
END_IF;
END_FOR;
WHILE J<=100 AND ARR[J]<>70 DO
J:=J+2;
END_WHILE;
REPEAT
J:=J+2;
UNTIL J= 101 OR ARR[J]=70 END_REPEAT;

4.3.4 Assignment operator

l DDS EN 2.3
The value of the expression on the right-hand side of an assignment is assigned to an operand (variable, address) on the left-hand side of an assignment by using the assignment operator :=.
Example:
Var1 := Var2 * 10;
After this line has been executed Var1 is ten times the value of Var2.
4-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.3.5 Calling a function block in ST

A function block in ST is called by using the name of the function block instance followed by parentheses in which the parameters are assigned the required values.
Example
A timer is called with assignments for parameters IN and PT:
CMD_TMR(IN := %IX1.0.1, PT := T#300);
The result variable Q is then assigned to variable A:
A:=CMD_TMR.Q
As in IL, the result variable is addressed using the function block name followed by a period
and the variable name.

4.3.6 RETURN instruction

The RETURN instruction is used to complete the processing of the organization unit and to return to the calling organization unit, depending on a condition, for instance.

4.3.7 IF instruction

Use the IF instruction to check a condition. Instructions can be executed depending on this condition.
Syntax:
IF <Boolean_expression1> THEN
<IF_instructions>
{ELSIF <Boolean_expression2> THEN
<ELSIF_instructions1> ...
ELSIF <Boolean_expression n> THEN
<ELSIF_instructions n-1>
ELSE
<ELSE_instructions>}
END_IF;
The part in curly brackets {} is optional.
If <Boolean_expression1> returns TRUE, only <IF_instructions> will be
executed.
Otherwise the Boolean expressions starting with <Boolean_expression2> will be evaluated
one after the other until one of the expressions returns TRUE. Then only the instructions after this Boolean expression and before the next ELSE or ELSIF will be evaluated.
If none of the Boolean expressions is TRUE, only the <ELSE_instructions> will be
evaluated.
4-6
DDS EN 2.3
l
Example:
Show/Hide Bookmarks
IF temp < 17 THEN
heating_on:=TRUE;
ELSE
heating_on:=FALSE;
END_IF;
In this example the heating is switched on only if the temperature falls below 17 degrees Centigrade, otherwise the heating will remain off.

4.3.8 CASE instruction

Use the CASE instruction to aggregate several conditional instructions with the same conditional variable.
Syntax:
CASE <Var1> OF
<Value 1>:<instruction 1> <Value 2>:<instruction 2> ... <Value n>:<instruction n>
ELSE
<ELSE instruction> END_CASE;
Drive PLC Developer Studio
Programming languages
A CASE instruction is processed as described below:
Ifthevariablein<Var1> is set to <Value i>, the instruction <instruction i> will be
executed.
If <Var 1> does not equal one of the specified values, the <ELSE instruction> will be
executed.
If the same instruction is to be executed for several variable values, these values can be
comma-separated to indicate that they are linked to the same instruction.
If the same instruction is to be executed for a value aggregate of the variable, the start and
end values can be separated by two successive periods to indicate that they are linked to the same instruction.
Example:
CASE INT1 OF
1,5:BOOL1:=TRUE; BOOL3:=FALSE; 2:BOOL2:=FALSE; BOOL3:=TRUE;
10..20:BOOL1:=TRUE; BOOL3:=TRUE;
ELSE
BOOL1:=NOT BOOL1; BOOL2:=BOOL1 OR BOOL2;
END_CASE;
l DDS EN 2.3
4-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.3.9 FOR loop

Use the FOR loop to program repetitive procedures.
Syntax:
INT_Var :INT;
FOR <INT_Var>:=<INIT_VALUE> TO <END_VALUE> {BY <step size>} DO
<instructions>
END_FOR;
The part in curly brackets {} is optional.
The <instructions> are executed as long as the counter<INT_Var> is not greater than
the<END_VALUE>.
A check is performed before the <instructions> are executed so that the
<instructions> will never be executed if <INIT_VALUE> is greater than <END_VALUE>.
Whenever the section <instructions> has been executed, <INT_Var> will be increased
by <step size>.
The step size can have any integer value. If no other step size is specified, step size 1 will be
used. The loop must terminate because <INT_Var> will only become greater.
If <INIT_VALUE> is greater than <END_VALUE> and <step size> is negative, the FOR
loop is counted in opposite direction.
If <INIT_VALUE> is less than <END_VALUE> and <step size> is negative, the FOR loop
will not be executed.
Example:
FOR Counter:=1 TO 5BY1DO
Var1:=Var1*2; END_FOR; Res:=Var1;
Assuming that the variable Var1 has been pre-assigned value 1, it will be 32 after the FOR loop.
Caution!
<END_VALUE> must not be the limit value of the counter <INT_VAR>. If, for instance, the variable Counter is of type SINT, <END_VALUE> must not be 127 since
otherwise the loop would be endless.
After completion of the FOR loop, Counter has a value 6.
4-8
DDS EN 2.3
l

4.3.10 WHILE loop

Show/Hide Bookmarks
The WHILE loopcanbeusedlikeaFOR loop, the only difference being that the cancel condition can be any Boolean expression.
Syntax:
WHILE <Boolean expression> DO
<instructions>
END_WHILE;
The <instructions> will be executed again and again until the
<Boolean_expression> returns TRUE.
If <Boolean_expression> is FALSE on first evaluation already, the <instructions> will
never be executed.
If <Boolean_expression> is never FALSE the <instructions> will be repeated
endlessly, forcing a runtime error.
Drive PLC Developer Studio
Programming languages
Note!
The programmer himself must ensure that endless loops do not occur by changing the condition in the instruction part of the loop, for instance change the counter settings. Otherwise the task with the endless loop would overflow.
Example:
WHILE Counter<>0 DO
Var1:=Var1*2; Counter:=Counter-1;
END_WHILE
The WHILE and the REPEAT loops are more powerful in a way than the FOR loop since the number of loop cycles does not need to be known prior to loop execution.
In some cases, these two loop types will have to be sufficient.
If the number of loop cycles is known, however, a FOR loop should be preferred.
Task overflows can also occur in FOR loops.
(^ 4-8)
l DDS EN 2.3
4-9
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.3.11 REPEAT loop

The REPEAT loop differs from the WHILE loop in that the cancel condition will only be checked after the loop has been carried out. This means that the loop must be executed at least once no matter what the cancel condition is.
Syntax:
REPEAT
<instructions>
UNTIL <Boolean expression> END_REPEAT;
The <instructions> are executed until <Boolean expression> returns TRUE.
If <Boolean expression> returns TRUE on first evaluation already, the
<instructions> will be executed exactly once.
If <Boolean_expression> is never TRUE, the <instructions> will be repeated
endlessly, forcing a runtime error.
Example:
REPEAT
Var1:=Var1*2;
Counter:=Counter-1;
UNTIL
Counter=0 END_REPEAT;

4.3.12 EXIT instruction

If the EXIT instruction is part of a FOR-, WHILE or REPEAT loop, the loop will be terminated irrespective of the cancel condition.
In nested loops, EXIT terminates the innermost loop.
4-10
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks

4.4 Sequential Function Chart (SFC)

Sequential Function Chart is a graphically oriented language that enables the user to describe the chronological sequence of different actions within a program.
Example of a network in SFC
Programming languages

4.4.1 Step

An organization unit written in SFC consists of a sequence of steps that are interconnected through transitions.
There are two different step types:
The simplified step consist of an action and a flag to indicate whether the step is active or
not. A small triangle appears in the top right-hand corner of the step to indicate that the action for a step has been implemented.
An IEC step consists of a flag and one or more assigned actions or Boolean variables. The
associated actions appear to the right of the step.

4.4.2 Action

An action may contain a sequence of instructions in IL, CFC or ST, a number of networks in FBD or LD or another sequence structure (SFC).
Simplified steps always have an action linked to the step.
Actions can be edited by double-clicking the step linked to the action or selecting the step
before executing menu command Extras➞➞➞Zoom action/transition. Furthermore, the configuration allows one entry and / or one exit action per step.
In the
organization unit and can be loaded into the editor with a double-click or pressing the <Enter> key. New actions can be generated with Project➞➞➞Add action.
Object Organizer
, actions of IEC steps are grouped directly underneath their SFC
l DDS EN 2.3
4-11
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.4.3 Entry and exit action

In addition to the step action, a step may be added an entry action and an exit action.
An entry action is executed once-only immediately after the step has been activated.
An exit action is executed once-only before the step is deactivated.
Entry and exit actions can be implemented in any language.
A step with entry action is identified with an ’E’ in the bottom left-hand corner, the exit action with an ’X’ in the bottom right-hand corner.
Double-click the respective corner in the step to edit an entry or exit action.
Example of a step with entry and exit actions:
Note!
Any exit action contained in the active step will be executed during the next cycle only, provided the subsequent transition is TRUE.

4.4.4 Transition/ transition condition

There are so-called transitions between the steps. A transition condition must have a value TRUE or FALSE and can therefore consist of
a Boolean variable
a de-referenced address to Boolean variable (
a Boolean constant (TRUE)
a sequence of instructions with a Boolean result in ST syntax
(e. g. (i<=100) AND b)
a sequence of instructions programmed in any language
A transition must not contain any programs, function blocks or assignments.
Tip!
The next step can be reached both via transitions and the single step mode. (SFCtip and SFCtipmode)
poTo_bTest
)

4.4.5 Active step

The initial SFC editor call always executes the action pertaining to the initial step.
A step whose action is being executed is referred to as the active step.
In online mode, active steps are displayed in blue.
4-12
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages
In a control cycle, all actions belonging to active steps are being executed. The subsequent transition condition is checked once an active step has been executed. If the transition condition is met (TRUE), the subsequent step will be executed during the next control cycle.
Step flag
Each step has a flag to save the step status.
Note!
A step flag bears the steps name. A step and a Boolean variable must not bear the same name as logical errors may otherwise occur.
The flag does not need to be explicitly declared.
The step flag (active or inactive step status) is represented by the logical value of a Boolean
variable <StepName>.
This Boolean variable has a value TRUE if the associated step is active, and FALSE if it is not.
This variable is implicitly declared and can be used in any action and transition of the SFC organization unit.
Time flag
Theactivetimeofastepcanbeinterrogatedviaflag_tim e <StepName>.
The flag does not need to be explicitly declared.
Interrogation works only if a minimum time was set in the step attributes for the step to be
interrogated, for example t#0ms.

4.4.6 IEC step

SFC also offers standard-compliant IEC steps in addition to the simplified steps.
Include the SFC library iecsfc.lib into your project to use IEC steps.
An IEC step can be assigned any number of actions.
Unlike simplified steps, IEC actions are not firmly assigned to a step as an entry or exit action,
but are available separately from the steps and can be applied more than once within their organization unit. For this purpose, IEC actions must be linked with the desired steps with the help of command Extras➞➞➞Associate action.
Not only actions but also Boolean variables can be assigned to steps.
So-called qualifiers control activation and deactivation of actions and Boolean variables, also
permitting time delays.
Concurrences may occur since an action may still be active even if the next step may already
be processed, via qualifier S (Set ), fo r ex am ple.
Associated Boolean variables are set or reset on each SFC organization unit call, i. e. it is reassigned either the value TRUE or FALSE each time.
The actions associated with an IEC step are displayed in a split box to the right of the step. The left-hand field contains the qualifier (if necessary with time constants), the right-hand field the name of the action or the Boolean variable.
l DDS EN 2.3
4-13
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages
Example of a two-action IEC step:
For easier monitoring of the processes, all active actions, like active steps, are displayed in
blue in online mode. Which actions are active, is checked after every cycle.
Whether a newly inserted step is an IEC step is dependent on whether menu command
Extras➞➞➞Use IEC steps has been selected.
Note!
Note restriction on the use of time qualifiers for actions used more than once within the same cycle. Following a call, the deactivated actions are processed first before all active actions, both in
alphabetical sequence.
In the
Object Organizer
unit:
New actions can be generated with Project

4.4.7 Qualifiers

The following qualifiers are available to associate actions to IEC steps:
N
Non-stored The action is active as long as the step is active.
R overriding Reset The action is deactivated. S Set (Stored) The action is activated and remains active until reset. L time Limited The action is active for a certain period of time but no longer than the step is active. D time Delayed The action will become active after a certain period of time, as long as the step is still active, and
P Pulse The action is executed exactly once-only when the step becomes active. SD Stored and time Delayed The action is activated after a certain period of time and remains active until reset. DS Delayed and Stored The action is activated after a certain period of time as long as the step is still active, and remains
SL Stored and time Limited The action is active for a certain period of time.
, the actions are attached directly under the associated SFC organization
Add action.
➞➞
then as long as the step remains active.
active until reset.
The qualifiers L, D, SD, DS and SL require a time specification in TIME constant format,
e.g. L T#5s.
4-14
DDS EN 2.3
l
Note!
Show/Hide Bookmarks
When an action is deactivated, it will be executed once again. This means that every action is executed at least twice (even actions with qualifier P).
If the same action is applied in two directly successive steps with time-affecting qualifiers, the time qualifier will not be effective on second use. To avoid this behaviour, insert an intermediate step to allow re-initialization of the action status in the additional cycle that must then be run.

4.4.8 Implicit SFC variables

SFC provides implicitly declared variables for use.
The step flag (active or inactive step status) is called <StepName>.x for IEC steps.
This Boolean variable has a value TRUE if the associated step is active, and FALSE if it is not.
This variable is implicitly declared and can be used in any action and transition of the SFC organization unit.
Drive PLC Developer Studio
Programming languages
Whether an IEC action is active or not can be interrogated with the help of variable
<ActionName>.x. During the IEC action deactivation run, this variable already holds a value FALSE.
With IEC steps, the implicit variable <StepName>.t canbeusedtointerrogatetheactive
time of a step. Interrogation works only if a minimum time was set in the step attributes for the step to be interrogated, for example t#0ms.

4.4.9 SFC flags

SFC flags are for step control and must be globally or locally declared.
Flag variables and their properties
SFCEnableLimit
This specific variable is a BOOL-type variable. If TRUE, the process registers step timeouts in SFCError and otherwise ignores them. This application may be useful for commissioning or manual
operation, for example.
SFCInit
If this variable is TRUE, the SFC and the other flags are reset to the init step (initialization). As long as the variable is TRUE, the init step remains set without being executed. If SFCInit is reset to FALSE, the organization unit will be processed further.
l DDS EN 2.3
SFCReset
This BOOL-type variable behaves similarly to SFCInit. Although the init step is processed further following initialization. This behaviour may be used to set the SFCReset flag in the init step immediately back to FALSE.
Note!
SFCInit and SFCReset cannot be used simultaneously in one organization unit. SFCInit will always have priority.
4-15
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages
Example of a declaration
PROGRAM flags VAR
SFCEnableLinit:BOOL;
SFCError:BOOL;
SFCErrorStep:STRING;
SFCReset AT %IX1.0.2: BOOL;
SFCInit AT %IX1.0.3:BOOL; END_VAR
SFCQuitError
Processing of the SFC diagram will be suspended for as long asthis Boolean variable remains TRUE. Timeouts invariables SFCError will be reset. All previous times in the active steps will be reset when the variable is reset to FALSE.
SFCPause
Processing of the SFC diagram will be suspended for as long asthis Boolean variable remains TRUE.
SFCError
This Boolean variable becomes TRUE if a timeout occurred inan SFC diagram. If variable SFCError is not reset again, and the first timeout is then followed by a second one in the program, the second one will not be registered.
SFCTrans
This Boolean variable becomes TRUE when a transition switches.
SFCErrorStep
This variable is a STRING-type variable that, if SFCError registers a timeout, stores the name of the step that causes the timeout.
SFCErrorPOU
This STRING-type variable, after a timeout, contains the name of the organization unit in which the timeout occurred.
SFCCurrentStep
This variable is a STRING-type variable that saves the name of the active step independently of the watchdog function. In parallel branching, the step is saved in the branch at the extreme right.
SFCTip, SFCTipMode
These BOOL-type variables permit the SFC tip mode. If that is activated via SFCTipMode = TRUE, the next step can be reached only if SFCTip is set to TRUE.Aslongas SFCTipMode is set to TRUE, the transitions may also be used for switching.
SFCErrorAnalyzation
This variable is a STRING-type variable. If the SFC flag SFCError registers a timeout, SFCErrorAnalyzation outputs the responsible variables or transition expressions.
This function requires the library Analyzation.lib to be integrated into the DDS project.
Note!
On some target systems, the length of the output of variables or transition expressions can be limited.
In some cases the string routines can only process 20 characters.
4-16
DDS EN 2.3
l

4.4.10 Alternative branch

Show/Hide Bookmarks
Two or more branches in SFC may be defined as alternative branches.
Every alternative branch must start and end with a transition.
Alternative branches may include parallel branches and further alternative branches.
An alternative branch starts with a horizontal line (alternative start) and ends with a horizontal
line (alternative end) or a jump.
If the step before the alternative start line is active, the first transition of every alternative
branch will be evaluated from left to right. The first transition from the left, whose transition condition is TRUE, is opened and the subsequent steps are activated.

4.4.11 Parallel branch

Two or more branches in SFC may be defined as parallel branches.
Every parallel branch must start and end with a step.
Parallel branches may include alternative branches or further parallel branches.
A parallel branch starts with a double line (parallel start) and ends with a double line
(parallel end) or a jump and can be assigned a jump label.
If the step before the parallel start line is active, and the transition condition after this step is
TRUE, the first steps of all parallel branches will become active. These branches will then all be processed in parallel.
The step after the parallel end line will become active if all preceding steps are active and the
transition condition before this step is TRUE.
Drive PLC Developer Studio
Programming languages

4.4.12 Jump

A jump is a connection to the step whose name appears underneath the jump icon.
Jumps are necessary because upward or intersecting connections are not allowed.
l DDS EN 2.3
4-17
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.5 Function block diagram (FBD)

The function block diagram is a graphically oriented programming language.
It uses a list of networks, each of which contains a structure that represents a logical or arithmetic expression, a function block call, a jump, or a Return instruction each.
Example of a network in FBD:
4-18
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.6 The Continuous Function Chart editor (CFC)

The Continuous Function Chart editor (CFC) operates with freely placeable elements that allow feedbacks, for example.
Example of a network in the Continuous Function Chart editor.
l DDS EN 2.3
4-19
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages

4.7 Ladder diagram (LD)

The Ladder Diagram is a graphically oriented programming language which is similar to the principle of an electrical circuit.
LD is used for the design of logic circuits and also allows the creation of networks as in FBD. LD is therefore perfectly suited to control calls for other organization units.
LD consist of several networks.
A network is limited on the left and on the right by a vertical power cable. In-between is a
circuit diagram consisting of contacts, coils and connection lines that transmit the status ONor OFF(TRUE or FALSE) from left to right.
Example of a network in LD:

4.7.1 Contact

Every network in LD consists of a network of contacts on the left-hand side, which transmit the status ONor OFFfrom left to right (variable value TRUE or FALSE).
If a Boolean variable of a contact has the value TRUE, the status ONis transmitted via the connection line from left to right. Otherwise, the right-hand connection is set to OFF”.
Parallel or series connection
Contacts can be connected in parallel. In that case one of the parallel branches must transmit
the value ONto ensure that the entire parallel branch transfers the value ON” .
Contacts can be connected in series. In that case, all contacts must transmit the status ON
to ensure that the last contact transmits ON”.
Negation
A contact can also be negated. It is then identified with a slash in the contact symbol. The contact then transmits the input status if its status is OFF” (FALSE).

4.7.2 Coil

Any number of so-called coils (represented by brackets) are listed on the right-hand side of a network in LD.
A coil transmits the connection value from left to right and copies it into an associated
Boolean variable.
The input line can be set to ONor OFF(depending on the Boolean values TRUE or
FALSE).
Coils can only be connected in parallel.
Negation
Coils can also be negated (shown by a slash in the coil symbol). In that case, the coil copies the negated value to the associated Boolean variable.
4-20
DDS EN 2.3
l

4.7.3 Set/Reset coil

Show/Hide Bookmarks
A coil can also be defined as set or reset coil.
A variable of a set coil becomes TRUE if the network result is TRUE.
A variable of a reset coil becomes FALSE if the network result is FALSE.
If the conditions are not fulfilled, the variable does not change.
Asetcoil(” S” in the coil symbol) can assume ONstatus, but can then no longer be reset to OFF.
A Reset coil (”R” in the coil symbol) can assume ”OFFstatus, but can then no longer be reset to ON.

4.7.4 Function blocks in LD

In addition to contacts and coils, LD allows the input of function blocks and programs.
In the network, function blocks and programs must have an input and output with Boolean values and can be used at the same locations as contacts, i.e. on the left-hand side of the LD network.
Drive PLC Developer Studio
Programming languages

4.7.5 LD as FBD

Use global variables or direct calls if the result of a circuit in LD is to be used to control other organization units.
Global variable
The result of a circuit can be saved with the help of the coils in a global variable that is then further used otherwise.
Direct call
The call can be directly installed into your LD network. For this purpose, insert an EN organization unit (ENstands for Enable).
EN organization units are normal operators, functions, programs or function blocks that have
an additional input labelled EN. This input is a BOOL-type input.
An EN organization unit will only be evaluated if its EN input is TRUE.
An EN organization unit is switched in parallel to the coils, with the EN input being linked to
the connection line between the contacts and the coils. If the status ONis transmitted via this line, the organization unit will be evaluated normally.
Based on such an EN organization unit, networks can be generated as in FBD.
l DDS EN 2.3
4-21
Drive PLC Developer Studio
Show/Hide Bookmarks
Programming languages
4-22
DDS EN 2.3
L

5 Desktop

Show/Hide Bookmarks

5.1 User interface

 
Drive PLC Developer Studio
Working area
The DDS user interface consists of the following elements:
Menu barTool bar (optional)
Object Organizer
Vertical screen divider between theDesktop with the editor windows.Message window (optional)Status bar (optional)

5.1.1 Menu bar

The menu bar is located at the top end of the main window and contains all DDS menu commands.
Object Organizer
and the DDS desktop.
l DDS EN 2.3
5-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area

5.1.2 Tool bar

The tool bar provides for quick access to frequently used menu commands.
Click on an icon to execute the underlying command.
Tip!
Positioning the mouse pointer briefly over a tool bar icon will display a tooltip with the icon name.
Use the FIND function inthe Online Help to display more detailed information on the associated icon and its functionality.
The selection of available functions is dependent on the active window.
Tool bar display is optional.
ProjectWOptions category
5.1.2.1 Zoom
Desktop
This zoom function in the tool bar allows zooming within all graphic editors and the visualization. Zoom is effective in the active window only.
The organization units of editors and visualization can be edited more efficiently.

5.1.3 Object Organizer

The
Object Organizer
to the four object types:
Organization units
Data types
Visualizations
Resources
Click the associated tab in the or right arrow key.
is located at the left-hand side of the DDS main window and allows fast access
Object Organizer
to change between the object types, or use the left
5-2
DDS EN 2.3
l

5.1.4 Vertical screen divider

Show/Hide Bookmarks
The screen divider is the boundary between two non-overlapping windows.
The DDS offers screen dividers between
the
Object Organizer
and the desktop of the main window
the interface (declaration part) and the implementation (instruction part) of organization units
the desktop and the message window.
Position the mouse pointer over the screen divider to move it. For this purpose, keep the left mouse key depressed and move the mouse.
Tip!
Note that the screen divider will always remain at its absolute position even if the window size is changed. Enlarge the window if the screen divider seems to have disappeared.
Drive PLC Developer Studio
Working area

5.1.5 Desktop

The desktop is on the right-hand side of the DDS main window. All object editors and the Library Manager are opened in this pane. The window title bar displays the associated object name. Organization units are identified with an abbreviated organization unit type and the applied programming language.
Tip!
Menu command Window in the main menu lists all window management commands.

5.1.6 Message window

The message window appears below the desktop in the main window, separated by a horizontal screen divider.
It contains all messages from the last compile, check or compare. Search results and cross references can also be output here.
Double-click a message in the message window or press <Enter> to open the editor with the
associated object. The relevant line of the object will be highlighted. Use the commands Edit ➞➞➞Next fault and Edit➞➞➞Previous fault to jump from one error message to the next.
The message window can be shown or hidden by pressing <Shift>+<ESC>.
l DDS EN 2.3
5-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area

5.1.7 Status bar

The status bar at the bottom of the DDS main window displays information about the current project and menu commands.
If a status applies, the associated expression appears in black at the right-hand end of the
status bar, otherwise it is greyed out.
Status bar display is optional.
ProjectWOptions category
Online mode
In online mode, the word Online is displayed in black; in offline mode, it is greyed out.
The status bar shows the following statuses in online mode.
SIM : DDS is in simulation mode
RUNNING: the program is being processed
BP: a breakpoint is set
Other status bar displays
Desktop
Text editors display the line and column number of the current cursor position. The letters
OVR appear in the status bar in overtype mode.
If the mouse pointer is in a visualization, the current X and Y position of the cursor will be
given in pixels relative to the top left-hand corner of the image.
If the mouse pointer is positioned over an element, or if an element is being edited, the
number of the element will be displayed.
If an element has been selected for insertion, this element will also be displayed (e.g.
rectangle).
If a menu command has been selected but not confirmed, a short description will be given in
the status bar.
The status bar displays the word READ if a project is opened with read access only.

5.1.8 Shortcut menu

Keyboard: <Umschalt>+<F10>
Use the right mouse key to display a shortcut menu.
The shortcut menu contains the commands most frequently used for a selected object or the
active editor.
The selection of available commands is dependent on the active window.
5-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks

5.2 Arrange windows

The menu Window lists all window management commands. These are commands for automatic window arrangement, opening the Library Manager and the log
and to change between active windows. The menu Window also lists all open windows at the bottom in the sequence they were activated.
Click an entry to change to the associated window. The active window is identified with a tick
(ü) in front of the menu entry.
5.2.1 Commands in the “Window” menu
5.2.1.1 Tile horizontally
Icon: - Menu: WindowWTile horizontally Keyboard: -
Use this command to tile all windows on the desktop horizontally so that they will not overlap but fill the whole desktop.
5.2.1.2 Tile vertically
Icon: - Menu: WindowWTile vertically Keyboard: -
Working area
Use this command to tile all windows on the desktop vertically so that they will not overlap but fill the whole desktop.
5.2.1.3 Cascade
Icon: - Menu: WindowWCascade Keyboard: -
Use this command to cascade all windows on the desktop.
5.2.1.4 Arrange icons
Icon: - Menu: WindowWArrange icons Keyboard: -
Use this command to arrange all windows minimized on the desktop in a row at the bottom of the desktop.
5.2.1.5 Close all
Icon: - Menu: WindowWClose all Keyboard: -
Use this command to close all windows open on the desktop.
5.2.1.6 Messages
Icon: - Menu: WindowWMessages Keyboard: <Umschalt>+<Esc>
Use this command to open or close the message window displaying the messages from the last compile, check or compare.
If the message window is open, a tick (ü) appears in front of the command in the menu.
5.2.1.7 Library Manager
5.2.1.8 log
l DDS EN 2.3
Icon: - Menu: WindowWLibrary Manager Keyboard: -
Use this command to open the dialog box
Icon: - Menu: WindowWlog Keyboard: -
Use this command to open the log window. The menu command log is available for the open log window.
(^ 6-42)
Library Manager
(^ 8-41)
5-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area

5.3 Basic settings

5.3.1 DDS options

Use the menu command Project➞➞➞Options in the main menu to configure the display of your main window. There are other setting options for DDS customization.
Unless otherwise defined, the settings made here will be stored in the DDS ini file and restored on next start.
5.3.1.1 Options
Icon: - Menu: ProjectWOptions... Keyboard: -
Use this command to open the dialog box
The options are divided into several categories. Select the required category from the left-hand side of the field on the right-hand side.
OptionsWLoad & sav e
If an option is active, a tick appears in front of the option.
Category
Options
with a mouse click, or use the arrow keys to do so, and set the required options
.
(ü)
Creating a backup
If check box Create backup is activated, the DDS saves the old file to a backup file with the extension .bakon each save to allow for the version before the last save to be restored.
Autosave
If check box Aut osave is activated, your project, while being edited, will be constantly saved to a temporary filewith an.asdextension in accordance with the specified time interval (save interval). This file will be deleted when the program completes normally.
Should the DDS terminate abnormallyfor some reason (mains failure, for example), the file will not be deleted and the system will display a message on project re-launch to advise that a backup file has been created. It is now up to the user to decide which file to open (original or backup file).
Autosave interval (min)
Enter a time interval in minutes for temporary backup.
5-6
DDS EN 2.3
l
Ask for project information
Show/Hide Bookmarks
If check box Ask for project information is activated, the project information will be called automatically when a new project is saved or an existing project is stored under a new name.
Project information can be viewed and edited using the menu command
Project➞➞➞Project information.
Autoload
If the option Autoload is activated, the project opened last will be loaded automatically next time the DDS is started.
A project can also be loaded on DDS start by specifying the project name in the command line.
Save before compile
The project is saved prior to each compile.
OptionsWUser information
Drive PLC Developer Studio
Working area
Options WEditor
Every entry can be changed and will be saved together with the project.
If an option is active, a tick appears in front of the option.
(ü)
l DDS EN 2.3
5-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area
Auto declaration
If the option Auto declaration is activated, a dialog box will appear in all editors when entering a variable that has not been declared yet. This dialog box is called
Autoformat
If the option Autoformat is activated, the DDS carries out automatic formatting in the instruction list editor and the declaration editor.
After a line has been exited, the following will be formatted:
Lowercase operators will be displayed in uppercase.
Tabs will be inserted for uniform column arrangement.
Declarations as tables
If the option Declarations as tables is activated, variables can be edited as table instead of using the declaration editor.
Variable declaration
.
This table is arranged as a card index box with tab cards for input, output, local and
input/output variables.
Fields for name, address, type, initial value and comment are available for each variable.
Ta b w i dt h
Use the field Tab width to specify the tabulator width for the editors.
The default setting is four characters, with the character width being dependent on the
selected font.
Font
Click Font to open the dialog box
Font
and select the font for the editors.
The font size is a basic unit for all drawing operations. A larger font size therefore does not
only result in a larger image but also a larger printout for each DDS editor.
Mark
Use the group box Mark to choose from three different marking formats for the graphic editors.
Dotted line: The mark is a dotted rectangle.
Line:The mark is a rectangle consisting of a continuous line.
Filled: The mark is a filled rectangle (inverse).
A dot identifies the active selection.
5-8
DDS EN 2.3
l
Options WDesktop
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
Bit values
Use the group box Bit values to choose between three different representation formats for binary data (types BYTE, WORD, DWORD) for monitoring:
Decimal
Hexadecimal
Binary
A dot identifies the active selection.
Monitoring of complex types
Show POU symbols
If chec box Show POU symbols is selected, Lenze organization unit signal propagation charts are shown as bitmaps.
If an option is active, a tick appears in front of the option.
Tool bar
If the option Tool bar isactivated, thetoolbar willbe displayed below themenu barfor fasteraccess to menu commands.
Status bar
If the option Status bar is activated, the status bar will be displayed at the bottom edgeof theDDS main window.
Online in security mode
If the option Online in security mode is activated, online mode displays a dialog box for the commands Start, Stop, Reset, Breakpoint on, Single cycle and Write values offering an additional security prompt as to whether the command is indeed to be executed. This option is saved together with the project.
Language
DDS dialog and menu languages are German and English.
(ü)
Note!
Languages can be selected under Windows NT and Windows 2000 only.
l DDS EN 2.3
5-9
Options WColours
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
Printer borders
In every editor window, the printer borders are outlined by red dashed lines. The printer borders are dependent on printer properties and the size of the content area of the set template
File➞➞➞Documentation setup.
F4 ignores warnings
Pressing F4 after the compile will return the focus only to those lines with error messages in the message window, ignoring the warning outputs.
DDS colour settings can be changed for the following elements:
Line numbers (light grey*)
Breakpoint position (dark grey*)
Set breakpoint (light blue*)
Current position (red *)
Reached position (green*)
Monitoring of BOOL (blue*)
Click one of the buttons to open the dialog box element.
*DDS default
Colours
and select the required colour for the
5-10
DDS EN 2.3
l
OptionsWDirectories
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
Project
The DDS is looking for libraries and configuration files in directories entered in a project. It is also possible to enter directories that are to be used to store compile files.
Click (...) behind an input field to open a dialog box for the selection of directories within your directory structure (Browse).For library and configuration files, the system allows the input of several paths each, separated by a semicolon “;” . The information is saved together with the project.
Common
This is where those directories can be entered that the DDS will search for libraries and configuration files. It is also possible to enter directories that are to be used to store compile files.
Click (...) behind an input field to open a dialog box for the selection of directories within your directory structure (Browse).Forlibrary and configuration files, the system allows the input of several paths each, separated by a semicolon “;”. The information will be written to the program system ini file and apply for all projects.
Automation system
This is where the directories for libraries and configuration files are shown that are set in the automation system, through specification in the target file, for example. These windows cannot be edited. An entry can be selected and copied.
DDS searches follow a sequence of project, automation system and common. Where identically named files exist, that in the previously searched directory will be applied.
l DDS EN 2.3
5-11
OptionsWlog
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
This dialog box allows configuration of a file that chronologically logs all user actions and internal processes in online mode as project log.
The system will open a suitable dialog box if an existing project is opened for which no log has as yet been created. This dialog advises that a log is being created. First input will be made during the next log-in process.
The log is automatically stored as a binary file when the project is saved. Option Directory for project logs offers the option of saving the log in a different directory.
The log is automatically given the name of the project and an extension .log. Use Maximum project log size to define the maximum number of online sessions to be logged. If this number is exceeded during logging, the latest input will delete the earliest one.
The log function can be switched on and off in the check box Activate logging.
Use the group field Filter to select the actions to be logged.
User action
Internal action
Status change
Exception
Only the actions of the selected categories will be displayed in the log window or written to the log.
(^ 6-42)
5-12
DDS EN 2.3
l
OptionsWBuild
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
Debugging
If the option Debugging is activated, the code may become noticeably longer since additional debugging code is generated. This is necessary to use the DDS debugging functions. The option is saved together with the project.
Only if check box Debugging is active can breakpoints be set and single stepping is
possible.
If the option Debugging is deactivated, the code will be shorter and execution faster.
Replace constants
This option loads the value directly for each constant. In online mode, constants are displayed in green. A constant can then no longer be forced, written or monitored. While the option is deactivated, the value is loaded via variable access to a memory location. Although this allows writing of the variable value, it also means a longer processing time.
Nested comments
This option allows the input of nested comments.
(* a:=inst.out;(*to be checked*) b:=b+1; *)
The comment beginning with the first parenthesis is the outer one and completed with the last parenthesis.
Create binary file of the application
Selection of this option means that a binary image of the generated code (boot project) will be created in the project directory during a compile. File name: projectname.bin.
Macro before compile
This option influences the compile process - the macro is run prior to the compile.
Macro after compile
This option influences the compile process - the macro is run after the compile.
l DDS EN 2.3
Macro commands
The appendix includes a list of all macros. Command line commands Command file commands (^ 15-2)
(^ 15-1)
5-13
OptionsWPasswords
Show/Hide Bookmarks
Drive PLC Developer Studio
Working area
The following macro commands cannot be executed.
file new, file open, file close, file save as, file quit, online, project compile, project check, project build, debug, watchlist
For a more detailed description as to how to create macros refer
OptionsWMacros
All settings defined in the dialog box Build options are saved together with the project.
The DDS offers password protection for your files against unauthorized access, opening or editing.
Defining a password for opening a file:
1. Enter the required password in text field Password. Every letter is represented by an asterisk (*).
2. Repeat the password entry in the text field Confirm password.
3. Click OK to close the dialog box.
If the message Password and its acknowledgement do not matchappears, one of the two inputs contains a typing error. Retype both entries to ensure that the dialog box closes without any error messages.
When the file is saved and re-opened, a dialog will be displayed for password entry. The project will only be opened if the password is correct, otherwise the message ”The password
is not correctwill appear.
Defining a password for editing a file:
Passwords can protect a file from being opened and/or edited:
1. Enter the required password in text field Write Protection Password. Every letter is represented by an asterisk (*).
2. Repeat the password entry in the text field Confirm write protection password.
3. Click OK to close the dialog box.
If the message Password and its acknowledgement do not matchappears, one of the two inputs contains a typing error. Retype both entries to ensure that the dialog box closes without any error messages.
Write protected projects can also be opened without the password.
To do so, click Cancel when the DDS prompts for the write protection password on opening
the file. It is now possible to compile the project, load it into the control, simulate it, etc., but it cannot be edited.
The status bar now includes the display READ.
5-14
DDS EN 2.3
l
Note!
Show/Hide Bookmarks
Make sure to remember the passwords. Contact Lenze if you do forget one of the passwords.
The passwords are saved together with the project.
Create user groups to assign more specific access rights.
OptionsWSymbol configuration
Drive PLC Developer Studio
Working area
Select the category
The dialog box assists symbol file configuration (text file*.sym or binary file*.sdb) These are required for data exchange with the control via the symbol interface and are used by Global Drive Oscilloscope for this purpose, for example.
Dump symbol entries
If the check box is activated, every project compile automatically creates symbol entries for the project variables in the file.
Configure symbol file
Use this button to open the dialog box
Symbol configuration
Setobjectattribute
to open the following dialog box.
.
l DDS EN 2.3
Select the required project organization units from the tree structure, and tick the required check box.
5-15
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area
Export variable of object
The variables of the selected object are output to the symbol file. The other options take effect only if this check box is ticked.
Export data entries
For structures and arrays of the object, entries are generated for access to the overall variables.
Export structure components
For object structures, a separate entry is generated for each variable component.
Export array entries
For object arrays, a separate entry is generated for each variable component.
Write access
The object variables may be modified via the OPC server.
Once the setting is effected for the current organization unit selection, another organization unit can be selected and given different options.
OptionsWMacros
OK
Using this button to close the dialog box means that all changes will be saved.
Select the category
Name
Enter the name for the macro in this text box.
Macros
to open the following dialog box.
New
Press the button New to rec ord the c reated macro.
Macro
This field lists all created macros. Highlighted macros can be deleted with the <Del> key.
Rename
Once an existing macro has been selected in the macro list, it can be renamed via dialog box Press the button Rename to rename the macro.
5-16
DDS EN 2.3
Name
l
.
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area
Commands
This dialog box defines or edits commands for the macro. A new command line is inserted by pressing <Ctrl>+<Enter>.The right mouse key displays the shortcut menu with standard editor functions. Components of a command that belong together can be concatenated with the help of quotes.
Macro commands - commands
The appendix includes a list of all macros. Command line commands Command file commands (^ 15-2)
Menu
This dialog box defines the menu entry to insert the macro under EditWMacros. Place an & in front of a letter to turn it into a shortcut. The name Ma&cro 1 generates menu entry
Macro 1.
OK
Exits the dialog box and saves the input in the project. A macro check will be performed only at the time the menu command is executed.
(^ 15-1)
OptionsWGDC Device Description
Use this dialog box to select whether aproject-specific device description file (PDB) is to be created for Global Drive Control (GDC) and, if so, for which languages.
Tip!
A PDB will be created only if a directory has been specified under Path and the check box Build GDC Device Description has been activated. The PDB is built/updated on project compile
if PDB-relevant data have changed.
l DDS EN 2.3
The file name of the PDB consists of the project name followed by an index (” _S” , ”_1”, ”_2” )forthe associated language and the extension .pdb”.
Example:
Name of the project: Example
Language selection:
Standard language
and
Language Two
Þ PDB file names: ”Example_S.pdband Example_2.pdb
5-17
Drive PLC Developer Studio
Show/Hide Bookmarks
Working area
Directory
Use the input field Path to determine the directory path for the device description files (PDBs) to be created by the DDS for Global Drive Control.
Click ... behind the input field to open a dialog box for the selection of directories within your
directory structure (Browse).
Language selection
Select the languages for which to create a PDB.
Up to three country-specific PDBs can be created per project.
The associated GDC display texts for the relevant code are defined in the Instance Parameter
Manager in the dialog box Manager).
The selected language is identified with a tick. (ü)
Basic language
The pdb file will be generated in the selected language.
More details and information
(call via Extended in the Parameter
Build GDC Device Description
If check box Build GDC Device Description is activated, a PDB for GDC will be built/updated for every language selected under Language selection in the directory specified under every project compile.
Path
during
This project-specific PDB contains the basic codes for the associated PLC (based on its
basic PDB) and the project-specific codes defined in the Parameter Manager.
It is generated only if PDB-relevant data have changed.
The device description is also saved into the project directory for easier handling of the
Global Drive Loader software.
If the Lenze OPC server is installed, the device description will also be copied into its PDB
directory.
5-18
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects

6 Working with projects and objects

6.1 Managing projects

Those DDS commands that refer to the entire project are available in the main menu under File and Project.
The menu Project also contains commands that refer to objects. A detailed description of these commands is included in the chapter Working with objects”.
Note!
Write protection on *.bin file
For each changed or translate project, the corresponding *.bin will be overwritten. This file is saved in the same directory as the project. If this file is write-protected, the project cannot be translated. Youhavetoremovethewriteprotection.
(^ 6-24)
6.1.1 Commands in the “File” menu
6.1.1.1 New
Icon: Menu: FileWNew Keyboard: -
UsethiscommandtoacreateablankprojectcalledUntitled. Change the name when saving the project.
6.1.1.2 New, with template
Icon: - Menu: FileWNew, with template Keyboard: -
Use this command to create a blank project named Untitledincluding an optional template.
The template has the extension *.lpc and contains a fixed Lenze configuration.
The Lenze configuration includes:
Program POU
Organization units with technology function.
Required libraries
Global variables
Entries in the PLC configuration
Entries in the task configuration
Predefined user codes
Visualization and Receipt Manager (as required)
Open
Open the dialog box
If the template is protected by Passwords or defined with User groups, the system will prompt for a password.
and select a template file with the extension *.lpc” .
l
DDS EN 2.3
6-1
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
6.1.1.3 Open
Icon: Menu: FileWOpen Keyboard: <Ctrl>+<O>
Use this command to open an existing project.
If a project has been opened and changed before, the user will be prompted as to whether this
project is to be saved or not.
Open the dialog box extension *.lib. This file must exist already. The command Open does not allow the creation of a new project.
The menu File lists the last-opened projects at the very bottom. Selecting one of those
projects will open it.
If passwords or user groups have been defined for the project, the system will prompt for a
password.
6.1.1.4 Close
Icon: - Menu: FileWClose Keyboard: -
Use this command to close the currently open project.
If the project was changed, the user will be prompted as to whether these changes are to be
saved or not.
If the name of the project to be saved is Untitled, enter a new name.
Open
and select a project file with the extension *.proor a library file with the
6.1.1.5 Save
Icon: Menu: FileWSave Keyboard: <Ctrl>+<S>
Use this command to save the project if it was changed.
If the name of the project to be saved is Untitled, enter a new name.
6.1.1.6 Save as
Icon: - Menu: FileWSave as Keyboard: -
Use this command to save the current project under a new name or as library. The original project file remains unchanged.
Selection of the command opens the dialog box
Select either an existing file name to overwrite an existing project or enter a new file name.
Select the required file type.
Saving the project under a new name
If the project is to be saved under a new name only, select file type DDS Project (*.pro)” .
Then click OK.
The current project will be saved to the selected file. If the new file name already exists, the
user will be prompted as to whether this file is to be overwritten or not.
Save as
.
6-2
DDS EN 2.3
l
Saving project as library
Show/Hide Bookmarks
If the project is to be saved as library for use in other projects, select the file type
”Internal library (*.lib)” if you programmed your POUs in the DDS.
Then click OK.
The current project will be saved to the selected file. If the new file name already exists, the
user will be prompted as to whether this file is to be overwritten or not.
If the project is saved as library, the entire project will be compiled. Should an error occur, the
user will be informed that a correct project is required to generate a library. In such case, the project will not be saved as library.
6.1.1.7 Save/mail archive
Icon: - Menu: FileWSave/mail archive Keyboard: -
DDS has an archive function using which all files of a project (libraries, bitmaps, etc.) can be saved in an archive file.
Drive PLC Developer Studio
Working with projects and objects
Note!
To archive a project without the necessity of a compile and download during a later log-in, carry out adownloadbeforearchivingtheprojectandactivatethecheckbox box Save Archive.
Use this command to generate a ZIP archive file containing all significant DDS project files. The ZIP file can be saved in the file system or e-mailed.
After the ZIP file has been decompressed, you can log in a controller without prior download.
Compile Information
in the dialog
Note!
Proceed as follows to use the ZIP archive in this way:
1. The corresponding files (libraries, bitmaps, etc.) of a project must be created relative to the project.
2. Open the following dialog using the menu command ProjectWOptions category and enter just ”.\ ” in the field Libraries. The input fields Compile files and Configuration files remain empty.
Directories
l
Note!
Paths which have been assigned a disk drive (SUBST[Disk drive1: Disk drive2:]Path) are not supported.
Do not use the SUBST Windows function.
DDS EN 2.3
6-3
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
3. Compile the project.
Note!
After compiling the project must be saved once. While the project is saved, DDS creates files which are part of the ZIP archive.
4. Open the following dialog with the menu command FileWSave/ ma il archive.Onlytick(project file, referenced libraries, compile information and bitmap files). This menu item can only be ticked if a bitmap is contained in the project. If no bitmaps are contained, you can ignore this item.
5. If you have ticked the items save the archive.
Include the following information into the archive
Apart from the procedure described, the ZIP archive can also be used in general.
A category must be selected with (ü).
Category Relevant files
Project file <project name>.pro (the DDS project file) Referenced libraries *.lib, *.obj, *.hex (libraries and, if necessary, the associated obj and hex files) Compile information *.ci (information specific to the last compile)
INI file DDS.ini Log file *.log (project log file) Bitmap files *.bmp (bitmaps used in project organization units and visualizations) Registry entries Registry.reg (entries for Automation Alliance, gateway and PLC) Icon files *.sdb, *.sym (icon information generated from the project) Configuration files PLC configuration files
Target files *.trg (binary-format target files for all installed targets)
Local gateway Gateway files: Gateway.exe, GatewayDDE.exe, GClient.dll, GDrvBase.dll, GDrvStd.dll, Ghandle.dll, GSymbol.dll,
*.ri (information specific to the last download) <temp>.* (temporary compilation and download files) also for simulation
(configuration files, device master files, icons, etc.) e.g. *.cfg *.con *.eds *.dib *.ico...
*.txt (binary-format target fil es for all i nstalled targets, if available)
GUtil.dll and other DLLs in the gateway directory
6-4
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Details
UsethebuttonDetails to request a dialog box for the direct selection of information on the respective category.
The dialog box
Details
is explained on the basis of
Details: Local gateway
.
The dialog box shows the local gateway details that can be selected directly with (ü). Usethe button
Select all to select everything. Select none removes the ticks. Confirm with OK.
Other files
Use the button Other files to open a dialog box to transfer user-defined files into the archive.
Comment
The button opens a text editor to generate a README.TXT file that contains the specified text which is automatically extended by the generation date and the version number of the currently used DDS version.
Generating the Z IP archive
The ZIP archive can be generated once all settings have been made and checked.
Save
A ZIP file is generated and saved and can be stored at the desired location with the help of the Windows dialog. The file default name is projectname.zip. Pressing the button Save starts archive generation where the process is logged in the message window along with a progress bar display.
Mail
A blank e-mail is generated with the project attached as a ZIP file. This function requires correct MAPI (Messaging Application Programming Interface) installation.
Cancel
l
The process is cancelled. No settings are saved.
DDS EN 2.3
6-5
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
6.1.1.8 Print
Icon: - Menu: FileWPrint Keyboard: <Ctrl>+<P>
Use this command to print the contents of the active window.
Selection of the command opens the dialog box
Select the required option and click OK. The active window will be printed. Every editor can be
colour-printed.
Use the button Properties to open the dialog box
The layout of your printout can be defined under File
During the printout, the number of pages already printed will be displayed in a dialog box. The
printout will be stopped after the next page if this dialog box is closed.
To document your entire project, use the command Project
To generate a document template for your project to specify the comments for all variables
used within the project, open a global variable list and use the command Extras➞➞➞Create document template.
(^ 8-3)
Print
.
Printer setup
.
Documentation setup.
➞➞
Document project.
➞➞
6.1.1.9 Documentation setup
Icon: - Menu: FileWDocumentation setup Keyboard: -
Use this command to specify the layout of the pages to be printed.
File
Use text field File to enter the name of the file with the extension .dfrto save the page layout to.
By default, the template is saved in the file DEFAULT.DFR”.
To change an existing layout, click Browse to find the required file in your directory structure.
Edit
Select Edit to display the page layout template. Arrange the placeholders for page numbers, date, names for files and organization units as well as on-page graphics and define the text zone to print the documentation in.
Tip!
Usethe buttonPrinter setup to open thedialog box
6-6
DDS EN 2.3
Printer setup
to effect documentation settings.
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Use the command Insert➞➞➞Placeholder to select oneof the five placeholders to be inserted into the layout by simply drawing a rectangle and move it to the desired position, if necessary.
Placeholders will be substituted as follows in the printout:
Command Placeholder Effect
Page {Page} The current number of pages is printed. POU name {POUName} The name of the current organization unit. File name {FileName} The name of the project. Date {Date} Current date. Content {Content} The contents of the organization unit.
Use Insert➞➞➞Bitmap to insert abitmap (e.g.a company logo)into thepage. Select a bitmap and draw a rectangle in the layout with the mouse. Further visualization elements may be inserted as well.
New page for each object/New page for each subobject
Select whether a new page is to be started for each object and subobject.
Printer setup
Use the button Printer setup to open the dialog box etc.
OK/Cancel
Click OK to accept the changes or Cancel if you do not want to save them.
If the template has been changed, the user will be prompted on closing the window as to whether the changes are to be saved or not.
Printer setup
to specify printer, paper format,
l
DDS EN 2.3
6-7
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
6.1.1.10 Exit
Icon: - Menu: FileWExit Keyboard: <Alt>+<F4>
Use this command to exit the DDS.
If a project has been opened and changed, the user will be prompted as to whether this
project is to be saved or not.
6.1.2 Commands in the “Project” menu
6.1.2.1 Compile
Icon: - Menu: ProjectWCompile Keyboard: <F11>
Use this command to compile the project to check your programs syntactic correctness. The compile is incremental, only those organization units that have been modified will be recompiled. A non-incremental compile requires prior execution of the command Project➞➞➞Clean all.
Automation systems that support onlinechange identify all organization units with ablue arrow in the Object Manager after the compile. These will be loaded to the control during the next download.
The compile performed with Project➞➞➞Compile will be executed automatically on
Online➞➞➞Log in
Errors and warnings are identified with numbers.
Use the command Project➞➞➞Options, category save the project prior to the compile.
Tip!
Cross references are created during the compile and will not be saved among the compile information!
To apply the commands Output call up tree, Output cross reference list and the commands
Output unused variables, Concurrent accessand Multiple write access on output of the menu Project ➞➞➞Check, the project must be recompiled after a change.
6.1.2.2 Compile all
ProjectWCompile all,contrarytoProjectWCompile, recompiles the complete project, not deleting
the download information in the process.
The menu command ProjectWClean all deletes the download information.
Load & Save
,checkboxSave before compile to
6-8
DDS EN 2.3
l
6.1.2.3 Clean all
Show/Hide Bookmarks
Note!
A log-in without another project download is possible only if the file *.ri containing the project information of the last download was explicitly stored outside the project directory before and can be reloaded prior to log-in.
Execute the menu command ProjectWLoad download information.
Icon: - Menu: ProjectWClean all Keyboard: -
This command clears the information of the last download and the last compile. Once the command has been executed, the system displays a dialog to advise that no log-in is possible without another download. You can continue or cancel the process at this point.
6.1.2.4 Load download information
Icon: - Menu: ProjectWLoad download information... Keyboard: -
Use this command to directly reload the associated download information as long as the information was not stored in the project directory. The standard dialog File➞➞➞Open allows the direct loading of stored information.
On each download, the download information is automatically put into a file
project name Targetidentifier.ri. Example: LD_FillingPlants00000000r.ri and included in the project directory.
It will be reloaded automatically every time the project is opened and allows the control to
perform an ID check to establish whether the project on the control matches the open project.
A check is made to find those organization units whose generated code has changed. Only
these organization units are reloaded during downloads for systems supporting online change.
If the *.ri file was deleted from the project directory via the menu command Project➞➞➞Clean all,the download information can be explicitly loaded from another directory with Project➞➞➞Load
download information....
Drive PLC Developer Studio
Working with projects and objects
6.1.2.5 Translate into other languages
Icon: - Menu: ProjectWTranslate into other languages Keyboard: -
This menu item translates the current project file into a different national language by reading a translation file generated from the project. The translation file will then be updated with translated texts in the desired national language with the help of a text editor.
For this purpose, the menu offers two subitems.
Project
Project
l
Translate into other languages➞➞➞➞Create translation file
➞➞
Translate into other languages➞➞➞➞Translate project into another language
➞➞
DDS EN 2.3
6-9
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Creating a translation file
Enter a path in the field Translation file to store the file at the desired location. The standard
file extension is *.tlt (text file).
To edit an existing translation file, select and open it with the Windows dialog Search.
Optionally, the following information can be included with the generated or modified
translation file:
Name, titles in the Object OrganizerIdentifiersStrings, comments, visualizationPosition information
If the relevant options are ticked (ü), the information will be included as linguistic symbols from the current project into a translation file that either already exists or needs to be created, or updated in an existing one. If the relevant option is not selected, all information of the individual category, no matter from which project, will be removed from the translation file.
The visualization texts in this case are the elements Te xt and Tool tip text of the visualization elements.
Tip!
Note for the visualization texts Te xt and Tool tip text of the visualization elements that they must be framed by two # characters in the configuration dialog of the visualization element #text# to be included in the translation file. (^ 9-1)
Position information
This uses the data of file path, organization unit and line to describe the position of the linguistic symbol provided for translation.
Three options are available:
None No position formatting is generated.
First occurrence The position at which the element to be translated first occurs, will be
included in the translation file.
All All positions at which the relevant element occurs in the project are specified.
Where an older translation file is edited that already contains more position information than selected here, this information will be reduced accordingly or deleted in full, independent of the project in which it was generated.
6-10
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Tip!
A maximum of 64 position information items will be generated for each element (linguistic symbol), even if the dialog box
Overwrite existing
All existing position information in the translation file being edited is overwritten, independent of the project in which it was generated.
This list contains identifiers for all languages in the translation file and that are to be included on exiting the dialog
Exclude
The button Exclude opens the dialog box
Create translation file
Create translation file
, combination box Position information, specifies All.
.
Exclude libraries
.
Here those project libraries can be selected whose user information is not to be accepted into the translation file. Use the buttons Add and Remove to determine which libraries to exclude and which to include. Confirm with OK. The dialog box closes.
Target languages
The button Add in the group box Target languages opens the dialog box This is where you can add other languages. Enter English(USA), for example, and confirm with OK.
The entered language must not have any white spaces or umlauts at the beginning and the end. The button OK will be greyed out if the input is not acceptable or incomplete.
The button Remove in the group box Target languages deletes a language from the list, removing only the selected language.
Creating a translation file
Press OK in the dialog box check whether there already exists another translation file with the same name.
Select No to return to the dialog box Select Ye s to generate a copy of the existing translation file with the file name Backup_of_translation file.tlt.
A translation file is generated as follows:
Create translation file
Create translation file
to generate a translation file. The system will first
.
Add target languages
.
A placeholder ##TODO is generated for each new target language for each linguistic symbol
to be output.
If an already existing translation file is being processed, any data entries of languages listed in
the translation file, but not in the target language list, will be removed, independent of the project in which they were generated.
l
Editing a translation file
Open and save the translation file as a text file. Characters ## identify keywords. The ##TODO placeholders in the file may be substituted with the applicable translated texts. A section delimited by ##NAME_ITEM and ##END_NAME_ITEM is created for each linguistic symbol (comments: ##COMMENT_ITEM etc.).
DDS EN 2.3
6-11
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Find below a sample section in the translation file for the name of the organization unit ST_Visu. Target languages are English(USA) and French. The position information for the project element to be translated was also included in this example.
Prior to the translation
##NAME_ITEM [D:\DDS\projects\Bspdt_22.pro::ST_Visualisierung::0] ST_Visualisierung ##English :: ##TODO ##French :: ##TODO ##END_NAME_ITEM
After the translation
##TODO was substituted with the English and French expressions.
##NAME_ITEM [D:\DDS\projects\Bspdt_22.pro::ST_Visualisierung::0] ST_Visualisierung ##English :: ST_Visualization ##French :: ST_Visu ##END_NAME_ITEM
Make sure that translated identifiers and names remain valid under the standard and that strings and comments are placed within the relevant brackets.
Note!
The following blocks of the translation file should not be modified without detailed knowledge.
Language block, flag block, position information, original texts
6.1.2.6 Translate this project
Icon: - Menu: ProjectWTranslate this project Keyboard: -
This menu command offers subitems
Create translation file
Translate project into another language
Tip!
The translate cannot be undone. Save a project copy under a different name before translating.
Creating a translation file
Translating a project into another language
The current project can be translated into a different language, using a valid translation file.
6-12
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Translation file
Specify the translation file path in this text field.
Search
This button takes you to the Windows file selection dialog.
Target language
This combination box offers the language identifiers to select the target language.
OK
Thebutton starts thetranslateof the current project with the help of thespecified translation fileinto the selected target language. Progress and any error messages will be displayed during the translate. After the translate, the dialog box and all other open dialog windows will be closed.
Cancel
The button closes the dialog box without saving changes.
Should there be incorrect entries in the translation file, pressing OKwill output an error message with file path and incorrect line. [C:\Program files\DDS\projects\visu.tlt(78)]; expect translated text.
6.1.2.7 Document project
Icon: - Menu: ProjectWDocument project... Keyboard: -
Use this command to print the documentation for an entire project.
Complete documentation comprises:
Contents of the documentation
Organization units
Data types
Call trees of organization units and data types
Visualizations
Resources (global variables, variable configuration, PLC configuration, task configuration,
Watch and Receipt Manager)
Cross reference list
Table listing the codes assigned via the Parameter Manager
Documentation of Call up treesand Cross reference list” requires an error-free project compile.
l
DDS EN 2.3
6-13
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Command selection opens a dialog box to select the objects to be printed:
Make your selection and click OK.
The dialog box
The layout of the pages to be printed can be defined under File
6.1.2.8 Export
Icon: - Menu: ProjectWExport... Keyboard: -
The DDS offers the option of exporting and importing projects so that programs can be exchanged between different IEC programming systems.
There is so far one standardized exchange format for organization units in IL, ST and SFC (IEC
61131-3 Common Elements Format).
The DDS offers a separate save format for organization units in LD and FBD and the other
objects as IEC 61131-3 does not provide any appropriate textual format. The selected objects are written to an ASCII file.
Organization units, data types, visualizations and resources can be exported.
In addition to that the entries in the Library Manager, i. e., the library linking information, can
also be exported. The libraries themselves are not exported.
Command selection opens a dialog box to select the objects to be exported.
Make your selection and click OK.
The dialog box
Print
is opened.
Save
is opened. Enter a file name with the extension .exp” .
Documentation setup.
➞➞
6-14
DDS EN 2.3
l
6.1.2.9 Import
Show/Hide Bookmarks
Icon: - Menu: ProjectWImport... Keyboard: -
Select the required export file from the dialog box.
The data are imported into the current project. If an identically-named object already exists in the project, the dialog box Do you want to replace?appears.
Confirm with Yes to replace the object in the project with the object from the import file.
Confirm with No to import the object from the import file with a name extension (underscore
and consecutive number _0” , ”_1, ...).
Confirm with Yes, all or No, none to apply the actions described before to all objects.
The message window logs the import.
Note!
The following resource elements will be exported incompletely or not at all.
Drive PLC Developer Studio
Working with projects and objects
Code initialization values
Instance Parameter Manager
Type Parameter Manager
Task configuration
6.1.2.10 Compare
Icon: - Menu: ProjectWCompare... Keyboard: -
Use this command to compare
two projectsan open project with the one last saved. Do not save to allow the changes to be displayed.
Tip!
If the compare mode is active (status bar: Compare), the project cannot be edited.
Conventions
Designation Meaning
Current project The project currently edited Project to compare The project c alled for the compare Compare mode If ProjectWCompare was selected, the project is in compare mode Unit The smallest compare unit
l
In compare mode, the current and the compare objects will be displayed in a split window. The editor organization units offer the possibility of a directly-aligned content compare. Filters can be activated prior to the compare.
DDS EN 2.3
6-15
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Comparing projects
Project to compare
By default, this text field contains the path of the project to compare.
Ignore white space
No differences in the white spaces will be displayed if the check box is active.
Ignore comments
No differences in the comments will be displayed if the check box is active.
Oppose differences
Units that were changed, but not deleted, will be displayed if the check box is active. The numerical value in line 4 was changed. 7000 is the change, 8000 the original value.
The values will not be directly aligned if the check box is not active.
Result display
The results are first displayed in a directory tree. A double-click will open the individual organization unit to show the highlighted changes.
6-16
DDS EN 2.3
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Colours
Any differences are marked by coloured text.
Red Unit was modified and is displayed in red in both window panes.
Blue Unit exists only in the project to compare. The current project contains a space.
Green Unit exists only in the current project. A space is inserted in the project to compare.
Black No differences in unit.
The following text can appear after the organization units of the current project:
(Properties modified)
This text appears after a name of an organization unit if the properties of the organizations unit differ.
(Access authorizations modified)
This text appears after an organization unit if the access authorizations differ.
6.1.2.11 Copy
Icon: - Menu: ProjectWCopy Keyboard: -
Use this command to copy objects (organization units, data types, visualizations and resources)and links to libraries from other projects into the current project.
Selection of the command opens the dialog box
1. Find the project from which you want to copy objects to the current project.
2. Click Open to open the project.
This will open a dialog box for object selection.
If there already exists an object with the same name within the project, the name of the new
object will be entered with an underscore and a number (”_1”, ”_2”, ...) as the last characters.
Copy project
.
l
DDS EN 2.3
6-17
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
6.1.2.12 Project information
Icon: - Menu: ProjectWProject information Keyboard: -
Use this command to save information about the project.
Statistics
Click the button Statistics for statistical information about your project.
Thestatistics contain project information, numberof POUs, datatypes, localand globalvariablesas saved on the last compile.
Select the dialog box
obtain project information automatically when a new project is stored or an already existing project is saved under a new name.
6.1.2.13 Global search
Icon: Menu: ProjectWGlobal search Keyboard: -
Option
, category
Load & Save
and there Ask for project information to
Use this command to find text in organization units, data types or objects of the global variables.
Command selection opens a dialog box to select the required objects.
Confirm the selection with OK to open the dialog box
If a text is found in an object, the object will be loaded into the associated editor and its
occurrence displayed.
Display of the found text, Find and Find next are analogous to the menu command Edit
6-18
DDS EN 2.3
Find
.
Find.
➞➞
l
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Find what
Enter the required character sequence. If a text is found in an object, the object will be loaded into the associated editor or Library Manager and its occurrence displayed.
Message window
Pressing this button lists all occurrences of the character sequence in question within the selected objects line-by-line in the message window and displays an occurrence total.
The following information is displayed.
Object name
Occurrence in the declaration part or implementation part of an organization unit
Line or network number
Complete line for text editors
Complete text unit for graphic editors
The message window can display the following information for a requested character sequence bottom.
Global search ST-EXAMPLE (PRG-ST)(declaration) #5 bottom: INT:= -250; ST-EXAMPLE (PRG-ST)(implementation) #14 bottom :=yVal + offset; ST-EXAMPLE (PRG-ST)(implementation) #19 IF (bottom >-250) THEN ST-EXAMPLE (PRG-ST)(implementation) #20 bottom := Bottom -offset; The character sequence bottomwas found 4 times.
A double-click on one of the lines opens the associated editor and highlights the line with the character sequence. Function keys <F4>and <Shift>+<F4> allow toggling between the output lines.
Note!
Not implemented for Parameter Manager and code initialization.
6.1.2.14 Global replace
Icon: - Menu: ProjectWGlobal replace Keyboard: -
Use this command to find text in organization units, data types or objects of global variables and replace it with another text.
The libraries are not available for selection, and no output is possible into the message window.
Command selection opens a dialog box to select the required objects.
Confirm the selection with OK to open the dialog box
Find next
The occurrence is displayed if the text in the combination box Find what is found in one of the
objects to be searched.
Replace
The current occurrence of the text in the combination box Find what found in the objects to
be searched is replaced with the text in the combination box Replace with.
The highlight will jump to the next occurrence after the replace.
Replace all
Global replace
.
l
All occurrences of the text in the combination box Find what found in the objects to be
searched are replaced with the text in the combination box Replace with.
DDS EN 2.3
6-19
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
Cancel
Closes the Find and replacefunction.
Note!
Not implemented for Parameter Manager and code initialization.
6.1.2.15 Project check
Icon: - Menu: ProjectWCheck Keyboard: -
This menu command offers four separate subitems:
Unused variables
Overlapping memory areas
Concurrent access
Multiple save on output
The results are output in the message window.
Each of these four functions checks the status of the last compile. In other words, a project must have been compiled correctly at least once. The menu items will not be active if that is not the case.
Unused variables
This function looks for declared variables that are not used in the program. They are output with organization unit name and organization unit line. Example: PLC_PRG (4) - var1 Variables in libraries will not be considered.
Overlapping memory areas
This function checks overlapping of specific memory areas during variable assignment with the help of the AT declaration.
Example: Assignment of variables
var1 AT %QB21: INT var2 AT %QD5: DWORD
causes an overlap as they occupy byte 21 at the same time. Output is then as follows:
% QB21 is referenced by the following variables:
PLC_PRG (3): var1 AT %QB21 PLC_PRG (7): var2 AT %QD5
Concurring access
This function looks for memory areas that are referenced in more than one task. No difference between read and write access. Output is then as follows:
% MB28 is referenced in the following tasks:
Task1 - PLC_PRG (6): %MB28 [read-only access] Task2 - POU1.ACTION (1) %MB28 [write access]
6-20
DDS EN 2.3
l
Multiple save on output
Show/Hide Bookmarks
This function looks for memory areas that are accessed at several locations within a project. Output is then as follows:
%QB24 is described at the following locations:
PLC_PRG (3): %QB24 PLC_PRG.POU1 (8): %QB24

6.1.3 User groups

TheDDS allows upto eight groups to be set up withdifferent access rightsto organizationunits,data types, visualizations and resources.
Access rights can be defined for individual or all objects.
All projects are opened by a member of a specific user group.
The member must authenticate himself with a password.
The user groups are numbered from 0 to 7, with group 0 having administrator rights, i. e., only group 0 members must define passwords and access rights for all groups or objects.
New projects are initially not password-protected.
As long as no password has been set up for user group 0, everybody who opens the project is
amemberofusergroup0.
If a password has been set up within a project for user group 0, all groups are prompted for a
password when opening the project.
1. Use the combination box User group to select the group you belong to.
2. Use the text field Password to enter the password.
3. Click OK to accept the input. If the password does not match the saved password, the message The password is not correct.
will be displayed.
Only correct password entry will open the project.
Drive PLC Developer Studio
Working with projects and objects
Caution!
A project may be opened via a user group that was not assigned a password.
Use the menu item ProjectWUser group passwords to assign passwords.
Use the menu item ProjectWObjectsWAccess rights to assign rights for individual or all
objects.
6.1.3.1 User group passwords
Icon: - Menu: ProjectWUser group passwords Keyboard: -
Use this command to open the dialog box
Note!
This command can only be executed by members of group 0 (administrators).
Dialog box
User group passwords
User group passwords
.
l
DDS EN 2.3
6-21
Drive PLC Developer Studio
Show/Hide Bookmarks
Working with projects and objects
1. Use the combination box User group to select the group to assign a password to.
2. Use the text field Password to enter the password. Every letter is represented by an asterisk (*).
3. Repeat the entry in text field Confirm password.
4. Click OK to accept the input.
If the message Password and its acknowledgement do not match.appears, one of the two inputs contains a typing error.
Retype both entries to ensure that the dialog box closes without any error messages.
If necessary, assign a password for the next group only then by requesting the command again.
Tip!
Use the command Object➞➞➞Access rights to assign rights for individual or all objects.
6.1.3.2 Exception handling
Icon: - Menu: ProjectWException handling Keyboard: -
Use this command to open the dialog box cyclical task and the general response of theselected automation system during a task overflow can be defined.
The layout of the dialog box
(^ 8-38)
(^ 8-31)
Exception handling
Exception handling
where the watchdog time for the
depends on the settings of the automation system.
Servo PLC
Automation system with drive function
Note!
The configuration of the digital outputs
gets lost with the extension modules.remains unchanged with the Servo PLC.
6-22
DDS EN 2.3
l
Loading...