cnsGetIdSet

Returns the names of data points linked to the matching nodes.

Synopsis

bool cnsGetIdSet(string pattern, [string view, ], int whichNames, int langIdx, int type, dyn_string &dps);

Parameters

Parameter Description
pattern

This pattern is checked against the ID path or display name path. The wildcards * and ? can be used.

Note that you have to specify a leading * for the search pattern in order to receive a result. This is also necessary when the search pattern is called just as the node.

view Restricts the search to the given view
whichNames

Defines whether the search pattern is matched with the ID path, display name path or both. Moreover it defines whether case sensitivity shall be enabled. The following predefined constants can be used:

  • CNS_SEARCH_NAME - match with ID path

  • CNS_SEARCH_DISPLAY_NAME - match with name path

  • CNS_SEARCH_ALL_NAMES - match with both paths

  • CNS_SEARCH_CASE_INSENSITIVE - match case insensitive

The constans can be combined by using the pipe |.

langIdx

Defines which language of the display name path shall be checked.

  • CNS_SEARCH_ALL_LANGUAGES - match all languages

This parameter is ignored if neither CNS_SEARCH_DISPLAY_NAME nor CNS_SEARCH_ALL_NAMES is defined for the whichNames parameter.

type

Restricts the result to the given CNSDataIdentifierType.

  • CNS_SEARCH_ALL_TYPES - return nodes with all types

  • custom types - return only nodes with this type

dps Receives the names of data points linked to matching nodes. The result is a set, therefore each unique data point is only contained once.

Return value

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

Errors

-

Description

This function searches for nodes by matching their path with a wildcard pattern. It returns the names of the data points linked to the matching nodes.

Anmerkung:

The following characters are not allowed for separators: ','','*','?'

Moreover, numbers and letters which are already used in the view or node name must not be used.

Returns the data points for the Node2.

#uses "CtrlCNS"

main()
{
  dyn_string dps;
  bool i;

  i = cnsGetIdSet("*Node2*","System1.View1:", CNS_SEARCH_ALL_NAMES, CNS_SEARCH_ALL_LANGUAGES, CNS_SEARCH_ALL_TYPES, dps);
  DebugN(i, dps);
}

Availability

UI, CTRL