AnsweredAssumed Answered

How do I begin and end Event Frames on attribute change?

Question asked by daviessj on Jan 27, 2016
Latest reply on Feb 3, 2016 by daviessj

Hello all,

 

I am looking into how to begin and end Event Frames based on a single DateTime tag.  The tag essentially holds information of when a batch starts, with the Start Time of the next batch being the End Time of the previous one.  The main problem is that the Value can be replicated in the archive, as below:

 

TIMESTAMP                    VALUE

24/01/2016 04:44              24-Jan-2016 04:41:42

24/01/2016 11:48              24-Jan-2016 04:41:42

24/01/2016 18:48              24-Jan-2016 04:41:42

25/01/2016 01:48              24-Jan-2016 04:41:42

25/01/2016 08:48              24-Jan-2016 04:41:42

25/01/2016 15:48              24-Jan-2016 04:41:42

25/01/2016 22:48              24-Jan-2016 04:41:42

26/01/2016 00:54              26-Jan-2016 00:50:41

26/01/2016 07:58              26-Jan-2016 00:50:41

26/01/2016 13:45              26-Jan-2016 00:50:41

26/01/2016 20:45              26-Jan-2016 00:50:41

27/01/2016 03:46              26-Jan-2016 00:50:41

27/01/2016 10:46              26-Jan-2016 00:50:41

 

So in the example above there are Batch starts at 24-Jan-2016 04:41:42 and 26-Jan-2016 00:50:41, so one Event Frame should run from 24-Jan-2016 04:41:42 to 26-Jan-2016 00:50:41.  What I am attempting to do is test when the VALUE changes, so I am comparing the current value to the previous one as shown below for my Start (and End) Trigger.

 

 

TagVal('Start Time', '*') <> PrevVal('Start Time', '*') then true else false

 

The problem I am encountering is that the triggers for both the Start and End of an Event are essentially the same, since they are both testing for the same conditions  This means I am generating Event Frames with a duration of 0 seconds as the End Trigger evaluates at the same time as the Start Trigger.  Essentially I feel I need to delay the resolution of the End Trigger, but I'm not sure how this is possible.  I'm sure this problem is solvable, but I can't seem to work out how.  Does anyone have any suggestions?  I'm sure I'm missing something simple!

Outcomes