TwinCAT C++ development 1. Type declaration and module type: The TwinCAT Module Class Editor (TMC) [ } 88] and TMC Code Generator are used for the definition of data types and interfaces, and also for the modules that use these. The TMC Code Generator generates source code based on the processed TMC file and prepares data types / interfaces for use in other projects (like PLC). Editing and starting the Code Generator can take place as often as you like – the code generation pays attention to programmed user code and preserves it. 2.
Programming The familiar Visual Studio C++ programming environment is used for the development and debugging [ } 75] of the user-defined code within the code template. 3. Instantiating modules [ } 35] The program describes a class, which is instantiated as objects. The TwinCAT Module Instance Configurator [ } 129] is used to configure the instance. General configuration elements are: Assign task, download symbol information for runtime (TwinCAT Module Instance (TMI) file), or specify parameter/ interface pointers. 4. Mapping of variables The input and output variables of an object can be linked with variables of other objects or PLC projects, using the standard TwinCAT System Manager. 5.
Building During the building (compilation and linking) of the TwinCAT C++ project, all components are compiled for the selected platform. The platform is determined automatically when the target system is selected. 6. Publishing During publishing of a module, the drivers for all platforms are created, and the module is prepared for distribution. The directory created in the repository can be distributed without having to transfer the source code. Only binary code with the interface description is transferred. 7. Signature for Windows and TwinCAT/BSD® (see Module signing [ } 20] ) The TwinCAT C++ projects in TMX files must be signed. The signature process can be user-defined [ } 34] .
This does not apply to TME files under Beckhoff RT Linux ® . 8. Activation The TwinCAT C++ projects can be activated like any other TwinCAT project via Activate Configuration . The dialog then requests to switch TwinCAT to RUN mode. Debugging [ } 75] in real-time (which is familiar from IEC61131-based systems) and the setting of (conditional) breakpoints is possible for TwinCAT C++ modules. Debugging is currently not supported for Beckhoff RT Linux ® systems. р The module runs under real-time conditions. TwinCAT 3 57 Version: 1.19.1