Unitary | Pre-APOGEE | APOGEE | BACnet | PXC.A |
---|---|---|---|---|
| ● | ● | ● | ● |
Syntax
TIMAVG(result,st,samples,input)
result | A point name used to store the result of the average value. - This parameter can be a point name or a local variable. |
st | Sample time. This is the time, in seconds, between each sample. - This parameter can be an integer, a point name, or a local variable. |
samples | Number of samples to be used to calculate the average. - This must be an integer between 1 and 10. |
input | Point name whose average value is to be calculated. - This parameter can be an LAI or LAO point or a local variable. |
Use
This command is used to find an average value over time. You decide how often the values should be taken (sample time) and the number of values to be taken.
The average is always over the most recent sample count and all previous values are discarded.
Example
In the following statement, RMAVG would change every 600 seconds (assuming RMTEMP is changing frequently). The average value (RMAVG) will also be updated every sample time.
10 C SIX SAMPLES WILL BE TAKEN TO
20 C CALCULATE THE RMAVG.
30 C THE INTERVAL BETWEEN EACH SAMPLE
40 C WILL BE 10 MINUTES. RMTEMP WILL
50 C BE AVERAGED EVERY 60 MINUTES.
60 TIMAVG(RMAVG,600,6,RMTEMP)
Notes
On a return from power failure, after an ENABLE command, or during the first execution of PPCL following a database load, the TIMAVG command begins executing with one sample. The value of the result will equal the current value of input.