[MOV_CALC] Moving calculation
Function block MOV_CALC calculates preconfigured evaluation functions for a continuously updated internal data buffer.
MOV_CALC calculates preconfigured evaluation functions for a continuously updated internal data buffer.
MOV_CALC cyclically receives the input value [In] and stores it into an internal buffer. The size of the buffer is configured at input [BufSize] (maximum 60). The buffer contains values and timestamps for the time at which the values were sampled.
Storing the input data
Storing the input data into the buffer can be triggered in two ways:
- Impulse (rising edge) at input [Trig]
- Internal timer for the function block, configured via input [TiSmpl]

The value -1s for the input [TiSmpl] disables the internal timer. In such a case, new values in the buffer will be added only via input [Trig].
When the buffer is filled with data and a new value is requested to be stored, the oldest (earliest) sample in the buffer will be overwritten by the new value.

An input value is stored in the buffer only if it is valid. The validity of the input value is defined by the [Vldty] input.
Enable and disable the function
The input [EnFnct] disables the function block (outputs are set with default values).
Disabling the function block does not clear the internal buffer.
Reset
The [Reset] input is used to clear the internal buffer and to restart the calculations.
Calculation
The function block can calculate up to four evaluation functions for the data in the buffer.
These functions are configured at inputs [EvlFnct1] ... [EvlFnct4].
The results of the evaluation functions are provided at outputs [Val1] ... [Val4].
Buffer behavior
The function block provides an impulse at output [UpdInd] when a new value is added in the buffer.
[RecCnt] output provides the number of sampled values collected in the buffer.
Output [FstVal] provides the first (earliest) value in the buffer.
Output [FstTiStm] provides the time when the first (earliest) value in the buffer was received.
Output [LstVal] provides the last (most recent) value in the buffer.
Output [LstTiStm] provides the time when the last (most recent) value in the buffer was received.
Persistence of the buffer values
If [Pers] = 1 at start up, MOV_CALC reads the last saved buffer values from the associated BACnet object and uses them as initial buffer values. In the event of an error or if [Pers] = 0, the buffer is empty.
The properties 'Buffer size', 'Last value index', 'Record count', 'Values' and 'Time stamp for values' must be available on the associated BACnet object as extension property ('Extension by persistence' = 'Moving calculation').
Outputs [Dstb] and [ErrCode] indicate if an access error has occurred when the last saved values are read from the associated BACnet object.
Evaluation of more than 60 values
Input [SeqCnctIn] and output [SeqCnctOut] are used to link two MOV_CALC function blocks in sequence. Linking function blocks in sequence is used when a buffer with a size bigger than 60 is needed. When the buffer of the first function block is filled with values and a new value is received, the first (earliest) value in the buffer will be forwarded to the second function block before it is overwritten by the new value. When the input [SeqCnctIn] of the second function block is connected, then the values at its inputs [In], [Vldty], [Trig] and [TiSmpl] are ignored.

Input | Description | Data type | Default value |
|---|---|---|---|
EnFnct | Enable function Enables the function. | Boolean | 1 |
0 - The function is disabled. | |||
In | Input Input signal | Real | 0.0 |
|
Vldty | Validity Only valid input values are stored in the internal buffer. | Boolean | 1 |
0 - The input signal is not valid. | |||
|
Trig | Trigger Trigger impulse for storing an input value in the buffer | Boolean | 0 |
|
TiSmpl | Sampling time Time between the received input values | Time | 15m 1m...1d |
|
BufSize | Buffer size Size of the internal buffer | Integer | 60 2...60 |
|
EvlFnct1...EvlFnct4 | Evaluation function 1...Evaluation function 4 Evaluation function to be performed for the values in the buffer. | Integer | 1: No function selected |
1: No function selected | |||
|
Reset | Reset Reset internal buffer. | Boolean | 0 |
0 - Do not reset | |||
Pers | Persistent | Boolean | 0 |
0 - No | |||
|
SeqCnctIn | Sequence connection input Receives values from the previous function block in a sequence. | Structure | - |
SeqCnctIn | Connected Indicates if a pin is connected. | Boolean | 0 |
SeqCnctIn | Removed value Removed value from the buffer | Real | 0.0 |
SeqCnctIn | Removed time stamp Removed time stamp from the buffer | DateAndTime | 01.01.1990 00:00:00:000 |
SeqCnctIn | Update indication Indicates (rising edge) when a value is removed from the buffer. | Boolean | 0 |
|
BaObjRef | BA-Object reference | Structure | --- |
BaObjRef | Device identifier | Double Word | 16#3FFFFF |
BaObjRef | Object identifier | Double Word | 16#3FFFFF |
BaObjRef | Item identifier | Integer | -1 |
Output | Description | Data type | Default value |
|---|---|---|---|
|
Val1...Val4 | Value 1...Value 4 Resulting value from the evaluation function selected in [EvlFnct1]...[EvlFnct4] | Real | 0.0 |
|
UpdInd | Update indication Indicates (with an impulse) when a new value is added to the internal buffer. | Boolean | 0 |
|
RecCnt | Record count Provides the number of sampled values collected in the buffer. | Integer | 0 |
|
FstVal | First value Provides the first (earliest) value in the buffer. | Real | 0.0 |
|
LstVal | Last value Provides the last (most recent) value in the buffer. | Real | 0.0 |
|
FstTiStm | First time stamp Provides the time when the first (earliest) value in the buffer was sampled. | DateAndTime | 01.01.1990 00:00:00:000 |
|
LstTiStm | Last time stamp Provides the time when the last (most recent) value in the buffer was sampled. | DateAndTime | 01.01.1990 00:00:00:000 |
Dstb | Disturbed [Dstb] indicates whether the referenced BACnet object was accessed. | Boolean | 0 |
|
SeqCnctOut | Sequence connection output Provides values for the next function block in a sequence. | Structure | - |
SeqCnctOut | Connected Indicates if a pin is connected. | Boolean | 0 |
SeqCnctOut | Removed value Removed value from the buffer | Real | 0.0 |
SeqCnctOut | Removed time stamp Removed time stamp from the buffer | DateAndTime | 01.01.1990 00:00:00:000 |
SeqCnctOut | Update indication Indicates (rising edge) when a value is removed from the buffer. | Boolean | 0 |
ErrCode | Error code indication | Integer | 0: No error |
= 0 - No error | |||