Totaling
(Original Document)
Description
This function includes the input value (typically a negative) according to time, and returns a cumulative (typically a volume).
For this, it uses a partial internal accumulator (Acc) that includes the PV value and is automatically reset to 0 each time it reaches an adjustable threshold THLD.
The number of resets is recorded in order to enable the recomposing of the global cumulative OUT_TOT.
Function Principle
On each execution the accumulator Acc and the cumulative OUT_TOT are calculated using the algorithm:
Acc(new) = Acc(old) + PV. DT
SI Acc(new) >= THLD ALORS
Acc(new) = Acc(new) - THLD
CptInit = CptInit + 1
FINSI
OUT_TOT = CptInit x THLD + Acc(new)
where:
CptInit = number of resets
DT = task period
ACC (old) = value of accumulator Acc on the previous cycle
Adjusting the Integration Threshold THLD
Generally, integration threshold value corresponds to an easily determined process characteristic (the capacity of a tank, for example). During a cycle, a status bit is set to 1 each time the partial accumulator reaches the integration threshold.
The function can also be used to integrate small input value, even when the result of the integration is very large. In this case, the values to be integrated may become negligible to the accumulated value and are therefore no longer taken into consideration.
To avoid this, we advise you to limit the accumulator to a threshold THLD, so that the value to be integrated is never negligible in relation to this partial accumulator. When the threshold THLD is equal to 0, the function does not integrate a value and the function remains fixed.
Time Base
In order to integrate the new process value, the relationship between the cumulative value and the PV value must be less than 109.
Associated Commands
Two commands are associated to the function:
Timing Graph
Totalizer Function:
Parameters
Input Parameter:
Parameter
Symbol
Type
Thresholds
Default Value
R/W
Process value
PV
REAL
-3.4E38 / 3.4E38
/
R
Internal parameters:
Parameter
Symbol
Type
Thresholds
Default Value
R/W
Totaling Threshold
THLD
REAL
0.0 / 3.4E38
1.0E38
R/W
Time Base (h)
/
%KW bit
/
/
R
Output parameters:
Parameter
Symbol
Type
Thresholds
Default Value
R/W
Totaling Value
OUT_TOT
REAL
0.0 / 3.4E38
0.0
R
Threshold reached
STS_THLD_TOT
EBOOL
/
/
R
Execution Monitoring
The monitoring of the parameters is integrated into the error management of the process value branch.