Skip navigation
All Places > PI Developers Club > Blog > 2011 > August
2011

 

 

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!!!!!!!!

 

 

 

 

 

 

Hello,

 

PI ACE 2010 R2 SP1 has been released and is a recommended upgrade from or to be used instead of PI ACE 2010 R2. More information over on the tech. support website: http://techsupport.osisoft.com/Bulletins/5/aaa502f4-cc8d-4be8-aa97-d38e44877a6e.htm. PI ACE 2010 R2 SP1 is also available here on vCampus.

 

Work continues on PI AF scheduled configured analytics, whereby a user can configure an analytic using PI AF, schedule and write the result via a PI AF attribute to a PI tag.  The vision includes simplyfing the work required to build an analytic (less programming) and enable more people to create their own analytics.

 

When exploring who actually creates analytics with the PI System, it appears to come down to - not suprisingly - who actually 'can do it' and who knows 'how to do it'! Just because I know the PI System doesn't mean I have access to create my own analytics, whereby access is to the required software, the ability to create tag(s) and or create PI AF content. Reasons we've heard include division of labour/processes and what could be interpreted as 'don't mess with the system, we have critical monitoring we don't want broken!"

 

So, do we need to help customers see how by using security they can protect existing configuration while allowing users to create analytics and/or provide a 'sandbox' that an Engineer can work in for that two week project or to explore new analytics that can later be applied across the system or process and onto other sites.

 

In the end the goal is the same, simply the implementation and management of analytics.

 

Do you have examples of different types of users who create analytics with the PI System? For example Operators, Maintenance or Process Engineers. Is anytyhing limiting your end-users from creating their own analytics? A big part of our job is speaking with customers about the business problems they have and how we can deliver product to help solve them. If you would like to provide feedback or input, please let us know!

 

Regards,
--
Glenn Moffett | OSIsoft - Product Management

"When I helped design the PC, I didn't think I'd live long enough to witness its decline. But, while PCs will continue to be much-used devices, they're no longer at the leading edge of computing. They're going the way of the vacuum tube, typewriter, vinyl records, CRT and incandescent light bulbs.", said Mark Dean, one of the original designers of IBM PC and current CTO for IBM in Middle East and Africa. Out of the total 9 patents for IBM PC he holds 3.

 

What do you make of this prediction? The typewriters and vinyl records have almost vanished everywhere. Do you see it coming for PCs in the next decade? To read more see here.

Ahmad Fattahi

Nostalgia!

Posted by Ahmad Fattahi Employee Aug 10, 2011

2158.Old-Products.jpg

We are drowning in data and starving for information. There are potentially invaluable knowledge and undiscovered relationships hidden in the data already stored in the PI System. The complexity and volume of data makes it formidable for naked eye or classic tools to discover and extract such multivariate relationships.

 


Machine Learning is an umbrella term referring to methods to learn from previous observations and apply the extracted structure for future predictions. For example, I may be able to observe and archive temperature, day of the week, time of the day, season, fuel price, and the going price of electricity in a certain region. Machine learning allows me to deduce a relationship among these variables, build a model, and use it to predict the going price of the market in presence of observations of other variables.

 


As another example I could make observations of various physical variables of my device such as pressure, temperature, viscosity, flow, etc. as well as my device’s status, i.e., failure or functional. All the data is stored in PI System. I can use these past observations to teach my model. Later on I apply my measurements of current physical variables to predict the chances of my device going down. I can then use this result to schedule preemptive maintenance.

 

Do you have other examples that building such a predictive model can help you? We are about to publish a white paper on performing machine learning on PI Data and would love to hear your opinion.

OSIsoft vCampus Live! 2011 is scheduled for 30th November to 1st December in San Francisco! 29th November will be the pre-conference registration day. We are creating the event based on the feedback collected from the community. It will be a new and better format focusing on more hands-on presentations compared with last year.

 

More details and the registration information will be announced soon!

It's been just over a year since news of "Stuxnet" rocked the world and the industrial control system community.  How did this destructive computer worm change your profession?

 

On personal introspection developers of mission critical applications might look back at the year and believe nothing has changed because of Stuxnet... after all, their code wasn't the target. Perhaps others can honestly reflect on having taken a pragmatic approach in review of Stuxnet related exploits and their development practices: no hard coded credentials in my app ; my program files can't be easily spoofed or planted ; my code signing key is secure ; my application doesn't require administrator ; my application always shows correct information .

 

Kudos if you fall in the latter camp and believe Stuxnet is a call to action for building more secure applications.

 

Unfortunately, it's my opinion the profession of criminal hacking was most lifted by Stuxnet.  We may never agree on why programmers might choose a career path that can result in such perilous consequences.  The bigger question is how well and how quickly our profession adapts to overcome the will of intelligent cyber adversaries.

 

Learning more about offensive cyber tactics and forcing security failures can help us improve defensive programming skills.

 

One idea is to occasionally offer contest based challenges within the vCampus community. Some of the contests would be targeted to advance more secure PI Systems. We don't envision anything as intense as Defcon's 'capture the flag' but we hope there will be enough intrigue to capture your interest and participation.

 

Feel free to comment on merits of this approach and post ideas you think might be useful.  For preparation in the meantime you might want to brush up on SQL injection tactics!

Filter Blog

By date: By tag: