Beckhoff Automation GmbH & Co. KG — 8.10 How to update the address information of I/O devices

How to 8.9 How to add child items (devices, boxes, terminals, variables etc.) Requirements To add child items (devices, boxes, terminals, variables etc.) in a configuration, an instance of the TwinCAT System Manager has to 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 a CreateChild method. 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 add a child item to a tree item " TIID^Device 1 (FC310x) " the following vbscript code can be used: Sample (vbscript): dim tsm dim item dim str dim itemChild set tsm = CreateObject("TCatSysManager.TcSysManager") call tsm.OpenConfiguration("c:\twincat\myConfig.wsm") set item = tsm.LookupTreeItem("TIID^Device 1(FC310x)") call item.CreateChild("Box 1 (BK3100)",BOXTYPE_BK3100) The tree item type of the child is implicit given by the parent type (e.g. child of I/O devices are always I/O boxes, child of bus couplers are always terminals...).

The item sub type must be specified as a parameter of CreateChild [ } 62] . The CreateChild [ } 62] method has same optional parameters that are described in the documentation of that method. Optional CreateChild() parameter 'vInfo': See CreateChild [ } 62] . See Also How to... section [ } 69] , ITcSysManager [ } 30] , LookupTreeItem [ } 35] , ITcSmTreeItem [ } 37] , CreateChild [ } 62] Built on Tuesday, Mai 01, 2001 8.10 How to update the address information of I/O devices Requirements To update the address information of I/O devices in a configuration, an instance of the TwinCAT System Manager must be created, and a configuration must be opened.

A call to the ProduceXml [ } 60] method of the "I/O devices" tree item retrieves the current address information of all installed I/O devices (internally by calling the scan devices function). This address information can be used to update a specific I/O device in the configuration. Automation Interface 75 Version: 1.2