Configuration } } } CoUninitialize(); return 0; } 5.1.2 Browsing TwinCAT configuration In a separate article, we have already shown you how to access TwinCAT [ } 17] via the Visual Studio Automation Model. This reference to TwinCAT is being represented by an object of type ITcSysManager [ } 30] . From this point on we would like to discuss now how you can navigate through the TwinCAT configuration. General information It is important to understand that all information in TwinCAT is ordered in a tree-like structure. In Automation Interface, every tree node, and therefore every element of a TwinCAT configuration, is represented by the interface ITcSmTreeItem [ } 37] .
Navigating the TwinCAT data model can be done in different ways, depending on the sort of information that should be retrieved. Lookup-Methods are searching for specific tree items via specified search criterias, e.g. the path to a tree item Iterators or browsing functions iterate over a set of retrieved tree items Both methods are now being discussed in the following article. LookupMethods The Lookup methods are always working on the whole data model (unfiltered). ITcSysManager::LookupTreeItem [ } 35] determines a tree item with the specified absolute path name. ITcSysManager3::LookupTreeItemById [ } 36] determines a tree item with the specified item type and item Id.
ITcSmTreeItem::LookupChild [ } 65] determines a tree item within a subtree specified 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 [ } 35] . Iterators Now, three different types of iteration functions are supported:
Browsing all tree items (unfiltered) Browsing main tree items Browsing variables / symbols only Automation Interface 18 Version: 1.2