CoDeSys V3.5 - Part A (English) V1.3.pdf

March 13, 2017 | Author: Felipe Cherfan | Category: N/A
Share Embed Donate


Short Description

Download CoDeSys V3.5 - Part A (English) V1.3.pdf...

Description

Textbook CoDeSys version 3 A hardware independent introduction to CoDeSys

pbF V3.5

A-2 This book is developed for the Codesys course for Industry. In this course you will learn how to program hardware useing the Codesys V3.5 pbF software. The name is Codesys provided by Festo. This Software is free, and is loaded onto the memory stick wich is handed out in this course. During the course we will use a Festo controller as the controlunit to control MPS station distribution or MecLab Pick and Place station. All Festo Didactic modules can be controlled with this controller.

Order Number: xxx DE Description: Codesys for Industy V3.5 Type: Codesys V3.5 pbF Version: V1.3 Auther: Rinus Simonis Edition: April 2013 © 2012 by Festo Didactic GmbH& Co. KG Rechbergerstraße 3, D-73770 Denkendorf All right resereved. No part of this publication may be reproduced, stored in a retrieval system or transmitted in any form or by any means, electronic, mechanical, photocopying, recording or otherwise, without the prior written permission of the publisher

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-3

CONTENTS CHAPTER 1 : Introduction ...................................................................................... 10 1.1 Codesys ............................................................................................................ 11 1.2 Details of Festo................................................................................................. 11 1.3 PC “administrator” Rights ................................................................................ 11 1.4 Installing Codesys V3 provided by Festo......................................................... 11 CHAPTER 2 : Methode to solve control problems .................................................. 12 3.1 From a problem to a Solution ........................................................................... 13 CHAPTER 4 : Quick Start Codesys ......................................................................... 16 4.1 Activating Codesys .......................................................................................... 17 4.2 Creating a New Project..................................................................................... 17 4.3 Device............................................................................................................... 18 4.4 Add POU(PRG)................................................................................................ 20 4.5 Task Configuration ........................................................................................... 27 4.6 Testing the application ..................................................................................... 29 4.7 Communication parameters.............................................................................. 29 4.8 Online testing ................................................................................................... 32 4.9 Basic visualisation ............................................................................................ 34 CHAPTER 5 : Project STRUCTURE ....................................................................... 42 5.1 Project Structure ............................................................................................... 43 5.1.1 PLC............................................................................................................ 44 5.1.2 Application ................................................................................................ 44 5.1.3 Libraries .................................................................................................... 44 5.1.4 Task configurator ...................................................................................... 45 5.1.5 Visualisation manager ............................................................................... 45 5.1.6 Visualisation screens ................................................................................. 45 5.2 Internal processing ........................................................................................... 45 5.3 Task Configuration ........................................................................................... 46 CHAPTER 6 : Hardware connection and testing...................................................... 48 6.1 Controller connection ....................................................................................... 49 6.2 Testing .............................................................................................................. 52 CHAPTER 7 : Motionstep diagram .......................................................................... 54 7.1 The Motion step Diagram................................................................................. 55 7.2 The Grid ........................................................................................................... 55 7.3 The rest position of an actuator ........................................................................ 56 7.4 The Memories .................................................................................................. 56 7.5 The Signals (Sensors) ....................................................................................... 57 7.6 The Actions ...................................................................................................... 57 7.7 Example without using a memory .................................................................... 57 7.8 Example using a memory ................................................................................. 59 7.9 Example using a timer and a memory .............................................................. 60 7.10 Example of a counter for the entire cycle ....................................................... 61 7.11 Example using a counter in the cycle ............................................................. 62 CHAPTER 8 : Sequential function chart .................................................................. 64 8.1 Sequential function chart .................................................................................. 65 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-4 8.2 The basic symbols............................................................................................ 65 8.3 Unconditional Jump ......................................................................................... 66 8.4 Conditional Jump ............................................................................................. 67 8.5 Parallel Branches ............................................................................................. 68 8.6 Step Memories ................................................................................................. 69 8.7 Actions ............................................................................................................. 70 CHAPTER 9 : recommendations for naming identifiers ......................................... 72 9.1 Identifiers for variables (variable names) ........................................................ 73 9.2 Identifiers for user-defined data types (DUT) ................................................. 74 9.3 Identifiers for functions, function blocks, programs (POU) ............................ 76 CHAPTER 10 : The 5 Programming laguages ........................................................ 78 10.1 Languages ...................................................................................................... 79 10.2 Combined program editor FBD / LD / IL ...................................................... 79 10.2.1 Programming IL...................................................................................... 79 10.2.2 Changing the view .................................................................................. 82 10.3 Instruction List (IL) ....................................................................................... 84 10.3.1 Labels...................................................................................................... 86 10.3.2 Modifiers ................................................................................................ 86 10.3.3 The IL Operators and Modifiers ............................................................. 87 10.3.4 Load (LD) instruction ............................................................................. 88 10.3.5 Store (ST) instruction ............................................................................. 88 10.3.6 Set (S) instruction ................................................................................... 89 10.3.7 Reset (R) instruction ............................................................................... 89 10.3.8 AND instruction...................................................................................... 89 10.3.9 OR instruction......................................................................................... 89 10.3.10 XOR instruction .................................................................................... 90 10.3.11 ADD...................................................................................................... 90 10.3.12 Subtract, SUB ....................................................................................... 90 10.3.13 Multiply, MUL ..................................................................................... 90 10.3.14 Divide, DIV .......................................................................................... 91 10.3.15 Greater Than, GT .................................................................................. 91 10.3.16 Greater than or equal, GE, .................................................................... 91 10.3.17 Equal, EQ,............................................................................................. 92 10.3.18 Not Equal, NE,...................................................................................... 92 10.3.19 Less than or equal, LE, ......................................................................... 92 10.3.20 Less than, LT, ....................................................................................... 93 10.3.21 JuMP, JMP,........................................................................................... 93 10.3.22 CAL instruction .................................................................................... 94 10.3.23 RET instruction..................................................................................... 96 10.3.24 Working with “( )” ................................................................................ 97 10.4 Function block diagram (FBD) ...................................................................... 98 10.4.1 Working FBD/LD/IL editor .................................................................... 99 10.4.2 AND function ....................................................................................... 101 10.4.3 OR function .......................................................................................... 101 10.4.4 EXOR function ..................................................................................... 102 10.4.5 Inversion / negation .............................................................................. 102 10.4.6 RS function block (Reset dominant) ..................................................... 103 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-5 10.4.7 SR function block (Set dominant) ......................................................... 103 10.4.8 CTD function block (decrement, CounT Down) ................................... 103 10.4.9 CTU function block (increment, CounT Up) ........................................ 104 10.4.10 CTUD function block .......................................................................... 104 10.4.11 RTC function block (Runtime Clock) ................................................. 105 10.4.12 TOF function block (delayed turn-off) ................................................ 106 10.4.13 TON function block (timed turn-on) ................................................... 107 10.4.14 TP function block (pulse timer)........................................................... 108 10.4.15 F_trig function block (falling edge trigger) ......................................... 108 10.4.16 R_trig function block (rising edge trigger) .......................................... 109 10.5 Ladder diagram (LD).................................................................................... 110 10.5.1 Normally open contact .......................................................................... 112 10.5.2 Normally closed contact ........................................................................ 112 10.5.3 Coil ........................................................................................................ 112 10.5.4 Negated coil........................................................................................... 112 10.5.5 Set Coil .................................................................................................. 113 10.5.6 Reset Coil .............................................................................................. 113 10.5.7 Rising edge ............................................................................................ 113 10.5.8 Falling edge ........................................................................................... 113 10.5.9 Timer function ....................................................................................... 113 10.5.10 Box with AND function ...................................................................... 114 10.5.11 Inserting a function block or module call ............................................ 114 10.6 Structured Text (ST)..................................................................................... 115 10.6.1 assignment, :=........................................................................................ 118 10.6.2 Using subprograms ................................................................................ 118 10.6.3 Using function blocks ............................................................................ 119 10.6.4 RETURN instruction ............................................................................. 120 10.6.5 IF … THEN … ELSIF … THEN … ELSE … END_IF instruction .... 120 10.6.6 CASE … or … ELSE … END_CASE instruction ............................... 121 10.6.7 FOR … TO … BY … DO … END_FOR instruction........................... 121 10.6.8 WHILE … DO … END_WHILE instruction ....................................... 122 10.6.9 REPEAT … UNTIL … END_REPEAT instruction............................ 122 10.6.10 EXIT instruction .................................................................................. 123 10.6.11 ADD, + ................................................................................................ 123 10.6.12 Subtract –, SUB ................................................................................... 124 10.6.13 Multiply *, MUL ................................................................................. 124 10.6.14 Divide /, DIV ....................................................................................... 124 10.6.15 Exponent **, EXPT............................................................................. 125 10.6.16 Modulo MOD ...................................................................................... 125 10.6.17 Less than , GT .............................................................................. 126 10.6.19 Less than or equal =, GE .............................................................. 126 10.6.21 Equal =, EQ ......................................................................................... 127 10.6.22 Not equal , NE ................................................................................ 127 10.6.23 AND, & instruction ............................................................................. 127 10.6.24 XOR instruction .................................................................................. 128 10.6.25 OR instruction ..................................................................................... 128 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-6 10.6.26 LEN .................................................................................................... 129 10.6.27 LEFT ................................................................................................... 129 10.6.28 RIGHT ................................................................................................ 129 10.6.29 MID .................................................................................................... 129 10.6.30 CONCAT ............................................................................................ 130 10.6.31 INSERT .............................................................................................. 130 10.6.32 DELETE ............................................................................................. 130 10.6.33 REPLACE........................................................................................... 130 10.6.34 FIND ................................................................................................... 131 10.7 Sequential Function Chart (SFC)................................................................. 132 10.7.1 Step ....................................................................................................... 133 10.7.2 Entry and exit actions ........................................................................... 134 10.7.3 Transition or condition ......................................................................... 135 10.7.4 Active step ............................................................................................ 135 10.7.5 Step with Action ................................................................................... 135 10.7.6 Qualifiers .............................................................................................. 136 10.7.7 Implicit variables in SFC ...................................................................... 136 10.7.8 SFC flags .............................................................................................. 137 10.7.9 Branches ............................................................................................... 138 10.7.10 Jumps .................................................................................................. 141 10.8 Continues Function Chart (CFC) ................................................................. 142 10.8.1 Editor functions .................................................................................... 144 10.8.2 Pointer ................................................................................................... 144 10.8.3 Insert Input ............................................................................................ 144 10.8.4 Insert Output ......................................................................................... 144 10.8.5 Insert Box ............................................................................................. 145 10.8.6 Insert Jump............................................................................................ 145 10.8.7 Insert Label ........................................................................................... 145 10.8.8 Insert Return ......................................................................................... 145 10.8.9 Insert Composer .................................................................................... 145 10.8.10 Insert Selector ..................................................................................... 145 10.8.11 Insert Comment .................................................................................. 145 10.8.12 Insert Connection mark source ........................................................... 146 10.8.13 Insert Connection mark Sink .............................................................. 146 10.8.14 Insert Input of box .............................................................................. 146 10.8.15 Insert output of box ............................................................................. 146 10.8.16 Extras Negate ...................................................................................... 147 10.8.17 Extras Set/Reset .................................................................................. 147 10.8.18 Extras EN/ENO .................................................................................. 147 10.8.19 Reset Pins............................................................................................ 147 10.8.20 Remove unused pins ........................................................................... 147 CHAPTER 11 : Quick start Visualization.............................................................. 148 11.1 Visualization in your project ....................................................................... 149 11.1.1 The screen ............................................................................................. 152 11.1.2 Configuration of visualisation object .................................................... 154 11.1.3 Stop button ............................................................................................ 156 11.1.4 Relay ..................................................................................................... 156 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-7 11.1.5 Lamp...................................................................................................... 156 11.1.6 Activation of the complete application ................................................. 156 CHAPTER 12 : Visualisation ................................................................................. 158 13.1 Editor functions ............................................................................................ 159 13.1.1 Static and dynamic text in a component ................................................ 159 13.2 Variables displayed in the “Text” box ......................................................... 159 CHAPTER 14 : ENI ............................................................................................... 164 14.1 ENI ............................................................................................................... 165 14.1.1 General .................................................................................................. 165 14.1.2 ENI (Engineering Interface) .................................................................. 165 14.1.3 Preconditions: ........................................................................................ 166 14.1.4 Handling Codesys project objects under source control: ...................... 166 14.1.5 Installation, usage of ENI Server .......................................................... 167 CHAPTER 15 : user interface ................................................................................ 168 15.1 The main window ......................................................................................... 169 15.2 Pull down menu‟s ......................................................................................... 169 15.2.1 File......................................................................................................... 169 15.2.2 Edit ........................................................................................................ 170 15.2.3 View ...................................................................................................... 170 15.2.4 Project.................................................................................................... 171 15.2.5 Build ...................................................................................................... 171 15.2.6 Online .................................................................................................... 172 15.2.7 Debug .................................................................................................... 172 15.2.8 Tools ...................................................................................................... 173 15.2.9 Windows................................................................................................ 173 15.2.10 Help ..................................................................................................... 173 15.3 Device/POU ................................................................................................. 174 15.3.1 POU ....................................................................................................... 174 15.3.2 Device, Device tree ............................................................................... 174 15.3.3 Generals................................................................................................. 175 15.3.4 Boot project ........................................................................................... 175 15.3.5 Password................................................................................................ 177 CHAPTER 16 : Library manager ........................................................................... 182 16.1 Libraries ....................................................................................................... 183 16.2 Installation and including in project ............................................................. 183 16.3 Codesys V2.3 libraries ................................................................................. 183 CHAPTER 17 : Trace ............................................................................................. 186 17.1 Trace configuration ...................................................................................... 187 CHAPTER 18 : Installing ADDITIONAL CONTROLLERS................................ 190 18.1 Installing an additional controller................................................................. 191 CHAPTER 19 : Documentation ............................................................................. 194 19.1 Documenting a project ................................................................................. 195 19.2 Project info ................................................................................................... 195 19.3 Project statistics ............................................................................................ 196 19.4 Printer setup.................................................................................................. 196 19.5 Printing ......................................................................................................... 196 19.6 Additional project documentation ................................................................ 196 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-8 CHAPTER 20 : glossary ........................................................................................ 198 CHAPTER 21 : Shortcuts ...................................................................................... 204

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-9

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-10

CHAPTER 1 : INTRODUCTION

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-11 1.1 Codesys Codesys: The programing standard for PLC‟s according to the IEC 61131-3 Codesys (Controller Development System) is a software tool used to do industrial automization. Its has two main parts:  The programming envirolment of Codesys,  The run time system for the selected tragets. Each IEC 61131-3 run time system controller can be programmed with Codesys. Intergraded compilers ensure that the program code is processed at optimum speed. More than 200 innovative manufacturers from various industry sectors, program there automated systems with Codesys. The result is that thousands of end users and machine developers over the world use Codesys on a daily basis for automation of processes. At the moment Codesys is the most used IEC 61131-3 development tool in Europe. Codesys can be downloaded from the Festo website once you register on the site. 1.2 Details of Festo Codesys pbF is supplied and used by Festo. Festo Didactic GmbH& Co. KG Rechbergerstraße 3, D-73770 Denkendorf Internet; www.festo-didactic.com e-mail: [email protected] 1.3 PC “administrator” Rights To install the Codesys software the PC user must have local administrator rights! 1.4 Installing Codesys V3 provided by Festo. Put the CD in the CD-ROM player or put the pen drive in the USB port of your computer. Select the file name Setup_CodesysV3_pbf_Full (…..) The installation will be executed. In this book we assume you make no changes during the installation of the software.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-12

CHAPTER 2 : METHODE TO SOLVE CONTROL PROBLEMS

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-13 3.1 From a problem to a Solution The development from a control task to an actual working system can be a difficult task, if the correct methods and tools are not used. There are two possible methods that can be used. The first method is by making use of a motion step diagram, and the second method makes use of a sequential function chart. Sequential function chart is a step orientated structure. This method is useful if the same programming language (SFC) is used. In this course we will make use of the motion step diagram to solve the problems. The calculated solutions can be used in all programming languages. Here are the basic principles of the motion step diagram: Inactive

Inactive a0

a1

A

Active

A

b1

b0

b1

b0

B

a0

a1

Active

B

Figure 1

On the left of figure 1 the position of Actuator A. When the actuator is in the rest position, sensor “a0” is activated. If the actuator moves to the activated position, sensor “a1” is activated. On the right of figure 1 the position of Actuator B. When the actuator is in the rest position, sensor “b0” is activated. If the actuator moves to the activated position, sensor “b1” is activated. Note in figure 1 that actuator A piston is at rest in the retracted position. Actuator B piston is at rest in the extended position. In the motion diagram we only indicate when the actuator moves from the rest position to the activated position. (The actual direction of the actuator piston is not shown) The movement of the actuator is used as the starting point of the diagram.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-14 In figure 2 the movement of one actuator is illustrated. 1

2

3/11

A

The bottom line indicates that the actuator is in the rest position. The top line indicates that the actuator is in the actuated position. The vertical lines are called step lines. The first (1) and the last step (3) is always the same. The next step is to indicate the state of the sensors “a0” en “a1” on the diagram.

Figure 2

1

2

A

3/1 1

Start a0 a1

In figure 3, below the movement of the actuator we will first insert the status of the “Start button”, and then follow with the status of the sensors “a0” en “a1”. The bottom line indicates that the sensor has a signal state “0” (off), and the top line indicates that the sensor has a signal state “1” (on). The next step is to determine at which moment a signal must be given, for the actuator to move in a direction. Figure 3

1 A Start a0 a1 A+ A-

2

3/1 1

In figure 4 we indicate at witch step an action must be taken. On step 1, “A+”, and on step 2 “A-”.

The next step is to determine which signal(s) or combinations thereof is needed to perform the action to be taken.

Figure 4

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-15 1 A Start a0 a1 A+ A-

2

3/1 1

A+ = Start • a0 A- = a1

In figure 5 it is indicated that if the “Start” is pushed and “a0” has a signal state of “1”, “A+” will be activated. If “a1”changes to a signal state “1”, “A-” will be activated. The length of the signals is indicated by the horizontal lines from where the action should be performed.

Figure 5

The next step is to convert the Boolean formulas into a program.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-16

CHAPTER 4 : QUICK START CODESYS

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-17 4.1 Activating Codesys If Codesys in installed in the standard way, it can be opened in the following method: Go to Start; Programs; Festo Software; Codesys V3; and select Codesys V3.5 pbF. After a while Codesys opening screen will be displayed. In figure 6 the opening screen is shown.

Figure 6

4.2 Creating a New Project There are several ways to create a new project. In this book we will use the menu bar for all the actions. Select File, and in the drop down screen select New Project see figure 7

Figure 7

In Window Categories „general‟ should be chosen. Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-18 After name the „name of the project‟ should be written. Choose „Empty project‟. Make sure the proper location is chosen to save your projects. When everything is OK click on „OK‟

Figure 8

Your first project is created. Make sure you safe your project. Only after saving your project, the automatic save function in Codesys will save your work regularly. Good practice is to create a separate folder for each project you create. In this way you have a proper overview of your work. Otherwise Codesys is placing all your work in one folder. The next step is to add a device. 4.3 Device Switch over to the tab Device in the left bottom of the main screen.

Figure 9

Click on “MyFirst” and click with the right mouse button The following window will appear:

Click on Add Device

Figure 10

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-19

Figure 11

Choose Codesys Control Win V3 and click on Add Device. After a moment you see the device window changing into figure 12

Figure 12

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-20 4.4 Add POU(PRG) Click on „Application‟ in the device window. Click with the right your mouse button, choose Add Object and choose POU

Figure 13

Figure 14

Now you have to choose the appropriate language. In figure 14 Instruction list is chosen. When you click on Open the appropriate language editor will open.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-21

Figure 15

The upper part is to declare the local variables. The lower part is the language editor in which you can write your application. We are going to convert the following Boolean formulas into an application. A += Start · a0 A- = a1

Figure 16

Place the cursor as shown in figure 16 Type the following instructions: LD Start Press Enter Typing the LD command the window will be shown. You can choose a command from this window or just type the next text.

Figure 17

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-22 Typing Start will also open a window. Just push the Enter button.

Figure 18

After pushing the Enter button the next screen will open. This is the Auto Declare screen in which you declare the variables you use in your applica tion.

Figure 19

The Variable „Start‟ is of the type Bool. Just Click on OK to create this variable.

Figure 20

Place the cursor as shown in figure 20. The information about this variable will be shown. Click with the right mouse button. The window shown in figure 21 is shown.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-23

Figure 21

Choose ‟insert IL line below‟ now you can enter the AND function

Figure 22

Press Enter, the Auto Declare screen is opened again.

Figure 23

Variable a0 is of the type BOOL. Press OK Your editor screen should look like figure 24. Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-24

Figure 24

Place the cursor next to a0 and insert an IL line below (figure 21) In figure 25 is shown how you application should look after entering the instructions „ST A‟

Figure 25

The 3 lines you see in the editor window belong to the first „Network‟ of your application. Now we are going to add a new Network for the next action

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-25 Place the cursor below the first network and right click on your mouse.

Figure 26

Now we can enter the information for the second network.

Figure 27

Your application should look like figure 27. Pushing Function button F11 which is a Build of your project should give no error messages.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-26

Figure 28

Our basic application is finished. The next step is to add a Task configuration

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-27 4.5 Task Configuration

Figure 29

To add a Task configuration, choose „Application‟, right click on your mouse, Choose „Add Object‟, Choose „Task Configuration‟ Leave the name as is. Press „Open‟.

Figure 30

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-28

Click on Add POU, the input assistant will open.

Choose POU and click on OK. The next step is to test your application using the Soft PLC in your PC.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-29 4.6 Testing the application Activating Codesys V3 in your system tray the Gateway and the “Soft PLC” should be activated. Look in your system tray if the Gateway and the Soft PLC are available and running. After starting the Soft PLC it will run for 1 hour after that you have to activate the PLC again!

Figure 31

4.7 Communication parameters Setting the communication parameters to activate your application. Double click on Codesys_Control_Win_V3

Figure 32

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-30 The next window will open in the main window.

Figure 33

Choose „Gatway-1‟ by clicking on it.

Figure 34

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-31

Figure 35

1. Select the PLC 2. Device info appears 3. Set active path

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-32 4.8 Online testing Switch over to POU in the main screen. Choose Online and choose login

Figure 36

On the bottom of your screen you can see that your application is in STOP mode. You can activate it with F5. When the RED Stop is turned into the GREEN RUN your application is running.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-33 Place the cursor after Start in the Colum „Prepared value‟ and click once. The word TRUE will appear. Repeat this in the box after a0.

Figure 37

The prepared value is now TRUE. This value has to be transferred to the soft PLC. This can be done with Ctrl + F7 write values in the Debug menu. You will see that variable A is switched on. Don‟t forget to make Start and a0 false again. Write values with Ctrl + F7 Make a1 true and write the values with Ctrl + F7

Figure 38

Repeat this a few times to get acquainted with these functions

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-34 4.9 Basic visualisation Logout to stop the application. Only then you can add visualisation.

Figure 39

To add visualisation Choose „application‟ right click on your mouse choose „Add Object‟ and choose „Visualisation‟

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-35

Figure 40

Choose a proper name for the visualisation. Screen_1 and click on Open. After a while the device window is looking like figure 41.

Figure 41

On the right hand side the visualisation screen_1 is open and ready to edit.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-36

Figure 42

To create a button in the visualisation screen click on a symbol on the right side of the screen in the Toolbox window and draw it in the visualisation screen. The following things have to be done: We want to change the colour of the start button when it is pressed. We want to change the status of the variable start from FALSE into TRUE. We want to change the colour of the variable a0 when it is activated. We want to change the status of the variable a0 when it is activated. We want to change the colour of the Actuator A when it is activated. We want to change the colour of the variable a1 when it is activated. We want to change the status of the variable a1 when it is activated. To realise that we need some functions from the properties window

Figure 43

In our case we need these three topics. First we open the Colours

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-37

Figure 44

By clicking on the + sign in front of the colours it opens the colours window. Choose the colour for the normal state by double clicking on the right hand side of the Fill colour symbol and choose the appropriate colour. Repeat this for the Alarm state. In the visualisation screen the colour of the start button is changed into the normal state colour.

Figure 45

Open the Colour variable window and double click on the right hand side of the Toggle colour. Then click on the dotted line. The input assistant window will open.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-38

Figure 46

After you have chosen the Start variable click on OK. In this state the colour of the start button will change when the status of the Start button is changed. Now we have to open the input configuration window

Figure 47

Under normal conditions the Start button is a Push button and will tap the variable from FALSE to TRUE when the Start button is pushed. When the Start button is released the variable is taped back from TRUE to FALSE. In our example we have to

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-39 activate the Start button and the variable a0. Because we want to make it as easy as possible we are now using the Toggle function for the Start button. Place the cursor on the right hand side of the variable under the Word Toggle and double click.

Figure 48

Click on the dotted line and the input assistant will open. Choose Start again This is how the configuration should look. See figure 49

Figure 49

Repeat these actions for a0 and a1. For the Actuator A you only need the colour change, Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-40

Figure 50

Your Visualisation screen could look like this figure 50. When you are ready, perform a login, and activate the application with F5 Push the start button. Activate a0 and after a while activate a1 The colour of the actuator should change. Congratulations, you have just created your first working project in Codesys V3.5. All this information is explained extensively in other Chapters.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-41

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-42

CHAPTER 5 : PROJECT STRUCTURE

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-43 5.1 Project Structure

Project PLC (Soft PLC) PLC logic (handling I/O) Application Libraries Global variables POU„s

Local variables Language Code

Task configuration Task (POU‟s) Visualistion Task Visualisation manager Target visualisation Web Visualistion Visualisation screens

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-44 5.1.1 PLC PLC is the type of (soft) PLC which is used. PLC logic is how the PLC is handling the logic part (I/O). 5.1.2 Application An application consists always a Library manager When applicable Global variables POU‟s (Program Organisation Unit) (Program, Function, Function Block) 5.1.3 Libraries Libraries can be a collection of functions for certain hardware. 5.1.3.1 Global variables Global variables can be reached from all other POU‟s in the application. They are created in the Global variable editor. Local variables with the same name as a global variable have a higher priority in the processing of a POU. 5.1.3.2 Program Every program consists of a declaration section and a body. In the declaration section the local variables are declared. The body is written in one of the IEC programming languages: IL, ST, SFC, FBD and LD; or CFC. POUs may call other POUs; however recursive calling (calling itself) is prohibited. 5.1.3.3 Function We are all familiar with such functions as, add, square root, sin, cos, equal, etc. Within IEC, an enormous number of these standard functions are defined. You can even define your own functions, such as in the following example, defining the function simple of type REAL: FUNCTION simple: REAL VAR_INPUT A, B: REAL; C: REAL := 1.0; END_VAR simple := A*B/C; END_FUNCTION Once defined, this function can be used endlessly in the same program, in other programs and even in other projects.

5.1.3.4 Function block The same applies to function blocks as for functions; we can defines these ourselves, and use them as often as we wish. Function block instances (copies) are allowed. Each Instance has a unique identifier, and can be declared locally or globally.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-45 5.1.4 Task configurator 5.1.4.1 Task In the task the POU can be given a priority. Based on this priority he will be processed. 5.1.4.2 Visualization Task In the visualisation task the different HMI screens are processed. A visualisation task will never interrupt a POU task.

5.1.5 Visualisation manager 5.1.5.1 Target visualisation This will process the visualisation for this target. 5.1.5.2 WEB visualisation When supported will process the visualisation for the WEB 5.1.6 Visualisation screens The actual visualisation screens for this application 5.2 Internal processing The flowchart shows how the processor works when POUs are used.

I/O scan outputs in

poll inputs logic

evaluate logic communication

program scan post outputs

Figure 51

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-46 5.3 Task Configuration With the Task Configurator we can create tasks to be carried out in a specific order and at specific times. In the Task Configurator each task is given a priority number. The task with the highest priority (priority number 1) will be performed first. Tasks can be performed in the following way: Cyclic, the task is performed cyclically according to the time specified in the “interval” field. Freewheeling, the task will be processed as soon as the program is started and at the end of one run will be automatically restarted in a continuous loop. There is no cycle time defined.

Event, (Boolean event, the task will be started as soon as the variable defined in the Event field gets a rising edge.)

Status, (Boolean event, the task will be started if the variable defined in the Event field is true.)

Triggered by external event, depending on the target, the task is performed if a system event occurs, which is defined in the “event” field. The system event is not the confused with the “Codesys” system events. Watchdog If the target system configuration supports a watchdog, a high and low limit can be set for each task. Active watchdog With an active watchdog, if the task exceeds the watchdog time, the task will be stop with an error signal. Time: (Example t#200ms), if this time is exceeded the task will be stop. Depending on the target settings, the time has to be entered as a percentage value of the cycle time. The time block is gray, and there will be a % sign. Sensitivity: here an integer number is entered that will be displayed as an error when the watchdog time is exceeded. NOTE! If a 0 is entered the watchdog is switched off.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-47 Each task can call an unlimited amount of POU‟s. For each task a priority number, between 0 and 31should be given. A watchdog can be defined for each task. With a “large” project with several hundred I/O‟s, between 3 to 5 tasks should be defined. Switching from one task to the next takes approximately 10µs. Codesys processes all POUs and any configured tasks independent of the underlying operating system. If the underlying operating system is capable of multitasking, then it can carry out other tasks parallel to Codesys. Such a parallel task could for example be used to interrupt a running Codesys task that has got stuck in an endless loop. If the underlying operating system is non-multitasking, then the entire controller will have to be reset to factory settings.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-48

CHAPTER 6 : HARDWARE CONNECTION AND TESTING

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-49 6.1 Controller connection In this course we use a CECC, with 14 digital inputs and 8 digital outputs. It also has USB, Ethernet and CANopen interface on-board.

Figure 52

At the back is a 230V AC socket. Place the cord with the plug in the socket and turn the power on. Device supply voltage X1 Pin

Signal

Comment

X1.1

24V

U+ (electronic)

X1.2

0V

U- (GND)

X1.3

GND

Functional earth

X1.4

n.c.

Not connected

I/O interface X2, X3 and X4 Pin

Comment

X2.0 ..X2.1

Fast digital inputs (200kHz)

X2.2 … x2.7

Digital Inputs (1 kHz)

X3.0 … X3.5

Digital Inputs (1 kHz)

X4.0 … X4.7

Digital outputs (500mA)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-50 Supply voltage I/O X5 Pin

Signal

Comment

X5.1

24V

U+ (I/O supply)

X5.2

0V

U- (GND)

CAN open interface X6

1)

Pin

Signal

Comment

1

n.c.

Not connected

2

CAN_L1)

CAN Low

3

CAN_GND

CAN ground

4

n.c.

Not connected

5

CAN_SHLD

Connection to functional earth

6

CAN_GND

CAN ground (optional)

7

CAN_H1)

CAN high

8

n.c.

Not connected

9

n.c.

Not connected

If the CECC is located at the end of the cable, connect pin 2 and pin 7 with the help of a termination resistor (120 ohms/0,25W)

Ethernet interface X8 Pin

Signal

Comment

1

TD+

Transmitted Data +

2

TD-

Transmitted Data -

3

RD+

Received Data +

4

n.c.

Not connected

5

n.c.

Not connected

6

RD-

Received Data -

7

n.c.

Not connected

8

n.c.

Not connected

Body

Screen

Load voltage supply IO-Link X11 (CECC-LK) Pin

Signal

Connection for load voltage supply via IO-link

X11.1 24V X11.2

master ports: UA+ Connection for load voltage supply via IO-link

X11.3 0V X11.4

Comment

master ports: UA- (GND)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-51 Communication interface IO-Link master (CECC-LK) X12, X13, X14 and X15 Pin

Signal

Comment

X12.1, X13.1, X14.1, X15.1

L+

24V

C/Q

Communication signal IO-Link

X12.2, X13.2, X14.2, X15.2 X12.3, X13.3, X14.3, X15.3

L-

0V

X12.4, X13.4, X14.4, X15.4

24V

UA+

X12.5, X13.5, X14.5, X15.5

0V

UA-

IO-Link device X16 Pin

Signal

Comment

X16.1

L+

24V

X16.2

C/Q

Communication signal IO-Link

X16.3

L-

0V

Status LED‟s Pin

Comment

Run

Status of the application

Net

Device detected

Error

Error

Mod

Reserved

Connecting CECC-LK to your PC Plug the RJ45 crossover Ethernet cable into the Ethernet socket and the other end of the cable into the PC. If you use a Hub, Switch or Router between the PC en de CECC-LK a 1:1 Ethernet cable can be used. Use a screened LAN/Ethernet cable (shielded twisted pair, STP) from Cat 5/5e/6/7 for this.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-52 6.2 Testing Create a standard CECC project, use the “CECC template” “I_O_Test” The (POU) program should be of the type Structured Text (ST) write only a semicolon “;” in it. Open the input window and switch on “Always update variables”. Open the output window and switch on “Always update variables”. Download this project to the controller. Activate the program. Now you can “see” in the input window dynamically the actual status of the inputs. When you switch to the output window, you can change the status of each output by placing the new value behind the output and use Ctrl + F7 to send this value to the controller. This project can be used when you want to test only the I/O of the system.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-53

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-54

CHAPTER 7 : MOTIONSTEP DIAGRAM

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-55 7.1 The Motion step Diagram To create a universal working solution, regardless of which programming language will be used, we make use of a motion step diagram. In the following sections the various parts of the motion diagram is explained. First we make a basic representation of the actuator movement from the rest position to the activated position, and vice versa. Then we will discuss the steps to get from a problem to a solution. 7.2 The Grid The vertical lines in the diagram are called step. This is numbered from 1 to xx; the last step is equal to the step 1. At the top of the diagram between two horizontal lines the action of the actuators is indicated. The bottom line indicates that the actuator is at rest, and the top line indicates the actuator is in the activated position. 1

2

3

4

5

6

7

8

9 (1) 20= 1

A

Step line

B

active position rest position

21= 2 22= 4

C

Value A active Value B active Value C active + Total Digital value

Step lines Figure 53

The active position of the top cylinder marked with the letter A, has a digital value 1. The active position of the second cylinder marked with the letter b, has a digital value 2. The active position of the third cylinder marked with the letter c, has a digital value 4. On each step the corresponding value should be recorded, and eventually added up, from top to bottom.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-56 Each step will have a unique number. As soon as two steps have the same value, then a memory has to be used to differentiate between the two steps. This memory is called a “make uneven memory”. There is one exception to the rule. If two consecutive steps have the same value, then a timer is used, and then a memory is not needed. 7.3 The rest position of an actuator In the rest position the xx0 sensor is always activated. (See Figure 45).

Figure 54

The actuators are labels in capital letters and the sensors in small letters. The memories that will be used are drawn under the actuators (cylinders). 7.4 The Memories G1 G2

G1s = G1r = G2s = G2r =

Figure 55

The memory cannot be activated or deactivated on the step where the numbers are the same. The set and reset (of the bi-stable memory must be changed to a mono-stable memory) G  set  G   reset When two consecutive steps have the same number, timers is used to activate and deactivate the actuator. A memory is not needed

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-57 7.5 The Signals (Sensors) The signals are placed under the memories. Start a0 a1 Figure 56

Above the line the signal is 1, and below the line the signal is 0. The red squares indicate when a signal changes from a 0 to a 1. The signals do not switch on the steps lines. Switch on happens just before the step line, and switch off happens just after the step line. At the Start the red square is just before step 1, because that is the point when it is activated. The stipple line indicates that the Start signal can be on for a longer period. 7.6 The Actions A +1 A-

A+ = A- =

Figure 57

The red dot indicates where the action should start. The horizontal line indicates for how long the action in active. To perform an action, look above for a rising signal (signal that goes from a 0 to a 1). Because this is the first step we also look for the last signal that was activated. The formula for A+ should then be:

A  Start  a0

The formula for A- should then be:

A  a1 When sensors are used twice then a relay which has multiple contacts has to be used.

7.7 Example without using a memory Here is a solution using a motion step diagram using two cylinders and no memory. 1

3

2

4

5 (1) 20=1

A 1

2 =2 Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic B G

0

1

3

2

0

No Memory

A-58

Figure 58

Step 1: Draw the motion of the actuators Step 2: Check for the digital values that appear more than once Step 3: Draw the signals (sensors) Step 4: Draw the actions to take place Step 5: Note the Boolean formulas Step 6: Determine the length that actions are activated Step 7: Check for overlapping actions (shorten if necessary)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-59 7.8 Example using a memory Here is a solution using a motion step diagram for two cylinders using a memory. 1

2

3

4

5 (1) 20=1

A 21=2 B G

0

1

3

1

0

One Memory

G1s = Start • a0 G1r = b1

G 1 Start a0 a1 b0 b1 A+

A+ = G1

A-

A- = b0 • G1

B+

B+ = a1 • G1

B-

B- = b1 Figure 59

Step 1: Draw the motion of the actuators Step 2: Check for the digital values that appear more than once Step 3: draw the memories Step 4: draw the signals (sensors) Step 5: Note the memory formulas Step 6: Draw the actions Step 7: Note the Boolean formulas Step 8: Determine the length the action is activated Step 9: Check for overlapping actions (shorten if necessary) Here we see to activate the memory, the primary signal combination “Start AND a0” is used. If we look at the signal needed for “A+” then we can use the same signals. But because “Start AND a0” is used to activate the memory, we use “G1”for “A+”. Here we see how primary and secondary signals are used in the formulas.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-60 7.9 Example using a timer and a memory Here is a solution using a motion step diagram for two cylinders using a timer and a memory. 1

2

3

4

5

6 (1) 20=1

A 21=2 B G

0

1

3

3

1

0

One Memory

G1s = Start • G1r = b1 a0 T = b1

G 1 T t Start a0 a1 b0 b1 A + A-

A+ = G1

B + B-

B+ = a1 • G1

A- = b0 • G1

B- = t Figure 60

Step 3 and 4 has the same value “3“. This will only happen when a timer is used. The timer has two parts, the timer “T” and the contact “t”. As soon as the start condition for the timer is true “1”, the timer starts timing. When the preset time has elapsed the timer contact “t” switches. Step 1: Draw the motion of the actuators Step 2: Check for the digital values that appear more than once Step 3: Draw the memories Step 4: Draw the timer (T en t) Step 5: Draw the signals (Sensors) Step 6: Note memory formulas Step 7: Note formula for Timer T Step 8: Draw actions Step 9: Note Boolean formulas Step 10: Determine the length the action is activated

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-61 Step 11: Check for overlapping actions (shorten if necessary) 7.10 Example of a counter for the entire cycle The whole sequence is repeated 5 times. 1

2

3

4

5 (1) 20=1 cycles 5x

A

21=2 B G G 1 C

0

1

3

1

0

One memory

G1s = Start • a0 G1r = b1

Start a0 a1 b0 b1 A+

A+ = G1• C

A-

A- = b0 • G1

B+

B+ = a1 • G1

B-

B- = b1

Cpuls

Cpuls = b1

Creset

Creset = G1 • b0 • C

Figure 61

Between step 4 and 5 it is indicated that the sequence should be repeated a number of times. Extra steps should be taken to prevent the machine to start automatically when the supply is switched on. Using an extra memory will prevent this from happening. Start must be replaced with G2. The set command is Start en the reset command is C.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-62 7.11 Example using a counter in the cycle In this example cylinder B must move 5 times, then cylinder A is retracted in rest position. Cycle is finished. Cylinder B 5 x

1

2

3

4

5 (1) 20=1

A 21=2 B G G 1 C

0

1

3

1

0

One memory

G1s = a0 + b0 • G1 • C G1r = b1

Start a0 a1 b0 b1 A+

A+ = a0 • C

A-

A- = C • b0 • G1

B+

B+ = a1 • G1

B-

B- = b1

Cpuls

Cpuls = b1

Creset

Creset = Start • a0 • b0 • C

F Figure 62

Between step 3 and 4 it is indicated that cylinder B should repeat a number of cycles. Extra steps should be taken to prevent the machine to start automatically when the supply is switched on. Using an extra memory will prevent this from happening. Start must be replaced with G2. The set command is Start en the reset command is C.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-63

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-64

CHAPTER 8 : SEQUENTIAL FUNCTION CHART

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-65 8.1 Sequential function chart This solution is most suitable for sequential controllers. The BS EN IEC 60848:2002 is the standard in French and English. The BS 5848:1993 is the standard in Dutch and English. Both standards give the description of the symbols, and use a graphic representation of the control problem. In the following sections we will discuss the symbols, the functions, and operations used in the diagrams. 8.2 The basic symbols The function diagram is designed using the following symbols.

Ini

Initiating step

Step Figure 63

Each function diagram starts with an initiating step. Below the step is a horizontal line. This is where a condition is entered. This condition has to be met before going to the next step

Ini Condition

Action

Between the steps is the condition that has to be met before going to the next step. Once the condition is met, the previous step becomes inactive and the next step becomes active. Once in the step the actions will be carried out. In the “ini” step no actions is entered, except for loading timers and counters. If the PLC is in run mode this step becomes active immediately.

Condition

Action

Figure 64

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-66 More than 1 action can be connected to an action. An action is represented in a square

Action 1

Action 1

Action 1

Action 2

Action 2

Action 3

Action 3

Figure 65

In this way action is linked to one step. To ensure proper functioning of the SFC it is important to have a condition that has to be met between the steps. 8.3 Unconditional Jump In SFC it can happen that a jump function has to be performed between steps. Thus we get the “conditional jump” and the “unconditional jump”. After step 3 a jump function will be performed, and jump back to the "ini” step. Step 4 will never be performed.

Ini

1

2

3 The unconditional jump

4 Figure 66

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-67 8.4 Conditional Jump A condition jump can also be called a destination jump. Depending on the condition that is true, the corresponding branch will be executed.

Ini

The conditional Jump Here a destination is made between the left and the right branch in SFC, depending on the condition.

1

3 Only one of the branches will be performed. This is referred to as an OR function.

2

4

5

6

Figure 67

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-68 8.5 Parallel Branches In some cases it is necessary that several branches of the SFC must run simultaneous. It will look as follows:

Ini Start of simultaneous operation

1

3

2

4 End of simultaneous operation

5

6

Figure 68

Both branches are processed at the same time. This is referred to as an AND function.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-69 8.6 Step Memories A sequential function chart is a simplified version of a motion step diagram. Before each step we need to make use of a memory.

Ini

Initialisation step

Start 1

2

3

4

Condition

A+

step 1

a1

Condition

B+

step 2

b1

Condition

A-

step 3

a0

Condition

B-

step 4

b0

Condition

Figure 69

For the program we use the following memories: G0 before step ini, G1 before step 1, G2 before step 2, G3 before step 3, G4 before step 4.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-70 First we need to create the steps G0set = G4 • b0 + ini G0reset = G1 G1set = G0 • Start G1reset = G2 G2set = G1 • a1 G2reset = G3 G3set = G2 • b1 G3reset = G4 G4set = G3 • a0 G4reset = G0 Two memories will always be active. 8.7 Actions Actions with the use of bi-stabile valves, uses the following formula: A+ = G1 A- = G3 B+ = G2 B- = G4 If A used a mono-stabile valve, then the following formula is used: A+ = G1 + G2 (A- = G3 is not used in this application) B+ = G2 B- = G4

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-71

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-72

CHAPTER 9 : RECOMMENDATIONS FOR NAMING IDENTIFIERS

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-73 Naming of identifiers Identifiers are defined at the declaration of variables (Variable names), user-defined data types and at the creation of POUs (functions, function blocks, programs) and visualizations. You might follow the following recommendations concerning the naming of identifiers in order to make it as unique as possible. 9.1 Identifiers for variables (variable names) The naming of variables in applications and libraries as far as possible should follow the Hungarian notation: For each variable a meaningful, short description should be found, the base name. The first letter of each word of a base name should be a capital letter, the others should be small ones (Example: FileSize). If needed additionally a translation file for other languages can be created. Before the base name, corresponding to the data type of the variable, prefix(is) is added in small letters. Data type

lower limit

upper limit

BOOL

FALSE

TRUE

Information content 1 Bit

Prefix

BYTE

8 Bit

x* b by

WORD

16 Bit

w

DWORD

32 Bit

dw

LWORD

64 Bit

lw

8 Bit 8 Bit 16 Bit 16 Bit 32 Bit 32 Bit 64 Bit 64 Bit

si usi i ui di udi li uli

32 Bit 64 Bit

r lr

SINT USINT INT UINT DINT UDINT LINT ULINT REAL LREAL

-128 0 -32.768 0 -2.147.483.648 0 -263 0

127 255 32.767 65.535 2.147.483.647 4.294.967.295 263 - 1 264 - 1

STRING

s

TIME TIME_OF_DAY DATETIME DATE ENUM POINTER ARRAY

tim tod dt date e p a

16 Bit

Comment

reserved Bit string, not for arithm. operations Bit string, not for arithm. operations Bit string, not for arithm. operations not for arithm. operations

* Pointedly for BOOLean variables x is chosen as prefix, in order to differentiate from BYTE and also in order to accommodate the perception of an IEC-programmer (see addressing %IX0.0). Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-74

Examples: bySubIndex: BYTE; sFileName: STRING; udiCounter: UDINT; In nested declarations the prefixes are attached to each other in the order of the declarations: Example: pabyTelegramData: POINTER TO ARRAY [0..7] OF BYTE; Function block instances and variables of user-defined data types as a prefix get a shortcut for the FB- resp. data type name (Example: sdo). Example: cansdoReceivedTelegram: CAN_SDOTelegram; TYPE CAN_SDOTelegram : (* prefix: sdo *) STRUCT wIndex:WORD; bySubIndex:BYTE; byLen:BYTE; aby: ARRAY [0..3] OF BYTE; END_STRUCT END_TYPE Local constants (c) start with prefix c and an attached underscore, followed by the type prefix and the variable name. Example: VAR CONSTANT c_uiSyncID: UINT := 16#80; END_VAR For Global Variables (g) and Global Constants (gc) an additional prefix + underscore is attached to the library prefix: Examples: VAR_GLOBAL CAN_g_iTest: INT; END_VAR VAR_GLOBAL CONSTANT CAN_gc_dwExample: DWORD; END_VAR Appendix J: - Recommendations on the naming of identifiers Codesys V2.3 10-105 9.2 Identifiers for user-defined data types (DUT) The name of each structure data type consists of a library prefix (Example: CAN), an underscore and a preferably short expressive description (Example: SDOTelegram) of the structure. The associated prefix for used variables of this structure should follow directly after the colon.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-75

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-76 Example: TYPE CAN_SDOTelegram : (* prefix: sdo *) STRUCT wIndex:WORD; bySubIndex:BYTE; byLen:BYTE; abyData: ARRAY [0..3] OF BYTE; END_STRUCT END_TYPE Enumerations start with the library prefix (Example: CAL), followed by an underscore and the identifier in capital letters. Regard that in previous versions of Codesys ENUM values > 16#7FFF have caused errors, because they did not get converted automatically to INT values. For this reason ENUMs always should be defined with correct INT values. Example: TYPE CAL_Day :( CAL_MONDAY, CAL_TUESDAY, CAL_WEDNESDAY, CAL_THIRSDAY, CAL_FRIDAY, CAL_SATURDAY, CAL_SUNDAY); Declaration: eToday: CAL_Day; 9.3 Identifiers for functions, function blocks, programs (POU) The names of functions, function blocks and programs consist of the library prefix (Example: CAN), an underscore and an expressive short name of the POU (Example: SendTelegram). Like with variables always the first letter of a word of the POU name should be a capital letter, the others should be small letters. It is recommended to compose the name of the POU of a verb and a substantive. Example: FUNCTION_BLOCK CAN_SendTelegram (* prefix: canst *) In the declaration part a short description of the POU should be provided as a comment. Further on all inputs and outputs should be provided with comments. In case of function blocks the associated prefix for set-up instances should follow directly after the name. Actions get no prefix; just actions which should be called only internally, i.e. by the POU itself, start with „prv_“. Each function - for the reason of compatibility with previous Codesys versions must have at least one parameter. External functions must not use structures as return values. Appendix J: - Recommendations on the naming of identifiers 10-106 Codesys V2.3

Identifiers for Visualizations Note: Currently you must avoid that visualization has the same name like another POU in the project. This would lead to problems in case of changes between visualizations.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-77

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-78

CHAPTER 10 : THE 5 PROGRAMMING LAGUAGES

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-79 10.1 Languages Codesys V3.5 supports all the languages described in the IEC 61131-3. Text based languages: Instruction List (IL) Structured Text (ST) Graphical Languages: Sequential Function Chart (SFC) Function Block Diagram (FBD) Ladder Diagram (LD) An extra programming language Continuous Function Chart (CFC), which is based on Function Block Diagram, is also available under the graphical language. 10.2 Combined program editor FBD / LD / IL 10.2.1 Programming IL In version 3.5 of Codesys the following languages are combined into one editor FBD/LD/IL Creating a “new” POU. You give the POU a name (1), which type of POU do you want to create (2), choose the language you want to use (3). In the FBD/LD/IL editor you can change the view from one language to another.

F igure 70

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-80

Changing to another view means, the system assumes that the syntax in your file is correct. In other case you can lose information. The shortcuts you can use are: Ctrl + 1 for FBD view Ctrl + 2 for the LD view Ctrl + 3 for the IL view When the POU is created you see a “double” window.

Figure 71

In the upper part of the window you declare the local variables. The application program is entered in the lower part of the screen. Entering Variables: Place the cursor in the Variable window (upper part) and press Shift + F2. The auto declare window will open.

Figure 72

Name of the variable, xA (1), Type of the variable, BOOL (2). The other possibilities of this screen will be explained in another section.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-81 Create xA as BOOL, xB as BOOL, xQ as BOOL. We are going to create the following IL program: LD xA AND xB ST xQ The combined FBD/LD/IL editor is a network oriented editor. For IL this means that the combination of a condition and an action is one network. To write the commands in one network you have to add some lines in that network. Place the cursor in the first line of the program window, the lower part.

Figure 73

Write the instruction LD xA push Enter. Entering the commands will show you an overview of possible instructions.

Figure 74

Place the curses in the column next to xA and click with the right mouse button. A menu will open. Choose „Insert IL line below. Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-82 Now you can enter the next IL line in the network. The whole IL program should look like this:

Figure 75

10.2.2 Changing the view

Figure 76

Choose „FBD/LD/IL‟ from the menu. Choose „View‟ Choose the view you want to see. Ctrl + 1 for Function block diagram Ctrl + 2 for Ladder logic Ctrl + 3 for instruction list

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-83

Ctrl + 1

Ctrl + 2

Ctrl + 3 The screen is divided into 5 columns. Each with its own content. Column

Contains...

Description

1

Operator

This field contains the IL operator (LD, ST, CAL, AND, OR etc.) or a function name. In case of a function block call here also the respective parameters are specified, in this case in the prefix field := or => must be entered.

2

Operand

This field contains exactly one operand or a jump label. If more than one operand is needed (multiple/extensible operators AND A, B, C or function calls with several parameters), those must be written into the following lines where the operator field is to be left empty. In this case add a parameter-separating comma. In case of a function block, program or action call the appropriate opening and/or closing brackets must be added.

3

Address

This field contains the address of the operand as defined in the declaration part. The field cannot be edited and can be switched on or off via Tools, options

4

Symbol comment

This field contains the comment as defined for the operand in the declaration part. The field cannot be edited and can be switched on or off via Tools, options

5

Operand comment

This field contains the comment for the current line. It is editable and can be switched on or off via Tools, options

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-84 Changing the columns shown, choose „Tools‟ and „Options‟

Figure 77

10.3 Instruction List (IL) In version 3.5 FBD/LD/ IL are combined in one editor. This means a common set of commands and elements is used and an automatic internal conversion between the three languages is done. In offline mode the programmer always can switch to one of the other editor views. Notice anyway, that there are some special elements, which cannot get converted and thus will only be displayed in the appropriate language. Also there are some constructs which cannot get converted unambiguously between IL and FBD and therefore will be "normalized" at a conversion back to FBD. These concerns: Negation of expressions and explicit/implicit output assignments. This language supports programming based on an accumulator. All IEC 61131-3 operators are supported as well as multiple inputs / multiple outputs, negations, comments, set / reset of outputs and unconditional / conditional jumps. Each instruction is primarily based on the loading of values into the accumulator by using the LD operator. After that the operation is executed with the first parameter taken out of the accumulator. The result of the operation again is available in the accumulator, from where the user should store it with the ST instruction. In order to program conditional executions or loops IL supports both comparing operators like EQ, GT, LT, GE, LE, NE and jumps. The latter can be unconditional (JMP) or conditional (JMPC / JMPCN). For conditional jumps the accumulator's value is checked on TRUE or FALSE. Syntax: An instruction list (IL) consists of a series of instructions. Each instruction begins in a new line and contains an operator and, depending on the type of operation, one or more operands separated by commas. The operator might be extended by a modifier.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-85 In a line before an instruction there can be an identification mark (label) followed by a colon (:), for example "ml:" in the example shown below. A label can be the target of a jump instruction, for example "JMPC next" in the example shown below. A comment must be placed as last element of a line. Empty lines can be inserted between instructions.

An Instruction List program comprises a series of instructions. Each instruction begins on a new line. Each instruction contains an Operator, if necessary a Modifier, and one or more Operands separated by commas. The Operator can be preceded by a Label. This Label consists of a word ending with a colon (Label:). A comment may also be present on a line as the last element, enclosed entirely between brackets and asterisks (* like this *). Empty lines between instructions are permitted. NOTE! IL is compiled line by line, and does not comply with the Boolean order of operations BNAO (Brackets, Not, And, Or). Example: Label Start: Operator LD ANDN ST

Operand %IX1 %MX5 %QX2

Comment (* Push-button *) (* Not busy *) (* Fan on *)

JMPC Next Label Next:

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-86 10.3.1 Labels An instruction may be preceded by a label terminated with a colon (:). With the JMP instruction we can jump to a label. A label may be no longer than 16 characters. The first character must be a letter. All other characters may be numerals, letters or the underline _ symbol. A label may occur only once in an IL program. However, a label may have the same name as a variable. The difference is that the label terminates with a colon. Example: Begin: LD Start AND Stop JMP Program

(*Start button*) (*Stop button*) (*Label Program*)

Program: LD %IX5 (*Clamp in*) ST %QX2 (*Clamp cylinder*) 10.3.2 Modifiers The following Modifiers may be used. Modifiers are used by adding them to operators without a space. C N ( )

conditional operation. negation of a Boolean operand, deferred operation, execution of the operation (is actually an operator),

The N modifier indicates that the next Boolean operand must be negated. ANDN %IX4 is interpreted as AND NOT Input 4. The (modifier indicates that the result of the operations must be evaluated up to the) modifier. AND (%IX5 OR %IX6) is interpreted as AND (Input 5 or Input 6) with the OR function evaluated before the AND function is executed. The C modifier indicates that the operation may only be executed when the result of the preceding part is true. LD %IX2 AND %IX7 JMPC Ready is interpreted as jump to label Ready only if the result of the AND function is True (1). If this is not the case, then the jump function is not executed.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-87 10.3.3 The IL Operators and Modifiers Operator

Modifiers

LD

N

Loads the (negated) value of the operand into the accumulator.

ST

N

Stores the (negated) content of the accumulator into the operand variable. Sets the operand (type BOOL) to TRUE when the content of the accumulator is TRUE. Sets the operand (type BOOL) to FALSE when the content of the accumulator is TRUE. Bitwise AND of the accumulator and the (negated) operand Bitwise OR of the accumulator and the (negated) operand Bitwise exclusive OR of the accumulator and the (negated) operand Bitwise negation of the accumulator's content Addition of accumulator and operand, result is copied to the accumulator. Subtraction of accumulator and operand, result is copied to the accumulator. Multiplication of accumulator and operand, result is copied to the accumulator. Division of accumulator and operand, result is copied to the accumulator. Check if accumulator is greater than or equal to the operand, result (BOOL) is copied into the accumulator; >= Check if accumulator is greater than or equal to the operand, result (BOOL) is copied into the accumulator; >= Check if accumulator is equal to the operand, result (BOOL) is copied into the accumulator; = Check if accumulator is not equal to the operand, result (BOOL) is copied into the accumulator; Check if accumulator is less than or equal to the operand, result (BOOL) is copied into the accumulator; Display in online mode: Last update: Wed Aug 28.08.02 at 16:32:45

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-163

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-164

CHAPTER 14 : ENI

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-165 14.1 ENI Source Control via ENI 14.1.1 General The objects of a Codesys project can be managed via the ENI (Engineering Interface) in an external data base. The usage of such a data base guarantees the consistency of the data, which then can be shared by several users, projects and programs. Also it extends the Codesys functionality by making possible the following items: Revision control for project objects: If an object has been checked out from the data base, modified and checked in again, then in the data base a new version of the object will be created, but the older versions will be kept also and can be called again on demand. For each object and for a whole project the version history will be logged. Two versions can be checked for differences. Multi-User Operation: The latest version of a sample of objects, for example of POUs of a project, can be made accessible for a group of users. Then the objects which are currently checked out by one of the users will be marked as "in the works" and not editable by the other users. Thus several users can work in parallel on the same project without risking overwriting versions mutually. Access by external tools: Besides the Codesys programming system also other tools, which also have an ENI, can access the common data base. Those might be for example external visualizations, ECAD systems etc., which need the data created in Codesys or which also produce data which are needed by other programs. 14.1.2 ENI (Engineering Interface) The ENI is an interface component which allows connecting the Codesys programming system to an external data base. The ENI is composed of a client and a server part. So it is possible to hold the data base on a remote computer, which is required for multi-user operation. The Codesys programming system is a client of the independent ENI Server Process as well as another application, which needs access to the data base, might be such a client. The ENI supports data base systems like for example 'Visual SourceSafe 6.0', as well as a local file system. For the currently supported data base systems as well as for detailed information on the ENI Server please see the separate ENI Server documentation. Objects can be stored in different locations of the data base. They can be checked out for editing and thereby will get locked for other users. The latest version of an object can be called from the data base. Further on in parallel you can store any objects just locally in the project as usual for projects without source control.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-166 Working with an ENI project data base 14.1.3 Preconditions: The communication between Codesys and an ENI Server requires TCP/IP, because the ENI Server uses the HTTP protocol. An ENI Server (ENI Server Suite) must be installed and started locally or on a remote computer. A license is required to run it with one of the standard database drivers which have been installed with the server. Just the driver for a local file system can be used with a non-licensed ENI Server version. in the ENI Server service control tool (ENI Control) the connection to the desired data base (see the following list item) must be configured correctly (section 'Data base'). You will automatically be asked to do this during installation, but you can modify the settings later in ENI Control. A project data base, for which an ENI-supported driver is available, must be installed. It is reasonable to do this on that computer, where also the ENI Server is running. Alternatively a local file system can be used, for which an appropriate driver is provided by default. In the data base administration possibly the user (Client) as well as the ENI Server must be registered as valid users with access rights. Anyway this is required for the 'Visual SourceSafe‟, if you use another data base system, please see the corresponding documentation for information on the user configuration. For the current Codesys project the use of the ENI must be activated and the connection to the ENI Server must be configured correctly; this by default is to be done in the Codesys dialog 'Project' 'Source Control' 'Change Source Control...'. The user must log in to the ENI Server with user name and password; this is to be done in the Login-dialog, which can be opened explicitly by the command 'Project' 'Source Control' 'Login... resp. which will be opened automatically in case you try to access the data base without having logged in to the ENI Server before. Notice that in contrast to Codesys V2.3 the user only must log in once to the ENI Server in order to work on several projects in the data base and has not explicitly to log in with each project separately. 14.1.4 Handling Codesys project objects under source control: The 'Source Control' commands (Get Latest Version, Check Out, Check In, Version History, Label Version etc.) which are used for managing the project objects in the ENI project data base, will be available in the current Codesys project as soon as the connection to the data base has been activated and configured correctly. In the beginning of this help page you find a description of the particular commands The current assignment ("binding") of an object to a data base location is shown in the Object Properties, category 'Source Control' and can be modified there. An overview on all objects locations within the data base and also the possibility of editing is given in the 'Advanced Settings' in the Change Source Control... dialog. The general settings for source control actions, for example whether always the latest version of the objects should be called from the data base before a project gets built, can be modified in the Source Control Options dialog.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-167 14.1.5 Installation, usage of ENI Server For a guide concerning installation and usage of the ENI Server provided by 3S – Smart Software Solutions GmbH please see the separate server documentation resp. online help. There you will also find a quick start guide. Also consider the possibility of using the ENI Explorer which allows to perform data base actions independently from the currently used data base system.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-168

CHAPTER 15 : USER INTERFACE

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-169 15.1 The main window

Figure 104

This basic screen lay-out can be cosumised. When you place he cursor on the “message” window bar, click and hold the left mouse button pushed. Move it around and then you get some possibilleties to “adjust the location” of the message window. You can rearange alle the windows on the screen. 15.2 Pull down menu‟s 15.2.1 File

Figure 105

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-170 15.2.2 Edit

Figure 106

15.2.3 View

Figure 107

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-171 15.2.4 Project

15.2.5 Build

Figure 108

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-172 15.2.6 Online

Figure 109

15.2.7 Debug

Figure 110

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-173 15.2.8 Tools

Figure 111

15.2.9 Windows

Figure 112

15.2.10 Help

Figure 113

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-174 15.3 Device/POU

Figure 114

15.3.1 POU Do not get puzzled with the term "POU": It is basically used for all objects which are used to create a PLC program. POU = Program Organization Unit. POUs which are managed in the POUs view are not device-specific but they might be instantiated for the use on a device (application). For this purpose program POUs must be called by a task of the respective application. POUs, which are ONLY managed in the Device view, i.e. which are inserted in the device tree explicitly below an application, can only be instantiated by applications indented below this application ("child" application). For further information see the descriptions of the device tree and of the “Application” object. BUT "POU" also is the name of a certain sub category of these objects in the “Add Object” menu, at this place just comprising programs, function blocks and functions So, a Program Organization Unit object in general is a programming unit, an object which is managed either non-device-specifically in the "POUs" window or devicespecifically in the "Devices" window and can be viewed and edited in an editor window. A POU object can be a program, function, function block as well as a method, action, interface, DUT (Data Unit Type) or an external file of any format. Regard the possibility to set certain properties (like e.g. build conditions etc.) for each particular POU object. . In order to add a programming object to the project use command “Add Object. 15.3.2 Device, Device tree In the Devices window ("device tree") you can map the hardware on which the application is to run. Each device object represents a specific (target) hardware object. Examples: controller, field bus node, bus coupler, drive, I/O-module, monitor. Each device is defined by a device description and must be installed on the local system in order to be available for inserting in the devices tree. The device description file defines the properties of a device concerning configurability, programmability and possible connections to other devices. However not only device objects are managed in the device tree, but all objects which are needed to run an “Application” on a device (controller, PLC); thus also the "Application" objects as well as "Task Configuration" and "Task" objects. But also pure programming objects like particular POUs, Global Variable lists and Library Manager can - instead of being managed as project-globally insatiable units in the POUs window - be managed ONLY in the device tree and in this case are only available for exactly "their" application or "child applications" of their application.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-175 Regard the possibility to run the active application on a "simulation device" which is per default automatically available within the programming system (currently available for the Codesys Control Win V3 target. So no real target device is needed to test the online behaviour of an application. When you switch to simulation mode, the Codesys Control Win V3 entry in the device tree will be displayed in italic letters and you can login with the application. Regard also the possibility to connect to the device in "online configuration mode" without the need of first having loaded a real application there. This is useful for the initial start-up of an I/O system, because you can access and test the I/O's in the PLC configuration before you build and load a real application program. 15.3.3 Generals The root node of the tree always is a symbolic node entry: . The trees of the "PLC Configuration" and "Task Configuration", which in Codesys V2.3 are completely handled in separate windows, are integrated in the devices tree. The PLC configuration is defined by the topological arrangement of the devices in the device tree. Just the configuration of the particular device resp. task parameters is done in corresponding editor dialogs. Thus the hardware structure will be mapped and represented within the devices tree by the corresponding arrangement of device objects, allowing to set up a complex heterogeneous system of multiple networked controllers and underlying field busses.

Figure 115

1. 2. 3. 4. 5.

this is the controller you use the application you are creating global variable list you have created the POU you have created The visualisation screen you have created

Creating a POU automatically will generate a Task Configuration. Creating further POU‟s you need to enter them in the task configuration. Creating a visualisation screen, automatically the visualisation manager is created. 15.3.4 Boot project Boot application (boot project) Currently: At each successful download automatically the active application will be stored in a file "application.app" in the target system folder, thus available as boot Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-176 application. Command 'Create boot application' allows also in offline mode to save the boot application to a file. Note: When you don’t create different folders for your projects, this “application.app” is created in your “common” project folder. That means, every time you create a “boot project” from a project the system will ask you for a name. When you just click on “safe”, the system will ask you if you want to create the file with the same name. “OK” will create the new “application.app” and the previous one is destroyed. A boot application is the project which will be started automatically when the controller gets started ("booted"). For this purpose the project must be available on the PLC in a file .app. This file can be created in offline or online mode by command “Create boot application” (command category 'Online'). This command (category Online) is available in online or offline mode for creating a boot project, also named "boot application". The boot application serves the purpose to provide an application on the PLC, which will be loaded automatically when the PLC gets started. Note: For testing purposes you can create a “test” project and download this into the controller. After you have finished your tests, you switch off and on the controller. Automatically your “test” project will be deleted and the original “boot” project will be started.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-177 15.3.5 Password CAUTION! The user passwords are stored irreversibly. If a password gets lost, the respective user account gets unusable. If the "Owner“-password gets lost, the entire project might get unusable! !

Security Project: The access control for projects, particular objects resp. the right to perform certain actions in a project can be configured and managed via dialogs of the Project Settings and object Properties. A project basically can be protected by an encrypted password, see “Project Settings, Security”. Access rights concerning objects always are assigned to particular user groups, not to single users. For each object a list of allowed actions can be defined for each user group. Each particular user however can get an own password. See help pages to “User and Access Rights Management” for more information. PLC: Depending on the device there might be also an access control concerning objects and files on the PLC. See help page “Users and Groups” for the respective user and access rights management possibilities in the device configuration editor.

Figure 116

In “Project” “Project Settings” it is possible to activate the password protection for your project.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-178 In users and groups you can create a new group of users and give them their own password to access the system

Figure 117

In this screen you can add users.

Figure 118

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-179 Account properties: Login name: Log-on name for the new user. Full name: Complete name of the new user. Just to give additional information. Description: Description on the new user. Just to give additional information. Old Password: This field is only editable, when the dialog is used for modifying an existing user account ("Edit User", see below). Before you can modify the password of an existing user, you must enter the currently valid password. Password: Password for the new user. The entry is masked by * characters. Confirm password: The entry made in field 'Password' must be repeated here and you will get an error message if the two entries do not match. Also here the entry is masked by * characters Active: If this option is activated the user account is valid. If the account is not valid, the user cannot log-on. An account might be deactivated automatically if repeatedly a log-on has been tried with incorrect authentication entries. Memberships: In this list all currently existing user groups are listed, beside group "Everyone", to which the new user belongs automatically. By selecting the respective entries ( ) you can define to which groups the new user should belong. To set up the new user close the dialog with OK. If there are incorrect entries (no login name, password mismatch, user already existing) you will get an appropriate error message Modify an existing user account: Use button Edit to open the Edit User dialog. The entry fields are the same as in the Add User dialog (see above). The password fields however - for safety reasons - will show 32 * characters. After having modified the desired entries close the dialog with OK to get applied the new settings. Remove one or several user accounts: Select the respective users in the Users list and use button Remove. Note that you will get no further inquiry! An appropriate error message will appear if you try to delete all users from the group. At least one must remain.

Figure 119

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-180 Group properties: name: Name for the new group. Description: Description on the new group. Just to give additional information. Members: List of all currently available users and groups. Select those ones ( ) which should be members of the current group. To set up the new group close the dialog with OK. If there are incorrect entries (no name defined, group already existing, in Members having selected a group which would cause a "group cycle", you will get an appropriate error message. Modify an existing group: Use button Edit to open the Edit Group dialog. The entry fields are the same as in the 'Add Group' dialog (see above). After having modified the desired entries close the dialog with OK to get applied the new settings. Remove one or several groups: Select the respective entries in the group‟s tree and use button Remove. Note that you will get no further inquiry! The members of the deleted groups will remain unmodified. An appropriate error message will appear if you try to delete the groups "Everyone" and/or "Owner".

Figure 120

Maximum number of authentication trials: If activated, the user account will be set invalid after the specified number of trials to log in with a wrong password. If not activated, the number of erroneous trials is unlimited. Default: option activated, number of trials: 3; permissible values: 1-10. Automatically log out after time of inactivity: If activated, the user account will be logged out automatically after the specified number of minutes of inactivity (no user actions via mouse or keyboard registered in the programming system). Default: option activated, time: 10 minutes; permissible time values: 1-180 minutes)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-181

Figure 121

Figure 122

In this screen all the permissions can be set. Be very care full using password protection. A forgotten password can‟t be restored in any way. Your project is lost!

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-182

CHAPTER 16 : LIBRARY MANAGER

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-183 16.1 Libraries Libraries can provide functions and function blocks as well as data types, global variables and even visualizations which can be used in the project just like the other POUs and variables which are defined directly within the project. The default extension for a library file is ".library*, in contrast to ".lib" used for the files in Codesys V2.3 and earlier versions. . Encrypted libraries have the extension *.compiled-library. The management of the libraries in a project is done in the Library Manager, the preceding installation on the system in the Library Repository dialog. The project functions for local and global search and replace also work for included libraries. 16.2 Installation and including in project Libraries can be managed on the local system in one or various repositories (folders, locations). A library cannot be included in a project before it has got installed in a repository on the local system. The installation is to be done in the “Library Repository Dialog” in Codesys. As a precondition for installation, a library must have got assigned a title, version info and a company name in its “Project Information”. Optionally a category can be defined which might serve later for sorting in the Library Manager. If no category assignment is defined in the Project Information, the library automatically will belong to category "Miscellaneous". Further categories might be defined in one or several xml-files *.libcat.xml which can be loaded in the Project Information dialog in order to select one of the categories. Please see also below, “Creating V3 libraries, Encoding, Documentation, Release ”. The “Library Manager” is used to include libraries in a project. In a "standard project" a Library Manager object by default is automatically assigned to the default device. However a Library Manager object can also be added explicitly in the “device tree” (below a device or an application) or “POU‟s” window view. This is to be done like for other objects with the “Add Object” dialog. Libraries referenced in other libraries by default are also displayed in the Library Manager, however also "hidden" libraries are possible, see below “Referenced Libraries, When creating...", 2... If the '.library*' file is available (and not only its compiled version '*.compiledlibrary'), the POUs of the related library may be opened by a double click on their referencing within the library manager. If a library module is called by an application, all libraries and repositories will be searched in that order which is defined in the Library Repository dialog. See below for “unique accessing”. 16.3 Codesys V2.3 libraries Libraries created with Codesys V2.3 (*.lib) and earlier versions are supported further on: An "old" library project (*.lib) can be opened in Codesys V3 and thereby directly converted to a "V3 library" (*.library). If you open an old project, referencing old libraries, you can choose, whether these references should be kept, replaced by others or removed. If they should be kept, the Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-184 respective libraries will be converted to the new format and automatically be installed to the System Library Repository. If they do not contain the necessary “Project Information”, those can be immediately added. The scheme, according to which a particular old library has been handled once when converting an old project, can be saved in the project options. Thus, if the same library appears again when converting an old “Open Project...” project, its handling must not repeatedly be defined but will be done automatically. See help page for a description on how to proceed when opening and converting projects and libraries. In the help file of Codesys V3 you find extensive information about handling libraries

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-185

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-186

CHAPTER 17 : TRACE

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-187 17.1 Trace configuration Sampling Trace is a tool that enables the status of various variables to be recorded during a running project. It is located under the “Application”. The status and value of the specified variables is written into a ring buffer. The size and the way this ring buffer behaves can be configured in the Trace editor advanced settings. When the object Trace is activated, the Trace should be given a name. When the Trace has a name confirm with Open. Below “Application” the trace object will be visible. In this sample we have used the name “Trace_Input”

Figure 123

Figure 124

With “add variable”, top right of the trace input window, we open the Trace configurator.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-188

Figure 125

Click on the dotted line (1), the input assistant will open. Now you can make a choice which variable you want to trace. You can change the colour, line type, point type, minimum and maximum value. To change the record settings of the trace, double click on the trace name, in our case ´Trace_Input”

Figure 126

In this window you can configure the variable which is triggering the trace record. You also define the task name for this trace object.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-189 Before you can use this trace object you have to download it to the controller. For an extensive description of this function look into the help file of Codesys V3.x

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-190

CHAPTER 18 : INSTALLING ADDITIONAL CONTROLLERS

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-191 18.1 Installing an additional controller You can add the target library of a controller trough “tools”, “Options”, “Libraries” Installing of devices on the local system Installation and uninstalling of devices can be done under “Tools” in the “Device Repository... ” dialog. The installation bases on device description files in xml-format. The default extension for a valid device description file is *.devdesc.xml. However also busspecific description files like *.gsd-files (Profibus), *.eds-files (CANbus, ASi) etc. can be installed via the Device Repository dialog. The specific Codesys V3 configuration files *.cfg can be used if an appropriate additional info-file *.info.cfg, describing the respective set of configuration files, is provided. When you choose Device Repository the following window will open.

Figure 127

Figure 128

Click on Install and choose the location where your “new” device information is located and install it. Location: Device repositories can be available on multiple locations on the system. The selection list offers the currently available locations. By default with the Codesys installation at least the "System Repository" is provided. Installed device descriptions: The currently installed devices are listed in a tree structure, each showing the Name, Vendor and Version of the device. The devices tree may be structured by categories like for example "PLCs" and "Miscellaneous"

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-192 (see above, picture of Device Repository dialog). If applicable open or close the tree entries via the plus- and minus-"buttons". Install...: Use this button to get a device installed for being available in the programming system. The dialog Install Device Description will open where you can browse your system for the respective device description. For the standard devices the file filter is to be set to "*.devdesc.xml". But also description files provided by the manufacturer, like for example *.gsd-files for Profibus DP modules, *.eds- and dcf-files for CAN devices, can be selected by setting the respective filter. As soon as you confirm the selection with OK, the dialog will close and the new device will be added to the devices tree in the 'Device Repository' dialog. CAUTION! The internal device repository must never be altered manually. Do not copy files to or from there! Always use the Device Repository dialog to reinstall, add or remove devices

Uninstall: This command will remove, that is “uninstall” the currently selected device. It will be removed from the device repository and not be available for use in the programming system any longer. The current list of installed devices will be offered when you are going to add a device object via “Add Device-“ or “Add Object” dialog in the “Device tree”. Install DTM...: This command scan the Windows registry for any DTM and display the results in a list for the user to select the DTMs to be added to the repository. This dialog provides a list of the DTMs with information about Name, Version, Vendor and DTM Program ID.To install the DTMs to the device repository select the desired DTM and press OK. General Information about FDT and DTM The FDT technology (FDT = Field Device Tool) is a specification which standardises the communication interface between field devices and the control system. The FDT container program, which is implemented in Codesys, serves as frame application for the so-called DTM (= Device Type Manager). These DTMs are provided by the manufacturers of the fieldbus devices and components and provide functions to call device parameters, to configure and operate devices and to locate errors. DTMs also supply a Graphical User Interface for setting device parameters. DTMs are classified into three categories

  

Device DTMs which connect to the field device configuration components Communication DTMs which connect to the software communication components. Gateway DTMs to support the communication between devices and controller when different field busses are connected to each other.

DTM implementation in Codesys Codesys Version V3.4 supports implementation of DTMs for CanOpen Devices. DTM integration for Profibus will be available soon.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-193 Renew Device Repository: If new versions of import plugins are available some device plugins may be outdated. The affected devices will be marked with a yellow sign. By use of the 'Renew device repository' function all devices in the device repository will be updated. A dialog will ask to confirm if you want to continue.

Figure 129

Figure 129: modules with outdated device descriptions Details...: This button opens a dialog for the currently selected device showing additional information as given by the device description file: Device name, Vendor name, Categories, Type, ID, Version, Order Number, and Description.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-194

CHAPTER 19 : DOCUMENTATION

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-195 19.1 Documenting a project In the main menu, Project -> Document opens a window in which you can specify what you wish to have printed.

Figure 130

In document project you can make your choice what you want to pint. 19.2 Project info Under menu Project -> Project info, you can enter details about your project.

Figure 131

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-196 19.3 Project statistics The button Statistics gives information about your project. The basic information you have entered under Project info is also displayed here.

19.4 Printer setup Under menu File -> Page Setup a dialogue opens that allows you to define a frame for around your page.

19.5 Printing Under menu File -> Print, only the active file is printed. 19.6 Additional project documentation Should you wish to create additional documentation about your project, you can use one of the following editors supplied as standard in Windows.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-197 Of course, you can also use Office Word for an additional description of the project. An alternative is to create a POU to contain only text, so that you can store additional information. The advantage of this is that it is an integral part of the project. Start with a; (* skip a few lines and close with *) Go to the POUs tab, select the “POU Text” and click with your right mouse button. Select the option “Properties” In de window choose Build and choose Exclude from build.

Figure 132

In this case your “POU Text” is a part of your project but is not consuming any CPU time.

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-198

CHAPTER 20 : GLOSSARY

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-199 1 % < >= >1 A ABS

XOR Special symbol for directly assigned variables Less than Less than or equal Not equal to Is equal to Greater than Greater than or equal to OR

Access path

The path we have to follow to be able to use "something". Arc cosine Processing part of a step Component that can be controlled by the controller, digital or analogue. Add

ACOS Action Actor ADD Administrator rights AND ASIN ATAN B B (Byte;) Base number BCD Binary Bi-stable Bit Bool Boolean Byte C CAL CFC CLK Code Codesys Codesys SP RTE Complement CONCAT Constant Convergence

Absolute value of a number, the – sign is ignored

Rights on the PC to install software AND Arc sine Arc tangent Group of 8 bits The number of elements that make up a certain number system. Binary Code Decimal (1, 2, 4, 8 code) Number system based on 2 (0 ..1) Having two stable states 1 bit of a word or byte Boolean variable is 1 or 0 (true or false) Boolean variable is 1 or 0 (true or false) 8 bits Call of function or function block Like FBD but without fixed order of operations from left to right or from top down Clock Program code Controller Development System Runtime system (Soft PLC for on the PC) The reverse of (Inverter, Negation) Concatenate, join Variable has a constant (fixed) value Coming together Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-200 COS CTD CTU Cyclic D D (Double) Data Types Declaration DIV Divergence DWORD E Enumeration EQ ET EXOR EXP EXPT F False Fatal_error FBD G GE Global Global Variables GT H Hexadecimal HMI Human Machine Interface (HMI)

Cosine Count down )decrement) Count up (increment) Repeated continuously, in a certain rhythm Group of 32 bits or 4 bytes Operands Assignment of a name and type to an operand Divide Splitting 32 Bits User-defined data type comprising string constants Is equal to Elapsed time See XOR Exponential value Exponent (raise to the power of) Boolean false (0), this is not the same as a 0 in a variable. Non-recoverable error in the system Function Block Diagram (IEC61131-3 programming language) Greater than or equal to Accessible from various places variables that can be used in all POUs Greater than

Number system with base number 16 (0..9..A..F) Human Machine Interface (Visualization) Screen and keyboard, used to display information to, and obtain information from, the user

I

I (Input) IEC 61131-3 IL Initialization Initialization value Instances INT

Input Standard that defines the 5 Programming languages Instruction List (IEC61131-3 programming language) Initial setting Default value after initialization Copies Integer number (12) can also be negative

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-201 Integer J JMP K Character code Cold start L L (Long) Label LD LE Libraries LN Local

Whole number with or without a + or - sign Jump instruction to label Control codes for a screen or printer Power up, start programs Group of 64 bits or 8 bytes Named place to jump to Ladder diagram (IEC61131-3 programming language) Less than or equal

LOG

Libraries of available functions Natural logarithm Only available locally within this function, function block or program. Variables that can only be used in the POU in which they are declared 10-based logarithm

LT

Less than

LWORD M M (Memory) Multi-bit variable Mod

64 Bits

Local Variables

Mono-stable

Memory also referred to as flag Word or Byte Modulo is the remainder of an integer division 17/5 = 3 with remainder 2. Mod is therefore 2 Indicates that processing is influenced by an extra parameter, for example the letter N of NOT) Has just one stable state (springs back)

MOVE

Conditional variable assignment

MUL N NC NE Negation NOT NO NOT O O (Output) Octal OR Operand

Multiply

Modifier

Normally closed contact Not equal to The reverse of (Inverter) NOT (negation or inverter) Normally open contact NOT (negation or inverter) Output Number system based on 8 (0 ..7) OR Generic name for variables used in a controller. (can also be a bit) Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-202 Operator OR P PLC_PRG POU Persistent Pre-emptive multitasking Project

Operation on a Operand OR

Program automatically activated at start-up Program organization unit (can be considered a "partial" program)) Buffered, after a download. The value is erased by a cold or warm reset This is a multitasking system in which running tasks can be interrupted by events in a planner. Collection of data that together forms the project

Q

Quad word R R REAL Recursive Registration Resources RET Retentive

Retain RTC

Runtime system S S Sensor

4 x a 16-bit word

Reset (make logical 0) Real number (Number containing a decimal point). Always a dot (never a comma) in Codesys! Self-calling Registration as user, login name and password come back Components and functions available for use in a project Return from called function or function block Buffered, the value is retained even after a program stops. On re-start of the program, the buffered value is available for further processing. See retentive Real Time Clock

Operating system on the target system

SIN

Set (make logical 1) Component that supplies information to the controller, digital or analogue. Sequential Function Chart (IEC61131-3 programming language) Sine

SQRT

Square root

ST String

Structured Text (IEC61131-3 programming language) Collection of symbols (letters and/or numbers)

SFC

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-203 SUB Subroutine T TAN

Subtract Sub-program that can be called from various points.

TOF TON TP Transition Triggered

Delayed turn-off Delayed turn-on Pulse timer Condition applying to a step Initiated by an event, e.g. an input signal, an interrupt, etc. Boolean true (1), this is not the same as a 1 in a variable. Round down to a whole number

True TRUNC

Tangent

U UINT V Variable

Integer number (14), that cannot be negative Operand that can have a value between a minimum and a maximum depending on the type

W W (Word)

Group of 16 bits or 2 bytes

Warm start

Power stays on, programs are started or stopped with the aid of instructions. 16 bit

Word X X XOR 1 %

Used to signify a single bit XOR (exclusive OR) The output is only 1 when one of the inputs is 1. XOR Special symbol for directly assigned variables

<

Less than

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-204

CHAPTER 21 : SHORTCUTS

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-205 The predefined keys can be changed/enhanced trough “Tools” – “Customize”.

Figure 133

The predefined keys; Ins Del F1 F2 F3 F4 F5 F6 F7 F8 F9 F10 F11 F12

Overwrite Mode (Text Editor); Insert Declaration) Delete (Clipboard Input Assistant ... (Smart coding) Find Next (Find/Replace) Next Message (Message View) Start [active application] (Online) Next Pane (Window) Force value [active application] (Online) Step Into (Breakpoints) Toggle Breakpoint (Breakpoints) Step Over (Breakpoints) Build (Build) Next Bookmark (Bookmarks)

Shift+Ins Shift+Del Shift+F1 Shift+F2 Shift+F3 Shift+F4 Shift+F5 Shift+F6 Shift+F7 Shift+F8 Shift+F9 Shift+F10 Shift+F11 Shift+F12

Paste (Clipboard) Cut (Clipboard) Auto Declare…(Smart Coding) Find Previous (Find/Replace) Previous Message (Message View) Previous Pane (Window) Stop [active application] (Online) Step Out (Breakpoints) Previous Bookmark (Bookmarks)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-206 Ctrl+Ins Ctrl+Del Ctrl+0 Ctrl+1 Ctrl+2 Ctrl+3 Ctrl+4 Ctrl+5 Ctrl+6 Ctrl+7 Ctrl+8 Ctrl+9

Copy (Clipboard) Delete IL line (FBD/LD/IL)

Ctrl+A (FBD/LD/IL) Ctrl+B Ctrl+C Ctrl+D Ctrl+E Ctrl+F Ctrl+G Ctrl+H Ctrl+I Ctrl+J Ctrl+K Ctrl+L Ctrl+M Ctrl+N Ctrl+O Ctrl+P Ctrl+Q Ctrl+R Ctrl+S Ctrl+T Ctrl+U Ctrl+V Ctrl+W Ctrl+X Ctrl+Y Ctrl+Z

Select All (Clipboard); Insert Assignment (FBD/LD/IL); Insert Coil

Ctrl+F1 Ctrl+F2 Ctrl+F3 Ctrl+F4 Ctrl+F5 Ctrl+F6 Ctrl+F7 Ctrl+F8 Ctrl+F9 Ctrl+F10 Ctrl+F11 Ctrl+F12

View as function block diagram (FBD/LD/IL) View as ladder logic (FBD/LD/IL) View as instruction list (FBD/LD/IL)

Insert Box (FBD/LD/IL) Copy (Clipboard) Insert Contact (right) (FBD/LD/IL) Edge Detection (FBD/LD/IL) Find (Find/Replace); Paste below (FBD/LD/IL) Paste right (after) (FBD/LD/IL) Replace (Find/Replace); Paste above (FBD/LD/IL) Insert Network (FBD/LD/IL) Insert Contact (FBD/LD/IL) Insert Jump (FBD/LD/IL) Set/Reset (FBD/LD/IL) New Project…(File); Negation (FBD/LD/IL) Open Project…(File); Toggle network comment state (FBD/LD/IL) Insert Contact Parallel (FBD/LD/IL) Insert Input (FBD/LD/IL) Insert Contact Parallel (below) (FBD/LD/IL) Safe Project (File) Insert Network (below) (FBD/LD/IL) Make Lowercase (Text Editor); Update parameters (FBD/LD/IL) Paste (Clipboard) Set Output Connection (FBD/LD/IL) Cut (Clipboard) Redo (Undo/Redo) Undo (Undo/Redo)

Find Next (Selected) (Find/Replace) Close Editor (Window) Single Cycle (Online) Next Editor (Window) Write values [active application] (online) Logout [active application] (Online)

Toggle Bookmark (Bookmarks)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-207

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-208 Shft+Ctrl+0 Shft+Ctrl+1 Shft+Ctrl+2 Shft+Ctrl+3 Shft+Ctrl+4 Shft+Ctrl+5 Shft+Ctrl+6 Shft+Ctrl+7 Shft+Ctrl+8 Shft+Ctrl+9 Ctrl+Shft+A Ctrl+Shft+B Ctrl+Shft+C Ctrl+Shft+D Ctrl+Shft+E Ctrl+Shft+F Ctrl+Shft+G Ctrl+Shft+H Ctrl+Shft+I Ctrl+Shft+J Ctrl+Shft+K Ctrl+Shft+L Ctrl+Shft+M Ctrl+Shft+N Ctrl+Shft+O Ctrl+Shft+P Ctrl+Shft+Q Ctrl+Shft+R Ctrl+Shft+S Ctrl+Shft+T Ctrl+Shft+U Ctrl+Shft+V Ctrl+Shft+W Ctrl+Shft+X Ctrl+Shft+Y Ctrl+Shft+Z Ctrl+Shft+F1 Ctrl+Shft+F2 Ctrl+Shft+F3 Ctrl+Shft+F4 Ctrl+Shft+F5 Ctrl+Shft+F6 Ctrl+Shft+F7 Ctrl+Shft+F8 Ctrl+Shft+F9 Ctrl+Shft+F10 Ctrl+Shft+F11 Ctrl+Shft+F12

Insert Empty Box (FBD/LD/IL)

Insert Box with EN/ENO (FBD/LD/IL)

Make Uppercase (Text Editor) Insert Brach (FBD/LD/IL)

Contents (Help) Index (Help) Find Previous (Selected) (Find/Replace)

Previous Editor (Window)

Full Screen (View)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

A-209 Alt+Vorige Alt+Left Alt+Up Alt+Right Alt+Down Alt+0 Alt+1 Alt+2 Alt+3 Alt+4 Alt+5 Alt+6 Alt+7 Alt+8 Alt+9 Alt+F1 Alt+F2 Alt+F3 Alt+F4 Alt+F5 Alt+F6 Alt+F7 Alt+F8 Alt+F9 Alt+F10 Alt+F11 Alt+F12

POUs (View) Devices (View) Messages (View)

Exit (File) Interface Editor (Visual Commands) Unforce values [active application] (Online) Login [active application] (Online)

Codesys for Industry V3.5 [version 1.3] ۰Festo Didactic

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF