ITcSmTreeItem

Each tree item in a TwinCAT XAE configuration is represented by an instance of the ITcSmTreeItem interface, which enables various interactions with the tree item.

A tree item of this interface will be, for example, returned by calling the ITCatSysManager::LookupTreeItem method, which is used to navigate through the tree.

Properties

ITcSmTreeItem Property

Type

Access

Description

Name

BSTR

RW

Name of tree item

Comment

BSTR

RW

Comment.

Disabled

BOOL

RW

Get/Set state of tree item which can be one of the following enum values:

  • SMDS_NOT_DISABLED (item is enabled)
  • SMDS_DISABLED (item is disabled)
  • SMDS_PARENT_DISABLED (read only, set if one of its parent is disabled)

PathName

BSTR

R

Path of tree item in TwinCAT XAE. The branches are separated by '^'. The PathName may be used in other method calls, e.g. ITCatSysManager::LookupTreeItem. Please note that this property uniquely identifies a tree item in TwinCAT XAE.

ItemType

ENUM

R

Categorization of a tree item, e.g. Devices, Boxes, PLC, ... . As defined by item types.

ItemSubType

LONG

RW

Sub type of a tree item.

Parent

ITcSmTreeItem*

R

Pointer to the parent tree item.

ChildCount

LONG

R

Number of childs. Childs counted by this property enclose only main childs of the tree item (e.g. boxes are main childs of a device but not the device process image). To access all childs use the _NewEnum property.

Child(LONG n)

ITcSmTreeItem*

R

ITcSmTreeItem pointer of the n-th child

VarCount((LONG x)

LONG

R

Number of variables belonging to the tree item. x = 0 counted the input variables, x = 1 the outputs

Var(LONG x, LONG n)

ITcSmTreeItem*

R

ITcSmTreeItem pointer of the n-th variable. x = 0 uses the input variables, x = 1 the outputs

_NewEnum

IUnknown* (IEnumVariant*)

R

Returns a enum interface that enumerates all child tree items of the current tree item. This property may be used, for example, by a For-Each statement.

Methods

ITcSmTreeItem Methods

Description

Available since

CreateChild

Creates a child tree item.

TwinCAT 2.11

DeleteChild

Deletes a child tree item.

TwinCAT 2.11

ImportChild

Imports a child item from the clipboard or a previously exported file.

TwinCAT 2.11

ExportChild

Exports a child item to the clipboard or a file.

TwinCAT 2.11

ProduceXml

Returns a String containing the XML representation of the item, with all its item-specific data and parameters.

TwinCAT 2.11

ConsumeXml

Consumes a String containing the XML representation of the tree item, with all its item-specific data and parameters.

TwinCAT 2.11

GetLastXmlError

Gets the error message of the last erroneous ConsumeXml() call.

TwinCAT 2.11

LookupChild

Searches for a child with the specified relative path.

TwinCAT 2.11

ITcSmTreeItem2 Methods

Description

Available since

ResoucesCount

For interal use only

TwinCAT 2.11

ChangeChildSubType

Changes the SubType of the ITcSmTreeItem.

TwinCAT 2.11

ClaimResources

For internal use only

TwinCAT 2.11

ITcSmTreeItem3 Methods

Description

Available since

CompareItem

Compares the actual ITcSmTreeItem to the specified other.

TwinCAT 2.11

Version information

Required TwinCAT version

This interface is supported in TwinCAT 2.11 and above