Sharing created TwinCAT objects

Often the colleagues who create TwinCAT objects (TcCOM and/or PLC library) from Simulink® or MATLAB® are not the ones who implement the created modules into a TwinCAT configuration and create the machine code.

In order to be able to work with the created TwinCAT objects in TwinCAT XAE, they must be available in the repository folder on the local engineering PC and the PLC library must be installed in the local PLC Library Repository. Manual copying to engineering PCs is error-prone. It is therefore strongly recommended to create a so-called TMX archive and share it with colleagues who want to use the created modules.

Sharing created TwinCAT objects 1:

What is a TMX archive?

The TMX archive is an archive of all necessary files, which are required for the use of TcCOM and PLC libraries in a TwinCAT Engineering. The archive contains all compiled drivers, description files (e.g. for the block diagram in TwinCAT), the tmc file for TcCOM or the tml or library file for the PLC.

A TMX archive only needs to be copied to any path on an engineering PC and executed. It is a self-extracting archive, which then automatically copies all files to the correct location.

The files of the model SimpleTempCtrl in version 0.0.0.2 from the Vendor TE140x Module Vendor must be located at this position, for example:

Sharing created TwinCAT objects 2:

How do I create a TMX archive?

You can specify the path and name of the TMX archive under TC Build to have it created with the next build.

Sharing created TwinCAT objects 3:

You can also use placeholders for the path and name as shown in the sample above. Result of this setting is e.g. a TMX archive 2021-11-04-172921-SimpleTempCtrl0.0.0.3.exe (new build, therefore revision incremented).

How do I use a TMX archive?

You can then copy the TMX archive to any path on an engineering PC and execute it. This will copy the files in the archive to the correct location in your repository. (self-extracting zip). If you want to use not only the TcCOM modules in the archive on the engineering PC, but also the PLC library, this must still be installed via the PLC - Library Repository.

Alternatively, you can also use the Command Prompt. Call the help of the TmxPackageInstaller via:

<tmxarchive>.exe /?
Sharing created TwinCAT objects 4:

For example, to unpack a TMX archive and install the PLC library it contains in the local TwinCAT Engineering, execute the following command in the command line:

<tmxarchive>.exe /plclib:install

What software do I need on the TwinCAT Engineering PC?

On the engineering PC on which you want to use the already compiled TwinCAT objects to implement them in a TwinCAT configuration, you only need a TwinCAT XAE installation.

Sharing created TwinCAT objects 5:

You do not need a full Visual Studio on this engineering PC (the XAE shell of the TwinCAT XAE setup is sufficient) nor do you need a MATLAB® installation.

In some cases it is necessary to install the so-called DataExchange modules on the engineering PC, so that you can use TwinCAT objects created on another system.

These cases are:

In all other cases the created TwinCAT objects have no dependency to the DataExchange modules.

The DataExchange modules setup is part of the TE14xx toolForMatlabAndSimulink setup and is installed by default.

The DataExchange modules setup is also copied to the following folder, so that the employee who has installed the TE14xx-ToolsForMatlabAndSimulink setup can distribute the DataExchange modules setup to the relevant colleagues.

<TwinCATInstallDir>\TwinCAT\Functions\TE14xx-ToolsForMatlabAndSimulink\TE140x\SDK

Continuous Integration with the Target for Simulink® or Target for MATLAB®

Tips for setting up a CI/CD pipeline are compiled in the following sample:

TwinCAT.ModuleGenerator.Samples.Start('Continuous Integration')