beckhoff · TE1400 · 261 pp.

Beckhoff TE1400 TwinCAT 3 | Целевая платформа для Simulink® - Руководство пользователя

Руководство по использованию TE1400 для разработки и развертывания приложений в Simulink с использованием TwinCAT 3.

Related manuals

Contents

Document text

Manual | EN TE1400 TwinCAT 3 | Target for Simulink® 2026-09-17 | Version: 2.6.1

Page 1

Table of contents

Table of contents Table of contents 1 Foreword.................................................................................................................................................... 7 1.1 Notes on the documentation ............................................................................................................. 7 1.2 For your safety .................................................................................................................................. 8 1.3 Notes on information security............................................................................................................

9 1.4 Documentation issue status ............................................................................................................ 10 2 Overview .................................................................................................................................................. 12 3 Up to version 1.2.xxxx.x ......................................................................................................................... 15 3.1 Installation .......................................................................................................................................

15 3.2 Licenses .......................................................................................................................................... 17 3.3 Quickstart ........................................................................................................................................ 18 3.4 TwinCAT Library in Simulink ® .......................................................................................................... 21 3.5 Parameterization of the code generation in Simulink......................................................................

24 3.5.1 Module generation (Tc Build)........................................................................................... 25 3.5.2 Data exchange (Tc Interfaces)......................................................................................... 29 3.5.3 External mode (Tc External Mode) .................................................................................. 33 3.5.4 Advanced settings (Tc Advanced) ................................................................................... 36 3.6 Application of modules in TwinCAT ................................................................................................

42 3.6.1 Parameterization of a module instance............................................................................ 42 3.6.2 Executing the generated module under TwinCAT ........................................................... 44 3.6.3 Calling the generated module from a PLC project ........................................................... 46 3.6.4 Using the ToFile block...................................................................................................... 51 3.6.5 Signal access via TwinCAT 3 Scope ..............................................................................

57 3.7 FAQ................................................................................................................................................. 58 3.7.1 Does code generation work even if I integrate S-Functions into my model? ................... 58 3.7.2 Why do FPU/SSE exceptions occur at runtime in the generated TwinCAT module, but not in the Simulink model?..................................................................................................... 58 3.7.3 After updating TwinCAT and/or TE1400 I get an error message for an existing model...

59 3.7.4 Why do the parameters of the TcCOM instance not always change after a "Reload TMC/ TMI" operation?................................................................................................................ 59 3.7.5 After a "Reload TMC/TMI" error "Source File to deploy to target not found......... 60 3.7.6 Why do I have a ClassID conflict when I start TwinCAT?................................................ 61 3.7.7 Why can the values transferred via ADS differ from values transferred via output map- ping? ................................................................................................................................

61 3.7.8 Are there limitations with regard to executing modules in real-time?............................... 61 3.7.9 Which files are created automatically during code generation and publishing?............... 62 3.7.10 How do I resolve data type conflicts in the PLC project?................................................. 63 3.7.11 Why are the parameters of the transfer function block in the TwinCAT display not identical to the display in Simulink?................................................................................................ 64 3.7.12 Why does my code generation/publish process take so long? ........................................

64 3.8 Examples ........................................................................................................................................ 64 3.8.1 TemperatureController_minimal ...................................................................................... 65 3.8.2 Temperature Controller.................................................................................................... 71 3.8.3 SFunStaticLib................................................................................................................... 80 3.8.4 SFunWrappedStaticLib ....................................................................................................

86 3.8.5 Module generation Callbacks........................................................................................... 91 TE1400 3 Version: 2.6.1

Page 3

Table of contents

Table of contents 4 From version 2.x.xxxx.x ......................................................................................................................... 92 4.1 Installation ....................................................................................................................................... 92 4.2 Licenses .......................................................................................................................................... 94 4.3 Initial setup of the software .............................................................................................................

95 4.3.1 Set up default settings and set MATLAB ® path................................................................ 95 4.3.2 Setting up driver signing................................................................................................... 98 4.4 Quick start ..................................................................................................................................... 103 4.5 TwinCAT Library in Simulink ® ........................................................................................................ 110 4.5.1 TwinCAT Input and Output modules..............................................................................

111 4.5.2 TwinCAT Environment View .......................................................................................... 118 4.5.3 TwinCAT File Writer....................................................................................................... 118 4.5.4 TwinCAT Event .............................................................................................................. 120 4.6 Overview of automatically generated files..................................................................................... 125 4.7 Parameterization of the code generation in Simulink ® ..................................................................

129 4.7.1 Overview table of all configuration parameters.............................................................. 132 4.7.2 Parameterization of the code generation via an m-file................................................... 139 4.7.3 Build for different platforms ............................................................................................ 142 4.7.4 Build on a system without MATLAB ® (Build Agent)........................................................ 144 4.7.5 Bundling of several models in one TwinCAT driver .......................................................

144 4.7.6 Sharing created TwinCAT objects.................................................................................. 146 4.7.7 Automatic updating of objects in a TwinCAT project...................................................... 148 4.7.8 Creation of versioned drivers ......................................................................................... 150 4.7.9 Online Change of TcCOM.............................................................................................. 154 4.7.10 Configuration of data access to data of a TcCOM object...............................................

156 4.7.11 Shared memory between TcCOM instances ................................................................. 163 4.7.12 Creating a module with OEM license query................................................................... 169 4.7.13 Integration of own C/C++ code ...................................................................................... 171 4.7.14 Configuration of the TMX file properties......................................................................... 172 4.7.15 Multitask, Concurrent Execution and OpenMP ..............................................................

172 4.7.16 Instruction Set Extensions.............................................................................................. 179 4.7.17 Symbol Properties and Attribute Pragmas..................................................................... 180 4.7.18 Available placeholders ................................................................................................... 186 4.8 Application of modules in TwinCAT .............................................................................................. 197 4.7.19 Working with callbacks...................................................................................................

196 4.8.1 Working with the TcCOM module .................................................................................. 198 4.8.2 Working with the PLC library.......................................................................................... 217 4.8.3 Debugging...................................................................................................................... 228 4.8.4 Connecting to External mode......................................................................................... 231 4.8.5 Exception handling.........................................................................................................

234 4.8.6 Using Realtime Monitor time stamps ............................................................................. 244 4.9 FAQ............................................................................................................................................... 244 4.9.1 Change model parameters at runtime............................................................................ 244 4.9.2 Build of a sample fails .................................................................................................... 245 4.9.3 Problems with the block diagram representation in TwinCAT XAE ...............................

245 4.9.4 Can I use TE1400 version 1.2.x and version 2.x at the same time?.............................. 246 4.9.5 What is the difference between "Build" and "Generate code"?...................................... 246 TE1400 4 Version: 2.6.1

Page 4

Table of contents

Table of contents 4.9.6 I cannot change the parameters of a module in TwinCAT............................................. 246 4.9.7 Mapping is lost with Reload TMI/TMC ........................................................................... 246 4.9.8 Integrating the block diagram controls in .NET .............................................................. 247 4.9.9 Observable signals in the TwinCAT block diagram........................................................ 249 4.9.10 Using Simulink ® Strings..................................................................................................

250 4.9.11 Are there limitations with regard to executing modules in real-time?............................. 253 4.9.12 Message: Failed to copy repository ............................................................................... 253 4.9.13 DataExchange modules cannot be loaded .................................................................... 254 4.10 Samples ........................................................................................................................................ 254 4.10.1 Integrating the block diagram controls ..........................................................................

255 4.10.2 Try out created TwinCAT objects yourself ..................................................................... 257 4.11 Appendix ....................................................................................................................................... 258 4.11.1 Third-party components ................................................................................................. 258 4.11.2 Support and Service....................................................................................................... 259 TE1400 5 Version: 2.6.1

Page 5