As I alluded in one of my previous blog posts, I decided to reuse my Event Frame Counter custom Data Reference to create a new one that performs roll-ups on Event Frames.
This Data Reference will find all of the matching Event Frames for a selected Element based on the Event Frame Template and a time range. I can then pick which Event Frame Attribute Template to use in one of several calculations (see the screenshot below showing several Attributes configured and a sample of the Settings dialog box):
- Sum - totals the selected Attribute from search results.
- Average - performs a time-weighted average of the selected Attribute from search results.
- Mean - performs a event-weighted average of the selected Attribute from search results.
- Minimum - returns the smallest value of the selected Attribute from search results.
- Maximum - returns the largest value of the selected Attribute from search results.
- Range - returns the difference between the Minimum and Maximum values from the search results.
Like my previous custom Data Reference, this one provides options for defining the Search Mode and overriding the start and end times. By default the start and end times are provided by the client application like PI Vision.
Dan Fishman offered a great suggestion to add Event Frame duration roll-ups. I really liked this idea so I included the option to use the Event Frame Duration instead of an Attribute. The only difference is that the Average and Mean are the same calculation in this scenario.
I envision such Data References to be useful for analyzing downtime events in Oil and Gas. For example, one could determine the longest downtime event for a month for a compressor or measure the total amount of gas withdrawn from a cavern storage well for the quarter.
Recently, I found an article in a pharmaceutical journal demonstrating how useful this data could be for analyzing batch events and using these statistical results for building multivariate data models and Monte Carlo simulations. If you include Critical Process Parameters (CPPs) and Key Process Parameters (KPPs) in the Event Frame Templates, then this type of Data Reference would be valuable for generating cross-batch statistics.
For example, if your CPP for a reactor is temperature, then you could potentially average all of the Unit Procedure or Operation temperatures from each batch in your campaign with such a Data Reference.