Overview of automatically generated files

When a build process is initiated, some files and folders are created automatically. "Where are the files located?", "What can be done with them?" and "What do the files mean?" These questions are answered below.

What are the categories of automatically generated files?

All files created by the TwinCAT Target are summarized in the current MATLAB® path in the folder <SimulinkModelName>_tcgrt. The folder is located next to the slprj folder generated by MathWorks®.

Overview of automatically generated files 1:

Generated source code

The central file for the source code is <SimulinkModelName>.vcxproj and is located in the <SimulinkModelName>_tcgrt folder. The file opens a TwinCAT C++ project, which can be used to inspect the generated source code, to subsequently build TwinCAT objects or also for debugging in TwinCAT.

Overview of automatically generated files 2:

With regard to the build option from the generated TwinCAT C++ project, it is worth knowing that you can switch off the publish step, i.e. building for the configured platforms, in Simulink®.

Overview of automatically generated files 3:

You can achieve code generation without build in Simulink® by deselecting Run the publish step after project generation. The publish step contains the build of the TwinCAT objects for the selected platforms (TwinCAT RT x86, x64 ...).

Overview of automatically generated files 4:

Further useful information:

Generated log files

The generated log files are summarized in the subfolder log. The log files created are the first place to look when debugging.

Overview of automatically generated files 5:

This folder contains up to three log files. The main point of contact is the summary of all logs in the file <ModelName>_ModuleGenerationLog.txt.

Overview of automatically generated files 6:

Beckhoff Support requires log file

If you require assistance from our support team, please send at least the following file from the log folder: <ModelName>_ModuleGenerationLog.txt

The structure of the ModuleGenerationLog is divided into several segments that represent different steps of the TwinCAT Target. The steps are displayed with ### in the log.

Sample:

2023-10-18 14:48:37: ### Starting build procedure for: SimpleTempCtrl
2023-10-18 14:48:43: ### Save TLC export
2023-10-18 14:48:47: ### Export block diagram
2023-10-18 14:48:47: Block diagram export succeeded
2023-10-18 14:48:48: ### Export TwinCAT C++ project
2023-10-18 14:48:53: ### Save project
2023-10-18 14:48:53: The TwinCAT C++ project "C:\Users\xyz\Documents\MATLAB\TE14xxSamples\2023-10-18_13-58_SimpleTemperatureController\SimpleTempCtrl_tcgrt\SimpleTempCtrl.vcxproj" was generated successfully

If no warnings or errors occur in the steps, no entries are usually made for the steps performed. In some cases, explicit reference is made to created files, such as the vcxproj file created in the sample above. Reference is also made to other log files for more detailed information, see the following sample:

2023-10-18 14:48:53: ### Publish TMX
2023-10-18 14:48:53: Configuration: "Release"
2023-10-18 14:48:53: Platform(s): "TwinCAT RT (x86);TwinCAT RT (x64);TwinCAT OS (x64)"
2023-10-18 14:48:53: TwinCAT SDK: "C:\TwinCAT\3.1\SDK\" (Version 3.1.4024.50)
2023-10-18 14:48:53: Platform Toolset: V142 (Automatically selected)
2023-10-18 14:48:53: Microsoft (R) Build Engine version 16.11.2+f32259642 for .NET Framework
2023-10-18 14:48:53: Copyright (C) Microsoft Corporation. All rights reserved.
2023-10-18 14:49:06: Publish procedure completed successfully
2023-10-18 14:49:06: See log file "C:\Users\xyz\Documents\MATLAB\TE14xxSamples\2023-10-18_13-58_SimpleTemperatureController\SimpleTempCtrl_tcgrt\log\SimpleTempCtrl_PublishLog.txt" for details

If warnings or errors occur, these are displayed in the ModuleGenerationLog. The detailed logs, on the other hand, contain all the outputs of the step performed. For example, warnings can be seen here in the signature verification area of the created tmx files:

2023-10-18 14:49:06: ### Publish summary
2023-10-18 14:49:06: Configuration: "Release"
2023-10-18 14:49:06: Platform(s): "TwinCAT RT (x86);TwinCAT RT (x64);TwinCAT OS (x64)"
2023-10-18 14:49:06: TwinCAT SDK: "C:\TwinCAT\3.1\SDK\" (Version 3.1.4024.50)
2023-10-18 14:49:06: Platform Toolset: V142 (Automatically selected)
2023-10-18 14:49:06: Vendor name: TE140x Module Vendor
2023-10-18 14:49:06: Library name: SimpleTempCtrl
2023-10-18 14:49:06: Library version: 2.0.1.24
2023-10-18 14:49:06: Local installation folder: "C:\TwinCAT\3.1\Repository\TE140x Module Vendor\SimpleTempCtrl\2.0.1.24"
2023-10-18 14:49:06: TMX archive: -
2023-10-18 14:49:06: Signatures:
2023-10-18 14:49:06: File 'C:\TwinCAT\3.1\Repository\TE140x Module Vendor\SimpleTempCtrl\2.0.1.24\TwinCAT RT (x86)\SimpleTempCtrl.tmx' has signature.
2023-10-18 14:49:06: issuer TestSign123 (x.yz@beckhoff.com), certificate expires on 08/15/2025
2023-10-18 14:49:06: Warning: Signature found, but OEM certificate was not signed by Beckhoff. Driver can only be used in test mode.
2023-10-18 14:49:06: File 'C:\TwinCAT\3.1\Repository\TE140x Module Vendor\SimpleTempCtrl\2.0.1.24\TwinCAT RT (x64)\SimpleTempCtrl.tmx' has signature.
2023-10-18 14:49:06: issuer TestSign123 (x.yz@beckhoff.com), certificate expires on 08/15/2025
2023-10-18 14:49:06: Warning: Signature found, but OEM certificate was not signed by Beckhoff. Driver can only be used in test mode.
2023-10-18 14:49:06: File 'C:\TwinCAT\3.1\Repository\TE140x Module Vendor\SimpleTempCtrl\2.0.1.24\TwinCAT OS (x64)\SimpleTempCtrl.tmx' has signature.
2023-10-18 14:49:06: issuer TestSign123 (x.yz@beckhoff.com), certificate expires on 08/15/2025

Created TwinCAT objects

After a successful build, the binary files and description files created, which can be re-used in TwinCAT XAE, are stored in the so-called Engineering Repository, i.e. on the engineering PC at:

%TwinCATInstallDir% \3.1\Repository\<Vendor>\<ModelName>\<Version>\

Overview of automatically generated files 7:

Distribution of TwinCAT objects to other XAE systems: If the folder at <ModelName> level is copied to other PCs with TwinCAT XAE in the local Engineering Repositories, their users can use the created TwinCAT objects in their TwinCAT Solutions.

Compare also Sharing created TwinCAT objects.

Additional Notes

Description of the generated C++ files and binary files

Versioned C++ projects