dpNames()

Returns all the datapoint names or datapoint element names that match a pattern. The datapoint structures are written to the array in alphabetical order.

Synopsis

dyn_string dpNames(string dpPattern = \"*\", string dpType = \"\", bool ignoreCase = false)

Parameter

Parameter Description
dpPattern Pattern
dpType

String pattern for datapoint type names

Allows to restrict the returned datapoints to a specific data point type. When using the parameter only datapoints that are matching the pattern and the selected datapoint type will be returned.

ignoreCase Defines if the search should ignore the casing of the search pattern (=true) or not (=false, default).

Return Value

List with datapoints or datapoint elements.

The names of datapoint types are returned per system.

Errors

Errors can be retrieved with getLastError().

Details

The function dpNames() returns all the datapoint names or datapoint element names that match the pattern dpPattern. The option dpType also filters by a datapoint type. If no dpPattern is specified, all the datapoint names are returned. Wildcards may also be used to filter datapoint names. In this way dpNames("*") only refers to the top level (root elements) of a datapoint structure and returns all the datapoint names. It is therefore equivalent to dpNames().

If a datapoint is returned with a structure, the structure must be described. Only datapoints that have the same number of levels as specified are found. Levels are separated by a period. dpNames(**) is equivalent to dpNames(*.*). Furthermore:

  • ":*" returns all configs, ":config.*" returns all details, ":config.detail.*" returns all attributes

  • "dp.el:*" returns only the configs according to the DPE. , for example, no _original for a node.

dpNames() also allows querying datapoints from a remote system.

Note:
Note that the config entry [all sections] maxDpNamesCount can be used to limit the number of queried datapoints. If you specify the entry, call the dpNames() function and the return value of the function is greater than the number permitted via the config entry, an error message is shown.

Engine

Figure 1. Example: The DPT of the datapoint engine

A dpNames(*.*.*) finds an engine because there are occurrences of the engine with 3 levels.

engine.setpoint.engineSpeed

A dpNames (*.*) finds an engine because there are occurrences of the engine with 2 levels.

engine.setpoint and engine.currentValue

Standard pattern matching applies within a level, for example, dpNames ("*DP*") finds the datapoints Example DP_Arg2, ExampleDP_DDE, _DP etc.

Querying with wildcards is not possible for dpType!

Assignment of all datapoint elements of the datapoint Valve17, including Valve17.opening, to the variable names.

main()
{
  dyn_string names;
  names = dpNames("Valve17.*");
}

Example of wildcards in lists of options

main()
{
  string s;
  DebugN(dpNames(s = "{*.Ala.*,*.Ala*}"), s);
  DebugN(dpNames(s = "*{.Ala.,.Ala}*"), s);
  DebugN(dpNames(s = "*.A{la.,la}*"), s);
  DebugN(dpNames(s = "*.Al{a.,a}*"), s);
  DebugN(dpNames(s = "*.Ala{.,}*"), s);
  DebugN(dpNames(s = "*.Ala{.}*"), s);
  DebugN(dpNames(s = "*.Ala.*"), s);
  DebugN(dpNames(s = "*.Ala*"), s);
}

Query of the datapoints with additional system name. Saves the names of all data point elements of the datapoint Valve17 from System1 into the variable names.

main()
{
  dyn_string names;
  names = dpNames("System1:Valve17.**");
}

Assignment

Datapoint Functions, Waiting Control Functions

Availability

CTRL