AnsweredAssumed Answered

How can I access PI tag attributes through a AF formula?

Question asked by SvenBatalla on Sep 24, 2015
Latest reply on Sep 29, 2015 by SvenBatalla

I have an element template in PI AF.  I am attempting to create an attribute to that element that uses the "Formula" data reference.  While the overall formula will be more complex that what I state in this post, the crux of it lies in the ability to access PI tag attributes.  I need some help here.


The core purpose of the formula is to compare a value to a set of limits (high and low).  It is possible that one of the limits is not set.  In such an event, I need to use the zero/span limits in PI instead.  So for example, if the user has neglected to provide the high limit, I'll use the ZERO and SPAN attributes of the source tag.  Here's the syntax I would have liked to use (based loosely on an AF analysis template):


C=Low Limit;[if(badval(C)) then TagZero(C) else C]


This raises the error:


Variables have to be separated by operators.


The reason is simply that the "TagZero" function doesn't exist.  So how do I get the PI tag attributes without using the AF Analysis capability?  On a related note, since it will be in the back-end of the formula, how do I get the previous value of the source tag?