Skip to Main Content
AVEVA Product Feedback


Status Declined
Created by Guest
Created on Aug 20, 2022

Equivalent to TagTot using multiplication, for example, to calculate a geometric mean

TagTot will provide the sum of event values for a given time range. Customers wishing to calculate the geometric mean could use an equivalent function that multiplies each value together. Additionally, a specific geometric mean function may be useful as well. (this would include taking the result to the power of (1/n) where n is the number of events in the calculation. Potential caveats include both floating point precision issues, as well as overflowing a double data type. The calculation may also be quite complicated if the input tag has very frequent events. A possible workaround at this time would be to import the data into Excel using DataLink and use the built in GEOMEAN function. Other options include custom applications or ACE calculations.
  • ADMIN RESPONSE
    Aug 20, 2022
    The current release of AF has the ability to calculate event based and time based averages. At this time, we have no plans to add a new function for geometric mean.
  • Attach files
  • Guest
    Reply
    |
    Aug 20, 2022
    Another workaround: Suppose that your data tag is A. Create an event-triggered expression analysis that outputs ln(A) to tag B. Then use TagMean(B, start, end) * EventCount(B, start, end) to sum the raw, uninterpolated values of B in between the "start" and "end" times. Store this in variable C. In variable D, calculate e^C to get the product of the raw, uninterpolated values of A between the start and the end times. "ln" is called "Log" and "e^" is called "Exp" in PI System Explorer. We take advantage of these properties of logarithms: ln(a) + ln(b) + … = ln(a * b * …) e^ln(a * b * …) = a * b * … There is no function that sums the raw, uninterpolated values of a tag, but there is a function (TagMean) that averages the raw, uninterpolated values of a tag. Multiplying by TagMean by EventCount gets us our sum, assuming that none of your events are system digital states.