AF - Would like to capture start time of first event frame each calendar day

It seems like this should be simple, but I am fairly new to AF event frames, and I've gotten lost in the weeds. I am trying to capture the start time of the first occurrence of a specific event each calendar day and write that timestamp to an attribute on the element that generated the event frame. Depending on the severity of the event, a notification including the starting timestamp may need to be sent even if the event is still ongoing.

 

Details

  • The event may occur zero or more times per day.
  • If the event occurs at least once, I want to capture the starting timestamp of the first event frame and write it to an attribute of the source element;
  • If it occurs more than once within a calendar day, the attribute value should continue to reflect the starting timestamp of the first event frame for the rest of the calendar day.
  • An event could potentially start on one calendar day and not end until after midnight that day, so it isn't feasible to wait until the end of the event frame to capture the starting timestamp using EventFrame("StartTime") function.

 

What I've tried so far...

Because I can't wait for the event frame to end to capture its start time, the solution seems to be to create a second event frame with the same trigger criteria, but to end it based on duration within a very short timeframe (say, 5 seconds or so). I can use Bod('*') to see if my currently stored timestamp is greater than midnight of the current day -- if it is, take no further action; if not, update it with the starting timestamp of the current event frame.

 

The two major hurdles that I seem to be facing:

  1. When attempting to map an output value to the source element attribute, the analysis grays out the element property. When I mouse over the property name in the "Map" dropdown, it shows the message, "Attribute template is not configured to reference a PiPoint attribute on the element." So it looks like its not possible to map a value back to an element attribute? Is it necessary to create a PI point and write the value to it instead?
  2. My attempts to set a duration for the event frame doesn't seem to work. I tried adapting an approach from an article on osisoft.com and I used the following formulation to populate a variable that I named vStartTime:

If PrevVal('Status', '*') = "Normal" Then '*' Else NoOutput()

and then subtracted that value from '*' to calculate the time elapsed:

'*' - vStartTime

and then set the following as my End trigger:

Convert(Float(vTimeElapsed), "s") >= 5

But that doesn't seem to work.

 

As I said, I've gotten lost in the weeds, so am probably far afield of where I should be. Any insight will be appreciated.

 

Thanks.