dpSelector()

Opens the data point selector and writes the selected data point address to s. See DP-Selector

Synopsis

int dpSelector (string &s[, bool configs[,string mode [, bool showElements [,string dptype [, string toplevel, [string group, [string comment[, string alias = "" [, bool showCNS = true]]]]]]]]]);

Parameters

Parameter Meaning
s Variable for the data point name
configs Defines, whether configs and attributes should also be displayed
mode

Defines from which system data points are selected

  • ALL_SYSTEM_NAME_SYS: Data points can be selected from all systems (default)

  • OWN_SYSTEM_NAME_SYS: only data points of own system, including the system id

  • OWN_SYSTEM_NAME_NO_SYS: only data points of own system, the data point name does not contain a system id

showElements Defines, whether the whole name of the data point is returned or not.
dptype Pattern of a dpType (for example, "valve" or "*")
toplevel Name of the main group
group Name of the group
comment Comments of the data point elements
alias Aliases of the data point elements
showCNS Specifies whether the "Plantmodel" tab is shown or not. For more information on the plant model, see chapter Common Name Service [CNS] Wizard, basics.

Return Value

If successful 0, otherwise -1.

Errors

This includes missing arguments, undefined functions, incorrect arguments (for example, no Control expression), incorrect assignments.

Description

Displays the data point selection dialog and writes the data point address selected there to the string variable s. Valid contents of the variable s is a data point address.

An address string cannot be set itself to the argument position of the function dpSelector()! Which is shown by the "&" in the synopsis. A transfer such as dpSelector("Valve02") is therefore not possible.

The function dpSelector(), which opens a Childpanel internally, can only be executed from a shape script.

Assignment of the address marked in the data point selection dialog to the variable s.

main()
{
  string s;
  dpSelector(s);
}

Only data points from one's own system can be selected, the system id is omitted.

main ()
{
  string s;
  dpSelector(s, true, "OWN_SYSTEM_NAME_NO_SYS");
  // s = "dp.el:_original.._value"
  dpSelector(s, true, "OWN_SYSTEM_NAME_SYS");
  // s = "System3:dp.el:_original.._value"
}

The following script opens the DP-Selector with the data point type filter "ExampleDP_Float":

main()
{
  string s;
  dpSelector( s, true, "OWN_SYSTEM_NAME_SYS", true, "ExampleDP_Float");
  DebugN(s);
  }

In the following example the datapoint selector is opened and the datapoint type filter "ExampleDP_Bit" is used. Furthermore, the "Plantmodel" tab is opened.

main()
{
 string s;
 dpSelector(s, true, "ALL_SYSTEM_NAME_SYS", true, "ExampleDP_Bit", "", "", "", "", true);
}
Figure 1. DpSelector and the datapoint type filter "ExampleDP_Bit"
Figure 2. DpSelector and the "Plantmodel" tab

In the following example the datapoint selector is opened with the main group filter "Alerts" and opened to the "Group" tab.

main()
                {
string s;
dpSelector(s, true, "ALL_SYSTEM_NAME_SYS", true, "", "Alerts");
}
Figure 3. DpSelector and the "Group" tab

Assignment

Simple configuration

Availability

UI