_dp_fct
Attribute (neutral) | Type | Description |
---|---|---|
_fct | string | function definition |
_global | dyn_string | global variables |
_param | dyn_string | parameter for function |
_type | int | type of data point function |
Statistical functions | ||
_day | int | synchronization day |
_day_of_week | int | synchronization weekday |
_delay | int | delay time |
_def_func | int | functionality for default value bit |
_def_limit | int | threshold for default value bit |
_old_new_compare | bool | If you set this entry to TRUE, the old/new comparison is activated for this dp function. |
_interm | var | storage for intermediate results |
_interm_res | bool | flag whether intermediate results should be calculated |
_interm_res_cyc | int | cycle time for generation of the intermediate value in seconds |
_interval | int | interval |
_inv_func | int | functionality for invalid bit |
_inv_limit | int | threshold for invalid bit |
_month | int | synchronization month |
_read_archive | int | flag whether archive should be read |
_stat_type | dyn_int | types of the used statistical functions |
_time | int | synchronization time |
_user1_func | int | functionality for user-defined status bit 1 |
_user1_limit | int | threshold for user-defined status bit 1 |
_user2_func | int | functionality for user-defined status bit 2 |
_user2_limit | int | threshold for user-defined status bit 2 |
_user3_func | int | functionality for user-defined status bit 3 |
_user3_limit | int | threshold for user-defined status bit 3 |
_user4_func | int | functionality for user-defined status bit 4 |
_user4_limit | int | threshold for user-defined status bit 4 |
_user5_func | int | functionality for user-defined status bit 5 |
_user5_limit | int | threshold for user-defined status bit 5 |
_user6_func | int | functionality for user-defined status bit 6 |
_user6_limit | int | threshold for user-defined status bit 6 |
_user7_func | int | functionality for user-defined status bit 7 |
_user7_limit | int | threshold for user-defined status bit 7 |
_user8_limit | int | functionality for user-defined status bit 8 |
_user8_limit | int | threshold for user-defined status bit 8 |
"_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 data point, a config to mathematically link with other data point elements (see dpSet()).
CTRL constant | int value | Description |
---|---|---|
DPCONFIG_NONE | 0 | no function |
DPCONFIG_DP_FUNCTION | 60 | data point function |
DPCONFIG_STAT_FUNCTION | 63 | statistical function |
"_dp_fct.._param" attribute
parameter list for data point function. Contains statistical attributes to be monitored.
"_dp_fct.._fct" attribute
definition of data point 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 |
Example
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).