_dp_fct

"_dp_fct.._delay" attribute

If the attribute _dp_fct.._delay is not set when configuring a dp function, a default value of 5 seconds is used.

Constants for the ".._type" attribute

The following integer constants assign, to a datapoint, a config to mathematically link with other datapoint elements (see dpSet()).

CTRL constant int value Description
DPCONFIG_NONE 0 no function
DPCONFIG_DP_FUNCTION 60 datapoint function
DPCONFIG_STAT_FUNCTION 63 statistical function

"_dp_fct.._param" attribute

parameter list for datapoint function. Contains statistical attributes to be monitored.

"_dp_fct.._fct" attribute

definition of datapoint function.

"_dp_fct.._global" attribute

The dp_fct..global attribute defines global variables and their initialization value. The initialization runs when there are changes in the config or when starting. Logical uses of these global variables are determined by CTRL library functions and by transferring the global variables as reference parameters.

"_dp_fct.._stat_type" attribute

This attribute controls the statistical functions accompanying the DP function. The time parameters define the calculation times. Global variables can also be used here.

CTRL constant int value Description
SF_MIN 0 minimum
SF_MAX 1 maximum
SF_MIN_TIME 2 time for minimum
SF_MAX_TIME 3 time for maximum
SF_NUMBER 4 number
SF_SUM 5 sum
SF_INTRGRAL0 6 integral from step curve (0th degree)
SF_INTEGRAL1 7 integral from linear interpolation (1st degree)
SF_AVG 8 mean: SUM/number
SF_AVG_WTO 9 mean 0: integral from step curve/time
SF_AVG_WT1 10 mean 1: integral about the linear interpolation
SF_TIME0 11 time of the status 0
SF_TIME1 12 time of the status 1
SF_CHANGES 13 number of status changes
SF_CHANGES01 14 number of 0> 1 status changes
SF_CHANGES10 15 number of 1> 0 status changes
SF_SAMPLE 16 Value at start of interval
SF_ ENDVALUE 17 Value at end of interval
SF_DIFF 18 End values less start value

exampleExample

Applies a config with parameter settings for a DP function (DPE link). It calculates the function (p1+p2)*p3 on the DPE "TestDP_1.element", p1="ExampleDP_Arg1.", p2="ExampleDP_Arg2.", p3="TestDP_2.element":

main()
{
  string p1, p2, p3;
  dyn_string ds;
  p1="ExampleDP_Arg1.:_original.._value";
  p2="ExampleDP_Arg2.:_original.._value";
  p3="TestDP_2.element:_original.._value";
  ds=makeDynString(p1, p2, p3);
  dpSetWait("TestDP_1.element:_dp_fct.._type",
  DPCONFIG_DP_FUNCTION,
  "TestDP_1.element:_dp_fct.._param",
  ds,
  "TestDP_1.element:_dp_fct.._fct",
  "(p1+p2)*p3");
}

For more details on the config "_dp_fct" see chapter Module PARA - dp_fct (DP function).