TcCOM_Sample02_PlcToCpp
This sample describes a TcCOM communication between PLC and C++. In this connection a PLC application uses functionalities of an existing instance of a TwinCAT C++ class. In this way own algorithms written in C++ can be used easily in the PLC.
Although in the event of the use of an existing TwinCAT C++ module the TwinCAT C++ license is required on the target system, a C++ development environment is not necessary on the target system or on the development computer.
An already built C++ module provides one or more classes whose interfaces are deposited in the TMC description file and thus are known in the PLC.
The procedure is explained in the following sub-chapters:
1. Instantiating a TwinCAT C++ class as a TwinCAT TcCOM Object
2. Creating an FB in the PLC, which as a simple wrapper offers the functionality of the C++ object
3. Execution of the sample project
Download the sample: TcCOM_Sample02_PlcToCpp.zip
System requirements
TwinCAT version | Hardware | Libraries to be integrated |
---|---|---|
TwinCAT 3.1, Build 4020 | x86, x64 | Tc3_Module |