Avg - method of the tvPoints object

Returns the average value calculated from values according to the sFilter parameter.
Double Avg(String sFilter)
sFilter(String) Filter of values that are to be included into the processing.
"all" - All values in the buffer.
"visible" - All values that are in the time of calling the method in the visible part of the buffer.
See also:
- tvTrend.Points (property)
- tvPoints.Max (method)
- tvPoints.Min (method)
- tvPoints.Count (method)
- tvPoints.Sum (method)
The example calculates the average value, minimum, maximum, sum and number of all points of the "t1" trend in the visible part of the viewer.
JavaScriptVBScriptSelect and copy to clipboard

var nAvg, nMin, nMax, nSum, nCount;
var oTView = pMe;
var oPoints = oTView.Trends("t1").Points;
nAvg = oPoints.Avg("visible");
nMin = oPoints.Min("visible");
nMax = oPoints.Max("visible");
nSum = oPoints.Sum("visible");
nCount = oPoints.Count("visible");
PROMOTIC 9.0.13 SCADA system documentation - MICROSYS, spol. s r.o.

Send page remarkContact responsible person
© MICROSYS, spol. s r. o.Tavičská 845/21 703 00 Ostrava-Vítkovice