beckhoff TE1000 TwinCAT 3 — 6.8.3 Creating a New C++ Module

Samples | C++ # Creating a TwinCAT static library project $libProj = $cpp.CreateChild("NewLibraryCpp", 0, "", "TcStaticLibraryWizard") 6.8.2 Opening an existing C++ project | Opening an existing C++ project An existing C++ project can be integrated into a TwinCAT solution via the Automation Interface without having to use the IDE manually. To do this, CreateChild() is called on the TIXC node, and the full file path to the project file is passed as the fourth parameter. Native project files with the .vcxproj extension and compressed TwinCAT project archives with the .tszip extension are supported. After successful integration, the method returns the new ITcSmTreeItem.

You can use this object to perform additional actions on the project, such as creating modules or reading properties. C# sample ITcSmTreeItem cpp = systemManager.LookupTreeItem("TIXC"); // Open an existing C++ project by its full file path (.vcxproj or .tszip) ITcSmTreeItem newProject = cpp.CreateChild("", 1, "", pathToProjectOrTczipFile); PowerShell sample $cpp = $systemManager.LookupTreeItem("TIXC") # Open an existing C++ project by its full file path (.vcxproj or .tszip) $newProject = $cpp.CreateChild("", 1, "", $pathToProjectOrTczipFile) C++ projects cannot be renamed. The name passed as the first parameter is ignored when the file is opened.

The project always appears in the solution under the name saved in the project file. If you want a project to appear in the solution under a different name, you must rename the project file itself before adding it to the solution. 6.8.3 Creating a New C++ Module | Creating a New C++ Module Within a C++ project, individual TwinCAT modules are created as separate classes. Each module implements a specific TwinCAT module interface, which defines how the module is integrated into the runtime system. Typical variants include cyclically clocked I/O modules, ADS communication nodes, and simple base modules without any specific system connection.

When a module is created, the module type is passed as the vInfo parameter in CreateChild() and serves as the wizard name, determining which code wizard generates the class stubs. The parent object of the call is the project node of the C++ project, not the higher-level TIXC node. TE1000 282 Version: 1.7.0