[AVRG_PRD] Average of a period
Function block AVRG_PRD calculates the average value and integral value for an analog value within a specific time period.
AVRG_PRD calculates the average value and integral value for an analog value within a specific time period.
Enable and disable the function
The average value and the integral value for an analog input [In] is determined within a time period if the function is enabled (EnFnct and EnEvl = 1) and the analog input signal is reliable (Vldty = 1).
Calculation
The average value for the present time period is displayed on [PrAvrg].
After the time period has expired, the present average value is saved via a pulse as average value for the recent time period [RctAvrg] and the pending input value is set as new average value. The integral (via time) of the analog input signal is generated as an additional information and displayed via [PrIntg]. At a pulse, the present integral value is saved as integral value of the recent time period and set to value (1/CalcIvl [in seconds]) x valid value at input [In]. The calculation interval [CalcIvl] is 1 hour, which can be set to 0.0167 for 1 minute. The time period, generated outside of AVRG_PRD, is determined via a rising slope on the input [Imp]. If the input signal is invalid (Vldty = 0), the calculation stops. The last valid values from the outputs are frozen until the signal is valid again.
Subperiods within time periods
Input [EnEvl] can be used to evaluate subperiods within the entire time period. When EnEvl = 0, the evaluation is disabled and the last valid values are displayed at the outputs. At a pulse, the present average and integral value are saved as values from the recent time period.
Reset
All present and recent values are set to zero via a rising slope on input [Reset].
Input | Description | Data type | Default value |
|---|---|---|---|
EnFnct | Enable function Enables the function. | Boolean | 1 |
0 - The function is disabled. | |||
EnEvl | Enable evaluation | Boolean | 1 |
0 - Evaluation is disabled and the valid values at the outputs are frozen. | |||
In | Input Input signal | Real | 0.0 |
Imp | Impulse Pulse input for which the evaluation time period is determined. The rising edge indicates start of new period. | Boolean | 0 |
0 - No | |||
|
Vldty | Validity The average and integral values from the present and recent time periods can only be calculated with a valid input signal. | Boolean | 1 |
0 - The input is not valid. | |||
CalcIvl | Calculation interval Converts the results at integral outputs. Possible calculation interval, e.g. 0.0167 for 1 minute | Real | 1.0 0.0167...3.70E38 |
Reset | Reset All values are reset to zero. | Boolean | 0 |
0 - No | |||
Pers | Persistent | Boolean | 0 |
0 - No | |||
|
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 |
|---|---|---|---|
PrAvrg | Present average | Real | 0.0 |
RctAvrg | Recent average | Real | 0.0 |
PrIntg | Present integral | Real | 0.0 |
RctIntg | Recent integral | Real | 0.0 |
Dstb | Disturbed [Dstb] indicates whether the referenced BACnet object was accessed. | Boolean | 0 |
ErrCode | Error code indication | Integer | 0: No error |
= 0 - No error | |||
AVRG_PRD is used to calculate the average and integral values for a time period. By displaying present and recent values from a particular time period, errors such as wrong control parameter, setpoint violations, or manual intervention, can be found earlier and faster.
The following example is based on an evaluation period = 1 day:
