cnsAddNode

Adds a new node to a tree or sub-tree.

Synopsis

bool cnsAddNode(string cnsParentPath, string name, langString displayNames, string dp [, int type]);

Parameters

Parameter Description
cnsParentPath

The ID path of the parent node of the new node

Node: You must specify a node and not a view

name ID of the new node
displayNames Display name of the new node
dp The data point (element) which is linked to the node. If no data point shall be linked an empty string can be defined.
type

The CNSDataIdentifierType of the new node:

  • CNS_DATATYPE_EMPTY - Structure (Default)

  • CNS_DATATYPE_DATAPOINT - Data point

Return value

Returns TRUE if successful or FALSE in case of an error.

Errors

-

Description

This function creates a new node and adds it to the defined (sub-)tree.

langString newDispNames;
setLangString(newDispNames, 0, "Knoten B");
setLangString(newDispNames, 1, "Node B");
cnsAddNode("System1.View1:A", "B", newDispNames, "ExampleDP_Int", CNS_DATATYPE_DATAPOINT);

Availability

UI, CTRL

Siehe auch