Displaying attributes in PI Vision created by formulas in PI AF is too slow.

I am using PI AF to get an attribute value that I will display in PI Vision. The attribute is obtained from many formulas and table lookups. I am working on a heat exchanger "U" coefficient and it is calculated correctly, but I am having some problems when I want to show a trend for the last 2 years. I included attributes from daily TagAvg to reduce the amount of calculations, but this is not enough.

  • There could be a variety of reasons for things being slow. I see you used the tag "PI AF Analysis" but you also mention Formulas and Table Lookups, as well as a TagAvg.

     

    Depending upon the nature of a data request, the Formula Data Reference could be slow. And while many Table Lookups is usually fast enough, a poorly written one could also be slow.

     

    If performance is a concern, I would suggest migrating calculations to one or more AF Analytics and to persist the calculation(s) back to a PI Point. This is especially true for anything used for aggregation, e.g. tag averaging. Again, this may involve having staggered calculations to focus on and persist individual parameters that will be fed into the heat exchanger "U" cofficient calculation.

  • Thank you very much for your reply.

    I am new to PI AF and I want to understand some issues.

    • Is Analysis the best way to do calculations in PI AF?
    • Many formulas are [RoundFrac(A,3)], but others are more complex. Is it better to migrate to Analysis than to make formulas data references?
    • I have some permission issues to do PI Points, that's why I preferred to use Attributes, but I think it might be a better option and I could request it.

    I will be looking for the best option. Thanks again.

    Regards.

  • There is no real easy answer here. Some will say never use Formula but some simple calculations using 1 input argument, a Formula can be just performant as an Analysis. In your case of a Formula that is basically calling RoundFrac(A, 3), this sounds acceptable.

     

    Granted, this can be complicated if you have multiple inputs, or if you have a single input that is not a PI Point, but itself another Formula or Table Lookup. And when I say PI Point, I mean the recorded value, not an aggregate (e.g. average) which you can configure for an AFAttribute using the PI Point Data Reference.

     

    Again, short, simple Formulas are okay in my book. But Analyses allow for IF-THEN-ELSE constructs, and some other benefits such as working with String data, which Formulas cannot use.

     

    If you have sluggish performance, I would suggest a careful review where you consider where and when all the data is coming from and what is being done with that data. Don't just look at what AFAttribute is being fed into it as Parameter A. Is that AFAttribute a PI Point, an aggregated PI Point, or itself another Formula or Table Lookup? That is to say, try to trace down all the dependencies of inputs.

     

    Are there any aggregations or rolls ups needed? These are performance killers. If you use these, the best advice to to run the aggregation or rollup and then save the calculated results to a PI Point. That is to say, the calculated value is persisted or cached so that it can be quickly fed down the line to other parts of the overall calculation.

  • Ok. I will change the formula for analysis.

    The RoundFrac formula is needed only to show the results in notifications, because I can't change the displayed digits, but I think I can use attributes for analysis fed by non-rounded PI Points.

     

    Thanks a lot.