14 Replies Latest reply on Apr 27, 2016 10:12 PM by calmandrysdale

    AF Wishlist


      I thought I would start a new thread exploring the possible AF wish list. Stuff that people would like to see in AF that aren't already on the roadmap; so I won't bring up the whole AR and Attribute AR discussion (although I wish OSI would release this functionality sooner rather than later). The aim of this thread is to inspire a discussion that could potentially provide OSI's developers with some ideas on what the users of their products would like.


      First an admission. I'm not an AF expert we (myself and the company I work for) are only just implementing AF after a couple of years looking at it.


      The biggest thing I would like to see is AF is that the elements and elements templates become more object like. What I mean is that the "user" (not your average control room operator) can embed code into the element template. I’m think that the code would be target more at element configuration than calculations. When an instance of the element is created the code would do something useful. What I have in mind is more related to configuration of the AF elements; therefore there would be three methods exposed. Let's call them OnCreate, OnUpdate and OnDelete. The names are fairly explanatory, OnCreate gets called when the element is created, OnUpdate when there’s been a change to the element and OnDelete when the element has been deleted which would be useful for things like a tag cleanup (i.e. go and delete all the PI Points created by this element). This code could be entered either as a script directly into AF or as an assembly. If the community has any ideas how to achieve this within the current AF sanely I would appreciate the info.


      The second thing I would like to see is a script DR. Basically a formula DR on steroids. I find the formula DR quite cumbersome to use and would prefer to use a script type interface using my favourite .net language (C# or VB.Net). I suspect that I get the we’re considering this for AR’s response.


      I hope other contribute to this thread and that it’s useful to OSI.

        • Re: AF Wishlist

          Hi Michael:


          Thanks for you input.  Just wanted to let you know OSI is listening.  Keep the suggestions coming.



          • Re: AF Wishlist

            There is already a "Changed" event raised when an object (or one of it's children) is changed/added/deleted.  For example, if you monitor an AF Database object then when you add an element the change action would be "SubObjectAdd".  When you say that when an element is created and derived from a template that some code should be run, do you have an example of why you would do this? (I'm curious.)  Normally AF substitution text is used to configure elements derived from a template.


            For the Formula DR you could use .Net reflection to load a script and execute it based on the input variables from the formula DR.  This would be fine for users familiar with .Net but the existing Formula DR is easier for normal users to use than a script based one.  Maybe the Formula DR should be enhanced to have an "Advanced" view where you can plumb in your own .Net code.  This could even be a community project..?


            Would be good to see analyses back with some kind of scheduler that AFSDK clients can signup for updates as a schedule is executed or an event frame is generated - just like a PI server event pipe.


            I would like to see Event Frames finished but with functionality like "shifts" included as standard.  You define your site/locations then create your crews with shift rotations and the shift times.  Then the shift event frames are automatically generated with the current shift having no end time until shift handover.  It would provide a great starting point for analysing shift performance, upsets, handovers etc.  Then further on Event Frames it would be nice to associate an event frame with another - say there was a plant upset and an event frame was generated.  If that plant upset happend during a shift then may be you would want to associate that plant upset event frame with a shift event frame, when looking at the shift you would see all associated events that happened during the shift.


            I have a few more ideas but I am knee deep in event frames right now...





              • Re: AF Wishlist

                Hi Rhys,


                Thanks for the two ideas on Event Frames.  Sounds like you have been sinking your teeth into the CTP.  That's great to hear.


                We have heard the "shift" event frame use case quite often.  Having some default settings so it's easy to define your shifts is an interesting idea.  We'll consider that one.


                Now, let's talk about the idea of associating Event Frames with each other.  Event Frames support the same reference types as to AF Elements.  For example, you can choose strong, weak or compositional reference.  To support the Batch Database, you would probably use strong or compositional reference types to relate the hierarchy of Batch, UnitBatch and SubBatch (or procedure, unit procedure, operation, phase in S88 terms).  However, if you wanted to more loosely associate one Event Frame with another, the weak reference type seems right.  In that case, I believe our database and SDK already support your use case.  That is, if the plant upset event happened during a shift and you wanted to more strongly associate the upset event to the shift a event, you could add a weak reference between them.


                Again, great ideas and thanks for sharing.  If you or anyone have more feedback on Event Frames, why not jump over to the Event Frames discussion forum and drop us a note sometime.

                • Re: AF Wishlist

                  I did some simple tests using the OnChange event (basically I took the example from the AF SDK Help) and I would like to confirm what I found. If the application changes anything in AF then the OnChange event fires as expected. However, if another application (PSE in this case) makes a change the event does not fire. Is this the correct behaviour or have I done something wrong? Let me know if you would like me to add the source code (a very simple console application).


                  I must admit I was a bit surprised as I assumed that the event would fire if the AF database was changed regardless of the source of the change. If this is the case then I'm afraid that Rhys' suggest wouldn't work.


                  Rhys @ RJK Solutions

                  There is already a "Changed" event raised when an object (or one of it's children) is changed/added/deleted

                    • Re: AF Wishlist

                      Invoking the method Database.Refresh will cause your OnChange events to fire based on external changes.  AFSDK does not actively poll for changes (nor does the server push changes).  One mechanism to do this is to create a system timer to periodically invoke Database.Refresh. 

                        • Re: AF Wishlist

                          Chris, how often does PSE poll for changes? (Purely out of interest).  Also, would it be beneficial to call the "FindChangedItems" method before deciding to call the Database.Refresh method?


                          I do have a more general comment on the journey of AF.  Clearly in the beginning it was next generation MDB, with some added analysis related functionality hence it was known as analysis framework.  In v2 the focus seemed to move away from analysis framework to asset framework (or just "AF" for some people); a layer on top of the core PI server.  Now I see more and more that clients want AF as a calculation/analysis engine again, moving back towards analysis framework in my opinion.  What is OSIsoft's view on this, is this how you see AF evolving?


                          What seems to be 'dangerous' is that with PISDK you have event pipes for subscribing to data changes, from which I can imagine demand for Data Reference (e.g. PI Point DR) pushing of values to subscribers could be requested more and more if AF moves back towards analysis framework.



                            • Re: AF Wishlist

                              PSE does not poll, but requires manual Refresh (F5), although there is a request to add auto-polling.  ProcessBook does automatically invoke Database.Refresh, and does so on the interval specified for the AF2 DataSet (or, prior to invoking any AF Dialog).  Note that Database.Refresh, if invoked periodically, is designed to be quite fast.  Database.Refresh essentially calls FindChangedItems for you, so, unless you want to specifically process the ChangedItems without having them reloaded into the client, there is no advantage to calling FindChangedItems first.


                              Regarding the journey of AF.  In the beginning, I would characterize AF 1.0 as a "Process Model Analysis Tool".  However, AF 1.x functionality overlapped MDB a great deal, and it was decided that the resulting confusion and cost was too high.  From that point forward, the goal of the combined AF/MDB was to provide a framework on which one could simplify deployment of all aspects of a PI System.  From searching and browing for relevant data, to creating ProcessBook Displays, to configuring Web Parts, to Reporting via PI OLEDB Enterprise, configuring PI Tags, and yes, to creating and running Analysis.


                              However, the first step in this journey was to merge the functionality in AF 1.x and MDB as quick as possible.  For AF, this meant adding element versioning, hierarchical attributes, multiple parents, non-templated elements, a change of focus from process models to assets, and a re-architecting of the AF Server for higher scalability.  (Note that AF 2.x still supports all the modeling aspects of AF 1.x - from the SDK perspective at least).  The de-emphasis on analysis and models, was not because it wasn't desired, we just didn't have the bandwidth to do it all in the 2.0 (or 2.1 or 2.2 ) timeframe


                              The nature of Analytics in AF is evolving.  AF 1.x, tended to be analysis run infrequently on large data models over fixed periods of time.  Analytics  in AF is now needed to also be done continously, as data arrives.  So, yes, you hit the nail on the head.  There is much work being done trying to get data into and out of the analysis engine (and AF and PI) at a rate that allows for efficient processing of large numbers of analytics.  Within AF, Event Piping, intelligent caching of data for calculations, rich data access calls, are just a few of the steps that need completing for Analytics to operate at the scale we would like.  We feel that the path we’re on for Analytics in AF will benefit the majority of our customers.

                          • Re: AF Wishlist

                            @Michael Halhead: As Chris Manhard already explained, you will have to make use of Database.Refresh. This was already discussed at a few occasions and there was concern about the payload/overhead of such an approach... as Chris pointed out, it's been designed to be pretty lean and I would like to invite you to check this discussion thread and this other one.

                              • Re: AF Wishlist

                                Thanks Chris and Steve. I had a suspicion that this would be the case to prevent the performance of the AF server suffering but I wasn't sure. I did a search for AF OnChange and didn't find much; I obviously didn't look too hard.


                                Seeing that Rhy raised the Analysis rule question I thought I would add my two cents worth. AF never "lost" the analysis rules; but they have been in hiding for 2-3 years. I do see the "lack" analysis rules as the single biggest "deficiency" in AF and I have contemplated implementing them via the SDK. I do see that they are scheduled for early next year. I am starting to get confused by analysis rule (future of calculations within the PI System) regarding all the options:

                                • What is going to happen to ACE with the migration of MDB to AF. I like ACE it works like a bomb so I won't mind seeing ACE migrate to AF. I particularly like the fact that ACE runs within a different application domain and can be split across multiple computer (at least with ACE 2010).
                                • How with StreamInsight fit into this picture. I know that there are PI adapters but are there AF adapters in the works? To be honest I've never used StreamInsight other than a bit of playing seeing that ACE already covers the same ground unless I'm missing something.
                                • What is the future of performance equations and AF Formulas; I've seen references to these merging. That would be nice if the no AF data limitation of PE is removed.

                                This might be a nice topic for a webinar, I'm sure that I'm not alone in the confusion.

                                  • Re: AF Wishlist
                                    Ahmad Fattahi



                                    We will have a vCampus-exclusive webinar on PI ACE by the product manager and the lead developer in near future. There is a very good presentation by them on the same topic at the OSIsoft vCampus Live! 2010 event this year for the interested users.


                                    PI for StreamInsight and the adapters are part of PI analytics and are currently being worked on. What makes StreamInsight interesting is its ability to work on large streams of data in real time in a LINQ environment and do complex event processing on them very efficiently. I agree that there may be some overlap between what it and ACE do but there are significant differences in their flavor and capabilities. Once again, there will be another talk at OSIsoft vCampus Live! 2010 on the topic!

                            • Re: AF Wishlist

                              It would be excellent if AF Analyses could simply update an attribute with their latest calculated value. (IE, dont historise the result and store to PI - just display the latest result).