Beckhoff Automation GmbH & Co. KG — 8.7 How to export/import the information of a child of a tree item

How to call item.ConsumeXml(" 44 ") call tsm.SaveConfiguration See Also How to... section [ } 69] , ITcSysManager [ } 30] , LookupTreeItem [ } 35] , ITcSmTreeItem [ } 37] , ConsumeXml [ } 61] Built on Tuesday, Mai 01, 2001 8.7 How to export/import the information of a child of a tree item Requirements To export/import the information of a child of a tree item in a configuration, an instance of the TwinCAT System Manager must be created, and a configuration has to be opened. The LookupTreeItem [ } 35] method of the ITcSysManager [ } 30] interface returns a ITcSmTreeItem [ } 37] interface pointer implemented by the parent tree item referenced by the parents pathname.

This interface contains an ExportChild [ } 64] and an ImportChild [ } 64] method of the tree item. Procedure The ProgId " TCatSysManager.TcSysManager " can be used to create an instance of the System Manager that implements the ITcSysManager [ } 30] interface. This interface has a LookupTreeItem [ } 35] method that returns a ITcSmTreeItem [ } 37] pointer to a specific tree item given by its pathname. To export the information of a tree item " TIID^Device 1 (FC310x)^Box 1 (BK3100) " the following vbscript code can be used: Sample (vbscript):

dim tsm dim item set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIID^Device 1(FC310x)") call item.ExportChild("Box 1 (BK3100)","c:\twincat\box1.tce") To import the information of a tree item as a child of " TIID^Device 1 (FC310x) " the following vbscript code can be used:

dim tsm dim item set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIID^Device 1(FC310x)") call item.ImportChild("c:\twincat\box1.tce") The ImportChild [ } 64] method has same optional parameters that are described in the documentation of that method. See Also How to... section [ } 69] , ITcSysManager [ } 30] , LookupTreeItem [ } 35] , ITcSmTreeItem [ } 37] , ExportChild [ } 64] , ImportChild [ } 64] Built on Tuesday, Mai 01, 2001 Automation Interface 73 Version: 1.2