Build for different platforms
With TwinCAT Target for MATLAB®, you can flexibly develop for different target system platforms. You can use the export configuration to specify which compiler should be used to build for each target system platform.
Project.PublishPlatformtoolset
The default “Auto” always uses the latest version. You can select a specific version as follows:
exportCfg.Project.PublishPlatformtoolset = 'Microsoft Visual C++ 14.5';![]() | Related versions Microsoft Visual C++ 14.1 => VS 2017 |
Project.PublishConfiguration
Build release or debug driver. Please note that a debug driver usually has a significantly slower execution time on the target system.
Project.ForceRebuildForPublish
MATLAB® Coder™ and the TwinCAT Target for MATLAB® cache some files to speed up the process for repeated builds. Select this parameter so that all source files are always rebuilt.
Project.PublishParallel
When multiple build platforms are selected, the compilation processes are independent of each other and executed sequentially. Activating this option causes all build processes to be executed in parallel on your engineering system. Parallelization is performed by the operating system. To avoid unnecessary waiting times, only create binaries for the platforms you use.
Project.SignTwinCatCertName
If not specified via an environment variable, enter your OEM certificate level 2 here to sign the created binaries, see Setting up driver signing.
Target system platforms
You can build for multiple target system platforms in a single build process. To do this, select the appropriate platforms in the export configuration:
exportCfg.Project.PublishTcRTx86 = true; % build RT (x86) executable
exportCfg.Project.PublishTcRTx64 = true; % build RT (x64) executable
exportCfg.Project.PublishTcOSx64 = true; % build OS (x64) executable
exportCfg.Project.PublishTcOSx64E = true; % build OS (x64-E) executable
exportCfg.Project.PublishTcOSARMv8A = true; % build OS (ARMV8-A) executableTwinCAT RT (x86)
Select this platform to build binaries for a target system with the following specifications: Intel® or AMD CPU, Windows 32-bit operating system (TwinCAT platform level 40 and higher).
TwinCAT RT (x64)
Select this platform to build binaries for a target system with the following specifications: Intel® or AMD CPU, Windows 64-bit operating system (TwinCAT platform level 40 and higher).
TwinCAT OS (x64)
Select this platform to build binaries for a target system with the following specifications: Intel® or AMD CPU, TwinCAT/BSD operating system (TwinCAT platform level 40 and higher).
Furthermore, this platform must be selected for execution with the TwinCAT Usermode Runtime.
TwinCAT OS (ARMV8-A)
Select this platform to build binaries for a target system with the following specifications: Arm® Cortex®-A CPU, Beckhoff RT Linux® operating system (TwinCAT platform level 20 and 30). Currently, this applies specifically to the CX82xx and CX9240 devices.
TwinCAT OS (x64-E)
Select this platform to build binaries for a target system with the following specifications: Intel® or AMD CPU, Beckhoff Real-Time Linux® operating system (TwinCAT platform level 40 and higher).
Notes on Beckhoff Real-Time Linux®
![]() | Driver signing not required for Beckhoff RT Linux® No driver signing is required for Beckhoff RT Linux®. This is mandatory for all other platforms. |
To support the TwinCAT OS (ARMV8-A) and TwinCAT OS (x64-E) platforms, the MSBuild Support for llvm (clang-cl) toolset component is required when installing Visual Studio. This must be selected manually during the installation of Visual Studio.
The TwinCAT OS (ARMV8-A) and TwinCAT OS (x64-E) platforms are supported only with TwinCAT 3.1 Build 4026.
Please note that currently, no debugger can be attached in TwinCAT Real-Time Linux®.
