4 Replies Latest reply on Feb 25, 2015 8:42 PM by gachen

    Finding zero duration eventframes?

    Roger Palmen

      Hi All,

       

      I've been looking at AFElement.GetEventFrames, and the AFSearchMode and found this note:

      Note that objects which end on the search start time or start on the search end time are not included as part of the returned collection

      So what if i have an EventFrame where the Start- and Endtimes are equal (duration=0)? Then this method won't be able to find that EventFrame. The second overload using AFEventFrameSeachMode would, but that would only allow me to find any events from a timestamp forward or backward in time, while i know i look for EventFrames at a specific time.

       

      Not that this is an issue, but just wondering if i'm overlooking anything obvious.

        • Re: Finding zero duration eventframes?
          skwan

          Roger:

           

          What are you using a zero duration event frame for?  We have had many debates internally on this.  Conceptually an "event" that has no duration is difficult for me to understand - it's more like an alarm.  I always ask myself whether we need something different than event frames.........

           

          --

          Steve Kwan

          AF Product Manager

          • Re: Finding zero duration eventframes?
            Rick Davin

            Move the search start back 1-second, and the search end forward 1-second.  You may get back a few more event frames than you wanted, but you can add your own filter on the returned collection once its within your grasp.

            1 of 1 people found this helpful
            • Re: Finding zero duration eventframes?
              Roger Palmen

              Rick, thanks for that idea. Of course, it can be that simple....

               

              Stephen, Well, an event can have a zero duration, and you could perfectly use that for lots of stuff, including alarms. E.g. pushing a button: the downpress functionally has a zero duration. Even if you look at the PI data of a switch, you can see a PI point going to closed at time X, and going to open at time Y, having 2 PI Point Events. But still the time the button was pressed is time X.

               

              Not really an issue found yet, but i noticed this implied assumption in the note. So i started wondering if by concept, zero-duration EventFrames are in the set of scenarios for EF. If it's not really supported, we should stay clear of that.

              • Re: Finding zero duration eventframes?
                gachen

                It seems like I was able to find a zero duration Event Frame with the AFSearchMode of "Inclusive". After creating an Event Frame that referenced "myElement" with a start and end time of "25-Feb-2015 12:31:00", I was able to find it using the following method:

                 

                myElement.GetEventFrames(AFSearchMode.Inclusive, "25-Feb-2015 12:31:00", "25-Feb-2015 12:31:00", "*", null, null, AFSortField.Name, AFSortOrder.Ascending, 0, 10)
                

                 

                However, any other search mode apart from "Inclusive" does not work.