Overview

TE1410 TwinCAT Interface for MATLAB®/Simulink®

The TwinCAT 3 Interface for MATLAB®/Simulink® enables data exchange between MATLAB® and the TwinCAT Runtime and between Simulink® and the TwinCAT Runtime.

For Simulink®, ADS client blocks that can be simply integrated and configured in Simulink® projects are provided in the Simulink® library. It is thus possible, from the Simulink® environment, to write data to a TwinCAT runtime or to read data from it. An application example of the use of ADS blocks in Simulink® is the software-in-the-loop simulation, in which a regulating or control algorithm executed in the TwinCAT runtime is connected with a model executed in Simulink®, see description ADS in Simulink®.

An ADS Port object that can be used in the script environment is provided for MATLAB®. The object offers various methods for the exchange of data between MATLAB® and the TwinCAT runtime. In addition to an ADS client in MATLAB® − i.e. the MATLAB® environment initiates the data exchange – the use of an ADS server in MATLAB® is also possible. The latter offers the option of writing MATLAB® functions within the MATLAB® environment and calling them from TwinCAT via an ADS command. An application example for the use of the ADS client in MATLAB® is the creation of a graphical user and monitoring interface, e.g. based on a MATLAB® app. The ADS server can be used, for example, to perform non-real-time relevant tasks, such as components of a predictive maintenance system or a parameter optimization. The MATLAB® Compiler™ can be used to execute the programs created as stand-alone applications in the field, e.g. on an edge device or directly on the Industrial PC, see description ADS in MATLAB®.

Further Information