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. Configure signing for this project by switching on TwinCAT signing with a right-click on Project->Properties->Tc Sign and configure your certificate and password if necessary.
Further information on signing C++ projects can be found in the chapter TwinCAT. - 3. Select your target system.
- 4. Build the sample (e.g. Build->Build Solution).
- 5. Activate the configuration by clicking
.
- The sample is ready for operation.
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.
The sample is described step by step in the short instructions.
Related documents