beckhoff · TwinCAT 3 TE1000 · 1262 pp.
Beckhoff TwinCAT 3 TE1000 PLC — Operation manual
Руководство по TwinCAT 3 PLC (TE1000): создание, программирование, отладка и загрузка PLC-проектов, работа с библиотеками, рецептами и Online Change.
Related manuals
Contents
Document text
Table of contents
Table of contents Table of contents 1 Foreword.................................................................................................................................................. 25 1.1 Notes on the documentation ........................................................................................................... 25 1.2 For your safety ................................................................................................................................ 26 1.3 Notes on information security..........................................................................................................
27 2 Quickstart ................................................................................................................................................ 28 2.1 Differences compared with TwinCAT 2........................................................................................... 29 2.2 Your first TwinCAT 3 PLC project ................................................................................................... 30 3 Tips and tricks.........................................................................................................................................
44 3.1 Project delivery................................................................................................................................ 44 3.2 New properties and features ........................................................................................................... 48 3.2.1 TwinCAT 3.1 Build 4024 .................................................................................................. 48 3.2.2 TwinCAT 3.1 Build 4026 .................................................................................................. 52 3.3 Further helpful properties and features ...........................................................................................
54 3.4 Renaming a project ......................................................................................................................... 58 3.3.1 Hotkey.............................................................................................................................. 57 4 Creating and configuring a PLC project ............................................................................................... 60 4.1 Creating a standard project.............................................................................................................
60 4.2 Adding objects................................................................................................................................. 61 4.3 Changing the compiler version........................................................................................................ 62 4.4 Open a TwinCAT 3 PLC project...................................................................................................... 63 4.5 Open a TwinCAT 2 PLC project......................................................................................................
63 4.6 Configuring a PLC project ............................................................................................................... 67 4.7 Using global data types................................................................................................................... 68 5 Exporting and transferring a PLC project............................................................................................. 69 5.1 Exporting and importing a PLC project ...........................................................................................
69 5.2 Transferring a PLC project .............................................................................................................. 70 6 Localizing the PLC project ..................................................................................................................... 71 7 Programming a PLC project................................................................................................................... 73 7.1 Assigning identifiers ........................................................................................................................
73 7.2 Declaring variables.......................................................................................................................... 73 7.2.1 AT-Declaration ................................................................................................................. 76 7.2.2 Using the Declaration Editor ............................................................................................ 77 7.2.3 Using the Auto Declare dialog.......................................................................................... 78 7.2.4 Declaring an array............................................................................................................
78 7.2.5 Declaring global variables ............................................................................................... 79 7.3 Creating user-specific data types ................................................................................................... 82 7.3.1 Object DUT ...................................................................................................................... 82 7.4 Creating programming objects ........................................................................................................ 85 7.4.1 Object POU......................................................................................................................
85 7.4.2 Object Action.................................................................................................................... 94 7.4.3 Object Transition.............................................................................................................. 95 7.4.4 Object Method.................................................................................................................. 97 7.4.5 Object Property .............................................................................................................. 104 TE1000 3 Version: 3.7.2
Table of contents
Table of contents 7.4.6 Object Interface.............................................................................................................. 109 7.5 Creating source code in IEC ......................................................................................................... 115 7.5.1 FBD/LD/IL ...................................................................................................................... 115 7.5.2 Continuous Function Chart (CFC).................................................................................. 120 7.5.3 Structured Text (ST), Extended Structured Text (ExST)................................................
130 7.5.4 Sequential Function Chart (SFC)................................................................................... 131 7.5.5 Ladder Diagram (LD) ..................................................................................................... 135 7.6 Creating a referenced task............................................................................................................ 138 7.7 Creating a class diagram .............................................................................................................. 140 7.6.1 Object Referenced Task ................................................................................................
138 7.8 Configuring the memory reserve for Online Change..................................................................... 140 7.9 Calling a function block, function or method with external implementation................................... 141 7.10 Using the input wizard................................................................................................................... 141 7.11 Using pragmas .............................................................................................................................. 144 7.12 Managing text in a text list.............................................................................................................
145 7.12.1 Managing Static Text in Global Text Lists...................................................................... 149 7.12.2 Managing Dynamic Text in a Text List........................................................................... 151 7.13 Using image pools......................................................................................................................... 153 7.13.1 Object Image Pool.......................................................................................................... 153 7.13.2 Creating an Image Pool .................................................................................................
154 7.14 Checking the syntax and analyzing the code................................................................................ 155 7.14.1 Checking Syntax ............................................................................................................ 155 7.14.2 Code analysis (Static Analysis Light)............................................................................. 155 7.15 Orientation and navigation ............................................................................................................ 164 7.15.1 Using the Cross Reference List to find Occurrences .....................................................
164 7.15.2 Finding Declarations ...................................................................................................... 164 7.15.3 Set and use bookmarks ................................................................................................. 165 7.16 Find and Replace in the entire project .......................................................................................... 166 7.17 Refactoring....................................................................................................................................
167 7.18 Data persistence ........................................................................................................................... 170 7.19 Using function blocks for implicit checks....................................................................................... 170 7.19.1 Object POUs for implicit checks..................................................................................... 171 7.20 Object-oriented programming ....................................................................................................... 180 7.20.1 Object Function block.....................................................................................................
182 7.20.2 Object Method................................................................................................................ 184 7.20.3 Object Property .............................................................................................................. 191 7.20.4 Object Interface.............................................................................................................. 196 7.20.5 Extending a function block ............................................................................................. 202 7.20.6 Extending a structure .....................................................................................................
208 7.20.7 Extending interfaces....................................................................................................... 208 7.20.8 Implementation of an interface....................................................................................... 209 7.20.9 Method call..................................................................................................................... 210 7.20.10 ABSTRACT concept ...................................................................................................... 212 7.20.11 Samples .........................................................................................................................
213 8 Transfer PLC project to the PLC.......................................................................................................... 220 8.1 Generating program code ............................................................................................................. 220 TE1000 4 Version: 3.7.2
Table of contents
Table of contents 8.2 Loading program code, logging in and starting the PLC ............................................................... 220 8.3 Loading the program automatically ............................................................................................... 221 9 Testing a PLC project and troubleshooting........................................................................................ 222 9.1 Use of breakpoints ........................................................................................................................ 222 9.2 Stepwise processing of the program (stepping)............................................................................
224 9.3 Forcing and Writing Variables Values ........................................................................................... 225 9.4 Resetting the PLC project ............................................................................................................. 229 9.5 Flow Control .................................................................................................................................. 230 9.6 Determining the Current Processing Position with the Call Stack.................................................
232 10 PLC project at runtime.......................................................................................................................... 233 10.1 Monitoring Values ......................................................................................................................... 233 10.1.1 Monitoring in Programming Objects............................................................................... 233 10.1.2 Using Watchlists.............................................................................................................
237 10.2 Changing Values with Recipes ..................................................................................................... 239 10.2.1 Object Recipe Manager ................................................................................................. 239 10.2.2 Object Recipe Definition................................................................................................. 243 10.2.3 Using recipes ................................................................................................................. 244 10.2.4 Library Recipe Management - RecipeManCommands ..................................................
246 10.3 Error analysis with core dump....................................................................................................... 258 10.3.1 Creating and loading a core dump................................................................................. 258 10.3.2 Storage path for automatic creation............................................................................... 263 10.3.3 Archiving ........................................................................................................................ 264 10.4 PLC operation control ...................................................................................................................
264 11 Updating the PLC project on the PLC ................................................................................................. 265 11.1 Performing an Online Change....................................................................................................... 266 11.2 Execution of a Download .............................................................................................................. 268 12 Using a stand-alone PLC project.........................................................................................................
270 12.1 Creating a stand-alone PLC Project.............................................................................................. 270 12.2 Integrating the stand-alone PLC project into a TwinCAT project .................................................. 271 12.2.1 Creating a TMC file and adding it to the TwinCAT project............................................. 271 12.2.2 Assigning a task............................................................................................................. 274 12.3 Best practice .................................................................................................................................
276 12.2.3 Loading program code, logging in and starting the PLC................................................ 275 12.4 FAQ............................................................................................................................................... 280 13 Using libraries ....................................................................................................................................... 281 13.1 Recommendations and notes .......................................................................................................
283 13.2 Library creation ............................................................................................................................. 284 13.2.1 Command Save as library.............................................................................................. 285 13.2.2 Command Save as library and install............................................................................. 286 13.3 Library installation ......................................................................................................................... 287 13.3.1 Library Repository..........................................................................................................
287 13.4 Library management ..................................................................................................................... 290 13.5 Library placeholders...................................................................................................................... 295 13.4.1 Library Manager............................................................................................................. 291 13.5.1 Placeholder .................................................................................................................... 296 TE1000 5 Version: 3.7.2
Table of contents
Table of contents 13.5.2 Changing the placeholder resolution.............................................................................. 297 13.6 Library documentation................................................................................................................... 298 13.6.1 Basics............................................................................................................................. 299 13.6.2 Extended – reStructuredText ......................................................................................... 305 13.7 Use PLC project as referenced library ..........................................................................................
377 13.7.1 Change to library command........................................................................................... 378 13.7.2 Change to library and install command.......................................................................... 378 13.7.3 Change to project reference command.......................................................................... 378 13.8 Other commands and dialogs ....................................................................................................... 378 13.8.1 Command Add library ....................................................................................................
378 13.8.2 Add library without placeholder resolution command..................................................... 379 13.8.3 Command Try reload library........................................................................................... 380 13.8.4 Command Delete library ................................................................................................ 381 13.8.5 Command Details........................................................................................................... 381 13.8.6 Command Dependencies...............................................................................................
382 13.8.7 Command Properties ..................................................................................................... 382 13.8.8 Command Set to Effective Version ................................................................................ 384 13.8.9 Command Set to Always Newest Version...................................................................... 385 13.8.10 Dialog Library parameters.............................................................................................. 385 13.8.11 Library Summary dialog .................................................................................................
385 14 Multi-task data access synchronization in the PLC........................................................................... 386 14.1 Mutex procedure (TestAndSet, FB_IecCriticalSection) for securing critical sections ................... 387 14.1.1 TestAndSet .................................................................................................................... 390 14.1.2 FB_IecCriticalSection..................................................................................................... 392 14.2 Data exchange via the PLC process image ..................................................................................
393 14.3 Data exchange via synchronized buffers ...................................................................................... 394 15 Creating a visualization ........................................................................................................................ 396 15.1 Visualization Editor........................................................................................................................ 396 15.1.1 Interface editor ...............................................................................................................
398 15.1.2 Hotkeys configuration..................................................................................................... 402 15.1.3 Element List Editor......................................................................................................... 403 15.1.4 Toolbox .......................................................................................................................... 404 15.1.5 Properties window.......................................................................................................... 405 15.2 Visualization Manager ..................................................................................................................
407 15.2.1 Settings .......................................................................................................................... 408 15.2.2 Dialog settings................................................................................................................ 410 15.2.3 Default Hotkeys.............................................................................................................. 412 15.2.4 Visualizations ................................................................................................................. 413 15.2.5 User management..........................................................................................................
413 15.3 Visualization Libraries ................................................................................................................... 421 15.2.6 Font................................................................................................................................ 420 15.4 Preconditions ................................................................................................................................ 422 15.5 PLC project properties ..................................................................................................................
422 15.6 Visualization Profiles ..................................................................................................................... 422 15.7 Visualization object ....................................................................................................................... 422 TE1000 6 Version: 3.7.2