Skip navigation
All Places > PI Developers Club > Blog > Authors cnelson

PI Developers Club

2 Posts authored by: cnelson Employee

 

 

Hello Community!!!

 

 

 

First, let me apologize for my lack of blogging since my original post in 2009!  I had high hopes of monthly posts, but that faded away as the Event Frame work load grew :)

 

 

 

Second, thanks for your excellent feedback, ideas, and thoughts around Event Frames.  As I have said at the numerous conferences and events I presented at - we may not always get back to you but we in Engineering are all reading and listening to the conversations.  You have greatly aided us in focusing our attention in the right places to get the features that you need.

 

 

 

Last before we get to the subject matter, I hope you all have been monitoring the Product Roadmap and are anticipating the upcoming release of PI AF 2010 R3 which will officially release PI Event Frames.  Leading up to this release, I will be blogging on several topics that you need to be aware of.  This first post is by far the most important because we have changed some behavior in the AF-SDK in relation to Event Frames based on internal design reviews. 

 

 

 

This will be the summary of this post that you need to take away:

 

 

 

IF YOU HAVE BUILT AN APPLICATION AGAINST THE AF-SDK 2.3 OR BELOW THAT USES ANY OF THE AFEVENTFRAME.FIND… METHODS, YOU WILL NEED TO RECOMPILE YOUR APPLICATION AGAINST THE AF-SDK 2.4.

 

 

 

The rest of this post goes into details on why we made these changes and what these changes are.

 

 

 

In AF2.3, we added paged searches for Event Frames so we added additional method signatures.  Including the FindEventFramesbyAttribute method, this caused the number of find methods to go from 4 to 8. 

 

 

 

During the design process, the team has always been frustrated by the number of overloads because it limits the usefulness of intellisense and confuses the programmer. 

 

 

 

In AF 2.3 we have the following list of searches:

 

FindEventFrames(AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32)

Performs a search within the AFDatabase to retrieve a non-paged collection of AFEventFrame objects that match the specified query string.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Boolean, String, String, AFCategory, AFElementTemplate, Boolean)

Retrieves a non-paged list of AFEventFrame objects limited to the specified count beginning at the requested start time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32, Int32, Int32)

Performs a search within the AFDatabase to retrieve a paged collection of AFEventFrame objects that match the specified query string.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Int32, Boolean, String, String, AFCategory, AFElementTemplate, Boolean, Int32)

Retrieves a paged list of AFEventFrame objects limited to the specified count beginning at the requested start time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, AFSearchMode, Object, Object, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], Boolean, AFSortField, AFSortOrder, Int32)

Retrieves a non-paged list of AFEventFrame objects that match the specified filtering conditions.

FindEventFrames(AFDatabase, AFEventFrame, AFSearchMode, Object, Object, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], Boolean, AFSortField, AFSortOrder, Int32, Int32, Int32)

Retrieves a paged list of AFEventFrame objects that match the specified filtering conditions.

FindEventFramesByAttribute(AFEventFrame, AFSearchMode, Object, Object, String, String, AFDurationQuery[], AFAttributeValueQuery[], Boolean, AFSortField, AFSortOrder, Int32)

Performs a search on the event frame's name and attribute value within the AFDatabase to retrieve a non-paged collection of AFEventFrame objects.

FindEventFramesByAttribute(AFEventFrame, AFSearchMode, Object, Object, String, String, AFDurationQuery[], AFAttributeValueQuery[], Boolean, AFSortField, AFSortOrder, Int32, Int32, Int32)

Performs a search on the event frame's name and attribute value within the AFDatabase to retrieve a paged collection of AFEventFrame objects.

 

 

In AF2.4, we have made two changes.  First, to support an enhancement request of searching backward and forward using the end date, we added a new method and obsoleted two related methods.  This new method takes an enumeration, AFEventFrameSearchMode which has four settings:

 

Member name

Value

Description

None

0

This is the value of an uninitialized search mode.

BackwardFromStartTime

1

Event frames less than or equal to the start time (moving backward in time) are returned from the search.

ForwardFromStartTime

2

Event frames greater than or equal to the start time (moving forward in time) are returned from the search.

BackwardFromEndTime

3

Event frames less than or equal to the end time (moving backward in time) are returned from the search.

ForwardFromEndTime

4

Event frames greater than or equal to the end time (moving forward in time) are returned from the search.

 

 

Below is the list of new methods for AF2.4 relating to these Event Frame Search methods.  We have decided to remove the Obsoleted methods in AF2.4.

 

Name

Description

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, AFEventFrameSearchMode, String, String, AFCategory, AFElementTemplate, Boolean)

New Method using AFEventFrameSearchMode

Retrieves a non-paged list of AFEventFrame objects limited to the specified count beginning at the requested time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Boolean, String, String, AFCategory, AFElementTemplate, Boolean)

Obsolete.

Retrieves a non-paged list of AFEventFrame objects limited to the specified count beginning at the requested start time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Int32, AFEventFrameSearchMode, String, String, AFCategory, AFElementTemplate, Boolean, Int32)

New Method using AFEventFrameSearchMode

Retrieves a paged list of AFEventFrame objects limited to the specified count beginning at the requested time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Int32, Boolean, String, String, AFCategory, AFElementTemplate, Boolean, Int32)

Obsolete.

Retrieves a paged list of AFEventFrame objects limited to the specified count beginning at the requested start time in the specified direction.

 

 

The second and biggest change occurred on how we implemented paged searches for Event Frames.  After several internal design reviews, the team came to the conclusion that the original design that included passing back the TotalCount was counter productive to why we implemented paging in the first place, to increase performance and scalability. 

 

 

 

Including the total count is very expensive because it requires processing the entire history of event frames, which grows over time.  Because of this, we decided to remove the TotalCount output parameter.  When doing this, we realized we had an opportunity to reduce the # of overrides which is very confusing to the programmer.  So, currently we decided to change the method signatures for AF2.4 from 8 back down to 4 to reduce complexity.

 

 

 

In AF 2.4 we have the following list of searches:

 

Name

Description

FindEventFrames(AFDatabase, AFEventFrame, String, AFSearchField, Boolean, AFSortField, AFSortOrder, Int32, Int32)

Performs a search within the AFDatabase to retrieve a paged collection of AFEventFrame objects that match the specified query string.

FindEventFrames(AFDatabase, AFEventFrame, Object, Int32, Int32, AFEventFrameSearchMode, String, String, AFCategory, AFElementTemplate, Boolean)

Retrieves a paged list of AFEventFrame objects limited to the specified count beginning at the requested time in the specified direction.

FindEventFrames(AFDatabase, AFEventFrame, AFSearchMode, Object, Object, String, String, AFCategory, AFElementTemplate, AFDurationQuery[], Boolean, AFSortField, AFSortOrder, Int32, Int32)

Retrieves a paged list of AFEventFrame objects that match the specified filtering conditions.

FindEventFramesByAttribute

Performs a search on the event frame's name and attribute value within the AFDatabase to retrieve a paged collection of AFEventFrame objects.

 

 

So, the biggest ramification is that you will need to change your application code to reflect these new method signatures.  We are removing the old ones in order to start with a clean slate.  So your application code will not be compatible with AF2.4 unless these changes are made.

 

 

 

The design pattern that we implemented is applicable for paged and non-paged searches, basically all searches are paged depending on the pagesize.  All Find Methods now have two parameters that control the behavior of paging, startIndex and maxcount.  All initial searches should use 0 (zero) as the startindex and maxcount should be equal to requested pagesize.  Realize that performance is directly impacted by the size of your return set which is controlled by the maxcount parameter. 

 

 

 

If the count of your return set equals the maxcount parameter, there is most likely more results that need to be retrieved.  To get these additional results, you must make a subsequent call setting the startindex equal to the previous startindex plus maxcount.

 

 

 

So, in summary, just to be perfectly clear, PI AF2.4 will be the first production version of PI Event Frames.  If you have written applications against the CTP versions of PI AF that include Event Frame features and functions you will need to upgrade them to use PI AF2.4.  So please let me end with my overblown bold statement:

 

 

 

IF YOU HAVE BUILT AN APPLICATION AGAINST THE AF-SDK 2.3 OR BELOW THAT USES ANY PI EVENT FRAME FEATURES, YOU WILL NEED TO RECOMPILE YOUR APPLICATION AGAINST THE AF-SDK 2.4.

 

 

 

We are getting real close!!!!!!!!

 

 

 

 

 

 

 

 

For those of you who know me, hopefully you can get an understanding of  how excited I am with this Event Frame CTP announcement.  I am generally an excitable person, but I really get excited when discussing Event Correlation Analysis and that's exactly what Event Frames is meant to enable within the PI System.  There have already been some questions on what we are trying to accomplish with Event Frames, I'd like to shamelessly plagiarize from my good buddy Chris Coen who is much better at speaking (and writing) English than myself:

 

 

 

"Event Frames allow you to name, store, organize, search and analyze important time periods.  That way you can study the real-time and external data that happened during or led up to these events without needing to first look up the time ranges.  PI does that for you.  It's like a way of indexing the supporting real-time data so you can look it up in terms of your business rather than by trying to remember the time periods when they occurred." 

 

 

 

First we need to have a level setting discussion; i.e. is this production ready code?  This CTP is a great milestone for the Event Frames Initiative and I don't want to understate its importance; but there is still a lot of development work that needs to be completed before there is a production release of  Event Frames worthy of the OSIsoft name.  This will be the subject of future posts!

 

 

 

The Event Frames team has dedicated the past three years working with numerous customers and partners to feed product requirements, use cases, and user scenarios.  We've used this information to create this initial CTP and we would like to politely focus your attention in two areas 1) General Event Frame Functionality and 2)  Object Model Data Access.  We are working on a lot of other areas, but these two are the main focus of this CTP.

 

 

 

The first thing you will need to accomplish is creating Event Frames.  In order to get your creative juices flowing, I've created a simple Event Frame Simulator Application.  I will be demonstrating this simulator during the Event Frames webinar; but I wanted to share the code in order for you to get a jump start on using Event Frames.  We also used this simulator for the Event Frames Learning Lab at the OSIsoft vCampus Live! 2009 event(Which by the way was a fantastic event.  I've been to every OSI conference or event since 1997, except for 2 because of my wedding and my daughter's birth and this was one of the best I've ever attended) .

 

 

 

The Event Frames Simulator will create Downtime Event Frames on Elements based on a chosen Element/Event Frame Template and/or Element Category.  Although the simulator is initially focused on downtimes; I have made it flexible so you can use other Templates in order to experiment with the functionality.  The Simulator can be found here.  

 

 

 

Important to note that the primary User Interface for this CTP is PI System Explorer.  Event Frames functionality is fully documented within AF 2.1 User Manuals and Help files.

 

 

 

That's all I have for now.  I invite you to experiment with Event Frames in AF 2.1 and please provide us with your feedback on the Event Frames Development discussion forum.  We will be checking it!

 

 

 

PS - If I may ask; okay I will - The Event Frames team is extremely interested in hearing your ideas on User Experience!!  As I said in the beginning; I'm a big proponent of Event Correlation Analysis and Event Frames enable this by providing the time duration.  I'm really interested to hear ideas from our customers and partners.  Maybe that's a good idea for a discussion post, HINT, HINT!!!!

Filter Blog

By date: By tag: