Samples | System Code snippet (PowerShell): $io = $systemManager.LookupTreeItem("TIID") $newIo = $io.ImportChild(@"C:\IoTemplate.xti", "", true, "SomeName") It is important to note that when exporting an I/O device within TwinCAT XAE, all sub-devices are automatically exported and are also included in the export file. The following screenshot shows how I/O devices are exported to an export file. Remember that you can also use the Automation Interface to export an I/O device to an XTI file. The ExportChild() method from the ITcSmTreeItem interface is available for this purpose. Working with movement templates (axes) The use of motion axis templates is very similar to that of I/O devices.
Axes can also be exported to an XTI file, either via TwinCAT XAE or via the Automation Interface code using ExportChild(). By using ImportChild(), these export files can be imported again later. Code snippet (C#): ITcSmTreeItem motionAxes = systemManager.LookupTreeItem("TINC^NC-Task^Axes"); motionAxes.ImportChild(@"C:\AxisTemplates.xti", "", true, "Axis 1"); Code snippet (PowerShell): $motionAxes = $systemManager.LookupTreeItem("TINC^NC-Task^Axes") $motionAxes.ImportChild(@"C:\AxisTemplates.xti", "", true, "Axis 1") TE1000 199 Version: 1.7.0