Function Blocks 
CAVG Continuous Average Function Block 
Revision 11    HC900 Hybrid Control Designer Function Block Reference Guide  117 
2/07     
CAVG Continuous Average Function Block 
Description 
The CAVG label stands for Continuous Average.  
 
 
 
This block is part of the 
Calculations category. 
Function 
Provides the average value of a single analog parameter for a user specified time period, plus the running 
(instantaneous) average within the time period.  A running average value is updated at the end of each 
sample period.  Time periods to 1440.0 minutes are supported.  At the end of the time period, the running 
average value is transferred to I/O process output value. A hold input allows excluding samples from the 
average when active. 
Cold Start – On the first cycle after a cold start, the instantaneous average output is initialized to current 
input value, the sample counter begins to increment, and the period timer begins to decrement (assuming 
that Reset is OFF). The previous average output is set to zero. 
Warm Start – On a warm start, the calculations continue where they left off. There is no attempt to 
compensate for the time the power was off or to resynchronize with the time of day. 
Input 
INPUT
 = Analog Input 
RESET = Controls the sample calculations.  
If 
OFF, the input samples are accumulated, the sample counter is incremented, the time remaining 
decrements and the average value is calculated and written to the outputs. 
If 
ON, the outputs are held at their last values, the internal accumulators and sample counters are 
cleared, and the time remaining is re-initialized to the full average period. 
If 
ON to OFF transition, the average output is set to the input value, and the period timer begins to 
decrement. 
The RESET pin does not affect the previous average output value. 
HOLD = If OFF, calculations run as normal. If ON, input samples are not accumulated and included in the 
average calculation, the time remaining continues to decrement. The output values are held at their last 
state prior to the OFF to ON transition. 
If the averaging period elapses while 
HOLD is ON, the instantaneous average will maintain the last 
calculated average value, the previous average is updated to this value, the internal accumulators and 
sample counters are cleared, and the time remaining is re-initialized to the full averaging period. 
Output 
I AVG
 = Instantaneous calculation of the current average. 
P AVG = previous calculated average value.