1 of 1 people found this helpful
You are using a relative attribute reference with the PI Point data reference. What you are observing is intentional - you will not be grabbing the value from the event frame (regardless of whether it was captured). Instead the %variables% are first resolved to refer to an actual PIPoint, and then the DR will fetch the current value directly from that underlying PIPoint rather than the relative attribute. That explains the behavior you witness.
Likewise, String Builder resolves to a string value and may be composed of many attribute values. In your case, you've defined it to one attribute, namely the event frame attribute. String Builder does not then redirect to the underlying PIPoint but does asks the attribute for its "current" value. Given that the value is on an event frame, it's current value is based somewhere between Start and End Time, depending on how you configured it. You may have to convert the string to a Single or Double. It doesn't surprise me that String Builder works as it does. It was nice news to hear it works for Formula.
The difficulty with grabbing an attributes value from "an" event frame is that it may not be an "an", with the hopeful implication of only being one. Rather the element may have many, many event frames with the same or different template, and even with similar names. Which makes it difficult to pick the one from the many. Note the reverse is easy - an event frame can easily refer to an attribute from its primary referenced element because there truly is only one.
Also, you use %Server% which refers to the name of the data archive (PIServer). I am going to guess its the same name as your AF Server (PISystem) since you have many backslashes to reference Database and Element. This works because your %Server% and %System% currently use the same name, but I would suggest that %System% is the correct variable. If you ever split apart the data archive and AF Server to where they have different names, your expressions would no longer work.
Thanks for the clarifications.
Still need to hone my intuition when it comes to what AF and EF should and do do.
(Insert Beavis/Butthead laugh here).