Installation
System requirements
In the following, a distinction is made between the engineering PC and the runtime PC. The following definition applies: on the engineering PC, MATLAB® functions are converted to TwinCAT objects by using the Target for MATLAB®. Likewise, a TwinCAT solution can, but does not have to, be created on this PC, which uses the created objects. The created TwinCAT solution is then loaded from the engineering PC to a runtime PC in the TwinCAT runtime environment for execution of the project.
On the engineering PC
- MATLAB R2019a or higher
- MATLAB® and MATLAB CoderTM Toolbox
- Visual Studio 2017 or higher (Professional, Ultimate or equivalent edition)
- During installation, the option Desktop development with C++ must be selected manually. The option can also be installed later.
- TwinCAT 3.1.4024.7 or higher
- Install TwinCAT 3 XAE or Full Setup only after Visual Studio has been installed with Desktop development with C++.
- TwinCAT Tools for MATLAB® and Simulink® Setup
On the runtime PC
- Supported operating systems
- Windows 7, Windows 10, Windows Server (32-bit and 64-bit)
- TwinCAT/BSD®
- TwinCAT XAR version 3.1.4024.7 or higher
Built objects can be easily forwarded TwinCAT objects built on an engineering PC (or Build Server) can be easily forwarded to other people. They only need the TwinCAT XAE development environment in order to use the created objects (TcCOM or PLC function blocks) in a TwinCAT solution. |
Installation
- Install one of the supported Visual Studio versions, if not already installed. Note the installation of the option Desktop development with C++.
- 1. Start TwinCAT 3 XAE or Full Setup, if it does not already exist.
If a Visual Studio and a TwinCAT installation already exists but the Visual Studio version does not meet the requirements mentioned above (e.g. TwinCAT XAE Shell or Visual Studio without C++ option), you first have to install a suitable Visual Studio version (install C++ option, if necessary). Then run TwinCAT 3 Setup to integrate TwinCAT 3 into the new (or modified) Visual Studio version. - 2. If you do not have a MATLAB® installation on your system, install it. The order in which MATLAB® was installed is irrelevant.
- 3. Start TwinCAT Tools for MATLAB® and Simulink® Setup to install TE1401 TwinCAT Target for MATLAB®.
- The TwinCAT Target for MATLAB® is installed within the TwinCAT folder structure, i.e. it is separate from the MATLAB® installation.
- 4. Start MATLAB® as administrator and run
%TwinCAT3Dir%.. \Functions\TE14xx-ToolsForMatlabAndSimulink\SetupTE14xx.p in MATLAB®.
- A setup window opens. See the following section.
Setting up the software
Version SetupTE14xx.p
After executing the p-file, a dialog opens in which you can save general default settings that will then apply to the system. You can make the settings directly or make/change them at a later time.
If you want to execute the p-file without this dialog, you can use the following command: SetupTE140x('Silent', true);
Setting options in the dialog are:
VendorName, GroupName (MATLAB®) and GroupName (Simulink®)
These settings influence the hierarchy in which the generated TwinCAT objects are sorted. See diagram below. Here the entries VendorName "TE140x Module Vendor" and GroupName "TE140x|MATLAB Modules" are for MATLAB® and "TE140x|Simulink Modules" for Simulink®.
To change the default settings, you can access the dialog with TwinCAT.ModuleGenerator.Settings.Edit
in the MATLAB® Console. Here you are also offered additional entries that you can store as default.