cns_createTreeOrNode

Creates a tree or a node and adds it to the given parent element.

Synopsis

bool cns_createTreeOrNode(string parent, string id, langString display, string dp, int type);

Parameters

Parameter Description
parent Name of the parent node or tree. The created tree or node will be added to this element.
id ID of the node
display Display name of the node
dp Data point (element) which shall be linked to the node
type

Node type (refer to Nodetype for further information)

  • CNS_DATATYPE_ALL_TYPES - all types

  • CNS_DATATYPE_EMPTY - Structure (Default)

  • CNS_DATATYPE_DATAPOINT - Data point

Return value

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

Errors

Possible errors:

  • Node could not be added

  • Tree could not be added

Description

This function allows to create a new tree or node and adds it to the given tree.

main()
{
  langString myLang;
  setLangString(myLang,0,"Mein Knoten");
  setLangString(myLang,1,"My Node");
  cns_createTreeOrNode("System1.View1:parentNode", "myNode", myLang, "", 501);
}

Availability

UI, CTRL