D2_CalcStatFuncArr
Accessing historical values - D2_CalcStatFuncArr function
The function allows you to calculate the specified statistical archive function for all given time intervals on demand.
Declaration
D2_CalcStatFuncArr
(archObjName, bt, et, step, deepTime, statFuncID, validPerc, paramIdent, bDirectionByRow, refresh)Parameters
archObjName | TEXT type |
|
bt | ABS. TIME type | Interval begin time. |
et | ABS. TIME type | Interval end time. |
step | INT type | Time step [s] within the archive block. |
deepTime | INT type | Time depth [s] for calculating the statistics. |
statFuncID | INT type | Statistical function type. The type is represented by a numerical value (see the table). |
validPerc | INT type | Validation criteria. |
paramIdent | REAL or INT types | Parameter for some types of functions. |
bDirectionByRow | BOOL type | Time order of cells in matrix. |
refresh |
| Optional parameter of optional type. |
Description
The return value of the function is of array type. Owing to that fact, this function is predetermined to be used in so-called Matrix.
The action executes the calculation of a statistical function specified by the parameter statFuncID on the values represented by the historical value archObjName for the following time intervals specified by the parameters bt, et, step a deepTime:
first time interval - <bt - deepTime; bt>
second time interval - <bt + step - deepTime; bt + step>
.....
n-th time interval - <bt + (N-1)*step - deepTime; bt + (N-1)*step>
The results are returned as an array, whose members represent the individual results of calculation of the statistical function for the given time intervals.
The parameter validPerctIdent_Int represents the Validation criteria used during the evaluation of the statistical function. The permissible values are in range 1 .. 100 (the error ERR_RANGE_ERROR occurs if the condition is not met).
For some statistical archive function, the parameter paramIdent must be specified according to the table:
Statistical function | Parameter description | ||||||||
_STAT_F_INTEGRAL | Integral time units. For individual types, there are also established predefined local variables according to the table:
| ||||||||
_STAT_F_GE_TIME |