Samples | C++ // Trigger the TMC code generator by consuming the action XML on the project node cppProject.ConsumeXml(startTmcCodeGenerator); PowerShell: $startTmcCodeGenerator = @" true " $cppProject.ConsumeXml($startTmcCodeGenerator) Calling the Publish Modules command The Publish Modules command publishes the compiled modules of a C++ project to the TwinCAT module system. After publication, the modules appear in the TwinCAT module list and can be referenced in the module instantiation of other TwinCAT projects on the same or other target systems.
This command corresponds to the manual Publish Modules call via the project node's context menu and is also triggered by selecting ConsumeXml() on the C++ project node. string publishModules = @" true "; // Trigger the Publish Modules command on the C++ project node cppProject.ConsumeXml(publishModules); Setting C++ project properties The project properties of the C++ node can be accessed via the XML interface. The current settings are read as XML using ProduceXml() . Changes are written back using ConsumeXml() . The following sample shows how to configure the encryption settings for the boot project as well as the archiving options for target system and file archives.
The value "None" completely disables encryption. "Target" generates device-specific encryption that is tied to the specific target system. The SaveProjectSources fields control whether the project's source files are included when creating an archive. string projProps = @" Target false false "; // Apply C++ project properties via ConsumeXml cppProject.ConsumeXml(projProps); Building the project To build the C++ project or the entire solution, you can use the methods of the Visual Studio automation API. For more information on this topic, see the articles L02-solution-konfiguration.md and C02-plc- projekt-kompilieren.md . TE1000 285 Version: 1.7.0