Configuration | Basics LookupMethods The Lookup methods are always working on the whole data model (unfiltered). ITcSysManager::LookupTreeItem determines a tree item with the specified absolute path name. ITcSysManager3::LookupTreeItemById determines a tree item with the specified item type and item Id. ITcSmTreeItem::LookupChild determines a tree item within a subtree specifed by a relative path name. Each tree item in TwinCAT can be identified by its unique pathname. The pathname of a tree item is based on the hierarchical order of its parent item (its name) and its own name, separated by circumflex accents ('^').
To shorten the pathnames and to avoid language dependencies, the top level tree items have special abbreviations which are listed in ITcSysManager::LookupTreeItem. Iterators At the moment, three different types of iteration functions are supported: Browsing all tree items (unfiltered) Browsing main tree items Browsing variables / symbols only Browsing all tree items (unfiltered) To browse all tree items in an unfiltered way, the property ITcSmTreeItem:NewEnum may be used. _NewEnum iterates over all subnodes of the currently referenced ITcSmTreeItem. This (COM-) property is used by many Programming and Script languages that support the COM Enumerator model (e.g.
.NET languages, VB6 or script languages) by a 'foreach' statement. For non-supporting languages like C++ the foreach loop must be implemented manually by using the IEnumVariant -interface. We recommend to use this way to iterate through child nodes. Sample (C#): ITcSmTreeItem parent = sysMan.LookupTreeItem("TIID^Device1^EK1100"); foreach(ITcSmTreeItem child in parent) { Console.WriteLine(child.Name); } Sample (C++): ... #import "C:\TwinCAT3\Components\Base\TCatSysManager.tlb" // imports the System Manager / XAE Base type library // uses automatically created auto-pointer (see MSDN documentation of #import command) ... TE1000 26 Version: 1.7.0