beckhoff TwinCAT 3 — Table of contents

Table of contents 13.15 Linking via TMC editor (TcLinkTo) ................................................................................................ 228 13.16 Online Change per ADS................................................................................................................ 230 14 Troubleshooting.................................................................................................................................... 232 14.1 Using C++ classes in TwinCAT C++ module ................................................................................

232 14.2 Activation – “invalid object id” (1821/0x71d) ................................................................................. 232 15 C++-samples.......................................................................................................................................... 233 15.1 Sample01: Cyclic module with IO ................................................................................................. 236 15.2 Sample02: Cyclic C++ logic, which uses IO from the IO Task...................................................... 237 15.3 Sample03: C++ as ADS server .....................................................................................................

237 15.3.1 Sample03: TC3 ADS Server written in C++................................................................... 238 15.4 Sample05: C++ CoE access via ADS ........................................................................................... 246 15.3.2 Sample03: ADS client UI in C# ...................................................................................... 242 15.5 Sample06: UI-C#-ADS client uploading the symbolic from module .............................................. 247 15.6 Sample07: Receiving ADS Notifications ....................................................................................... 252 15.7 Sample08:

provision of ADS-RPC ................................................................................................ 253 15.8 Sample10: module communication: Using data pointer................................................................ 256 15.9 Sample11: Module communication: method call PLC module to C++ module ............................. 257 15.9.1 TwinCAT 3 C++ module providing methods .................................................................. 258 15.9.2 Calling methods offered by another module via PLC..................................................... 272 15.10 Sample11a: Module communication: Method call C++ module to C++ module ...........................

284 15.11 Sample12: module communication: Using IO mapping ................................................................ 285 15.12 Sample13: Module communication: Method call C++ module to PLC module ............................. 286 15.13 Sample19: Synchronous File Access............................................................................................ 289 15.14 Sample20: FileIO-Write................................................................................................................. 290 15.15 Sample20a: FileIO-Cyclic Read / Write......................................................................................... 290 15.16 Sample22:

Automation Device Driver (ADD): Access DPRAM..................................................... 292 15.17 Sample23: Structured Exception Handling (SEH)......................................................................... 293 15.18 Sample24: Semaphores................................................................................................................ 295 15.19 Sample25: Static Library ............................................................................................................... 296 15.20 Sample26: Order of execution in a task ........................................................................................ 298 15.21 Sample30:

Timing Measurement .................................................................................................. 300 15.22 Sample31: Functionblock TON in TwinCAT3 C++........................................................................ 301 15.23 Sample35: Access Ethernet.......................................................................................................... 302 15.24 Sample37: Archive data ................................................................................................................ 303 15.25 TcCOM samples............................................................................................................................

304 15.25.1 TcCOM_Sample01_PlcToPlc ........................................................................................ 304 15.25.2 TcCOM_Sample02_PlcToCpp....................................................................................... 314 15.25.3 TcCOM_Sample03_PlcCreatesCpp .............................................................................. 318 16 Appendix................................................................................................................................................ 323 16.1 ADS Return Codes........................................................................................................................

323 16.2 Retain data.................................................................................................................................... 326 16.3 Creating and handling C++ projects and modules ........................................................................ 329 16.4 Creating and handling TcCOM modules ....................................................................................... 333 16.5 Third-party components ................................................................................................................ 337 TwinCAT 3 6 Version: 1.19.1