AnsweredAssumed Answered

AF-SDK returning wrong Event Frames with AFElement.GetEventFrames()

Question asked by GeethaDean on Apr 17, 2015
Latest reply on Jun 1, 2015 by asorokina

I am using the AF-SDK to read Event Frames. My problem is that the Event Frames that are being read do not match up to the Event Frames that I view in the PI System Explorer. For example, the AF-SDK will read 5 Event Frames over a timerange, but when I check in PSE I will see 3 Event Frames with start and end times that do not match up.

 

I have checked and double checked whether or not this is a timezone issue and I am confident in saying that it is not. I have supplied my code below - hopefully someone can point out where I am going wrong.

 

private AFNamedCollectionList<AFEventFrame> FindExceptions(AFElement rootElement, DateTime start, DateTime end, bool openOnly = false, bool recurse=true)
{
   AFCategory category = null;
   AFElementTemplate template = null;
   template = _AFDB.ElementTemplates[ValidationExceptionEventFrameTemplateName];

   AFNamedCollectionList<AFEventFrame> frames;
   frames = rootElement.GetEventFrames(AFSearchMode.Inclusive,
                                       new AFTime(start.ToUniversalTime().Ticks),
                                       new AFTime(end.ToUniversalTime().Ticks),
                                       "",
                                       category,
                                       AFSortField.StartTime,
                                       AFSortOrder.Ascending,
                                       0,
                                       1000);

   return frames;
}

Outcomes