beckhoff TwinCAT 3 — 15.12 Sample13: Module communication: Method call C++ module to PLC module

C++-samples | Sample13: Module communication: Method call C++ module to PLC ... р The TMC-Code-Generator prepares the code accordingly. In the header of the module some variables are created in order to carry out the methods calls later. In the actual code of the module in CycleUpdate() the interface pointer is set using the object ID transmitted from the PLC. It is important that this happens in the CycleUpdate() and thus in real-time context, since the PLC must first provide the function block. When this has taken place once, the methods can be called. In addition, as can be seen above, the interface pointer is cleared when the program shuts down. This happens in the SetObjStateOS method.

4. Now build the C++ project. 5. Create an instance of the module. TwinCAT 3 288 Version: 1.19.1