I want to create an attribute in my Event Frame, which is capturing the amount of seconds an attribute of the Primary Referenced Element was TRUE during the Event Frame.
Is this possible?
You can use string builder attribute and use time substituted parameters like %UtcStartTime:O% etc..to capture start time of the event and use formula to get the duration between the current timestamp if end time is empty else calculate the different between start and end time.
KB01884 - Output Event Frame Start Time, End Time, and Duration to a PI Tag
One of the best blog by @Rick Davin on this topic : Duration attribute on an Event Frame - Part 1
Additional reference :
Thanks for your reply Lal.
But that was not what I was asking for. Besides, there is a substitution attribute %Duration% available to capture the EF duration.
I'm asking for the total time an Primary Referenced Element attribute is TRUE during the Event Frame.
Now I have implemented it using an Analysis, storing the result in the Archive. Wondering if it's possible to calculate in the EF itself.
Lal was on the right track but left out some details. You can starting with PI AF 2017 R2 and newer using the "Outputs at close" functionality on Event Frame Generation analyses. With this, you can write an expression that outputs to an Event Frame attribute at the close of an Event Frame. You can reference 3 distinct parts of the Event Frame using syntax like:
The logic of the analysis would then look something like:
Is this what you are looking for?
That would have been usefull when creating EF out of the Analysis service. To build an batch hierarchy with parent/child events, I use PIEFGen to generate the events.
The way it's implemented now is working fine, but it will use a few PI Tags which is not preferred.
If you are looking for solutions that have to rely on certain technologies like EFGen, I think its fair that you state that in your original question. Regarding the need for PI tags, you have the option of storing or not storing the output of the analysis. If you choose to not store the history, the calculation result will be saved to a static data reference. That all being said, you can't achieve this without the analysis service.
Retrieving data ...