C++-samples | Sample01: Cyclic module with IO 15.1 Sample01: Cyclic module with IO | Sample01: Cyclic module with IO This article describes how to implement a TwinCAT 3 C++ module which is using the module IO mapped to physical IO. Download You can obtain the source code for this sample here: https://github.com/Beckhoff/TC1300_Samples/tree/main/S01-CyclicIO 1. Using a Visual Studio with TwinCAT installed, open the project via Open Project .... 2. If you want to run the project on Windows or TwinCAT/BSD ® (not required for Beckhoff RT Linux ® ):
Configure signing for this project by right-clicking on the project on the page, selecting Project -> Properties -> TC Sign , enabling TwinCAT signing, and configuring your certificate and password if necessary. Further information on signing C++ projects can be found in the chapter TwinCAT [ } 21] . 3. Select your target system. 4. Build the sample (e.g. Build->Build Solution ). р The sample is ready for operation. 5. Activate the configuration by clicking . Description This sample describes the quick start for the purpose of creating a C++ module that increments a counter on each cycle and assigns the counter to the logical output Value in the data area.
The data area can be assigned to the physical IO or another logical input or another module instance. TwinCAT 3 236 Version: 1.19.1 Number Title Description 23 Sample23: Structured Exception Handling (SEH) [} 293] Describes the use of Structured Exception Handling (SEH) based on five variants. 24 Sample24: Semaphores [} 295] Describes the use of semaphores. 25 Sample25: Static Library [} 296] Describes how to use the C++ static library contained in another C++ module. 26 Sample26: Order of execution in a task [} 298] Describes the determination of the task execution order, if a task is assigned to more than one module. 30 Sample30:
Timing Describes the measurement of the C++ cycle or execution time. Measurement [} 300] 31 Sample31: Functionblock TON in TwinCAT3 Describes the implementation of a behavior in C++, which is comparable to a TON function block of PLC / 61131. C++ [} 301] 37 Sample37: Archive data [} 303] Describes the loading and saving of the state of an object during the initialization and de-initialization. TcCOM TcCOM samples [} 304] Several samples are provided to illustrate the module communication between PLC and C++.