Sample11: module communication: PLC module invokes method of C-module
This article describes the implementation:
- of a C++ module that provides methods for controlling a state machine.
Follow this step-by-step introduction with regard to the implementation of a C++ module that provides an interface to the state machine.
- of a PLC module for calling the function of the C++ module.
The fact that no hard-coded link exists between the PLC and the C++ module is a great advantage. Instead, the called C++ instance can be configured in the system manager.
Follow this step-by-step introduction with regard to the implementation of a PLC project that calls methods from a C++ module.
Download
Get the source code for this sample.
- 1. Unpack the downloaded ZIP file.
- 2. Using a Visual Studio with TwinCAT installed, open the project via Open Project ....
- 3. 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.
For more information on signing C++ projects, click here. - 4. Select your target system.
- 5. Build the sample (e.g. Build->Build Solution).
- 6. Activate the configuration by clicking on .
- The sample is ready for operation.