dpNames()
Returns all the data point names or data point element names that match a pattern. The data point structures are written to the array in alphabetical order.
Synopsis
dyn_string dpNames([string dpPattern[,string dpType][. bool ignoreCase =
false]]);
Parameter
Parameter | Meaning |
---|---|
dpPattern | Pattern |
dpType |
Data point type Allows to restrict the returned data points to a specific data point type. When using the parameter only data points that are matching the pattern and the selected data point 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 data points or data point elements.
Errors
Errors can be retrieved with getLastError().
Description
The function dpNames() returns all the data point names or data point element names that match the pattern dpPattern. The option dpType also filters by a data point type. If no dpPattern is specified, all the data point names are returned. Wildcards may also be used to filter data point names. In this way dpNames("*") only refers to the top level (root elements) of a data point structure and returns all the data point names. It is therefore equivalent to dpNames().
If a data point is returned with a structure, the structure must be described. Only data points 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 data points from a remote system.
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 data points Example DP_Arg2, ExampleDP_DDE, _DP etc.
Querying with wildcards is not possible for dpType!
Assignment of all data point elements of the data point 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 data points 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
Availability
CTRL