TcCOM_Sample02_PlcToCpp

This example 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++ driver the TwinCAT C++ license is required on the destination system, a C++ development environment is not necessary on the destination system or on the development computer.

An already built C++ driver 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++ 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

Downloading the sample: TcCOM_Sample02_PlcToCpp.zip

System requirements

TwinCAT version

Hardware

Libraries to be Integrated

TwinCAT 3.1, Build 4020

x86, x64

Tc3_Module