Provision of the binary C++ project (TMX) and its classes

The binary TwinCAT C++ project must be available on the engineering system so that it can be transferred to the target system together with the PLC project during activation.

TwinCAT offers a deployment mechanism for distribution between engineering systems, which is described at Versioned C++ Projects.
(This sample includes in the download the corresponding TMX, because TwinCAT places them automatically in the archive, if the Class Factory is used.)

Open a TwinCAT project or create a new project.

1. Select the required C++ driver in the solution under the TcCOM Objects node in the Class Factories tab. The checkbox can also be set automatically by TwinCAT if you implement this accordingly (as in the sample here).
This ensures that the driver is transferred and loaded on the target system when TwinCAT is started.
Provision of the binary C++ project (TMX) and its classes 1:
Provision of the binary C++ project (TMX) and its classes 2:

Creation of the binary C++ project

The documentation for TwinCAT C++ explains in detail how to create the TMX.
For Sample03 it should be noted that TwinCAT C++ modules whose classes are to be dynamically instantiated must be defined as "TwinCAT Module Class for RT Context". The C++ wizard offers a special template for this purpose.
Furthermore, this sample uses a TwinCAT C++ class that does without TcCOM initialization data and without TcCOM parameters.