gSharp – Programmable Asset Analytics for PI

A bit of history

When PI AF 2014 with Asset Analytics was released by OSIsoft it was a significant milestone in the evolution of the PI Asset Framework. This was intended as the first major part of the analytics component of PI AF – configurable Asset Analytics that did not require coding knowledge, or an IDE in which to develop calculation code, or to be compiled at all. Analyses were templatizable, easy to create, and followed the very familiar PI Performance Equations style of syntax.

The second part of AF analytics was generally referred to as programmable Asset Analytics and was seen as the PI AF capable successor to PI ACE. Unfortunately, this component of Asset Analytics never eventuated, and so PI ACE remained the only option for programmatic calculations and analyses within the PI System. By 2014 PI ACE had already been in maintenance mode for a couple of years and the likelihood of it getting any form of update to provide native AF capability was practically zero.

Many in the PI user community still held out hope for some form of AF based programmable analytics to handle the types of complex calculations that just weren’t possible (and still aren’t today) in configurable Asset Analytics. Today many of us have given up any hope that the PI System will see native programmable Asset Analytics.

A new chapter

With the upcoming release gSharp from gHost Technology, the concept of programmable Asset Analytics is reborn. Originally conceived as a replacement for PI ACE following the end of support in 2023, gSharp not only presents a viable option for PI ACE users to migrate their legacy code to a fully supported and backwards compatible platform, but also provides a fully AF aware calculation engine and environment for developing complex calculations without the overhead of PI ACE backwards compatibility.

With the upcoming release of gSharp, the concept of programmable Asset Analytics is reborn.
John Messinger
Chief Technology Officer

A bit of context

In the same way that PI ACE uses the PI Module Database to provide calculation context, gSharp uses PI AF databases to provide the context for its calculations. AF Elements containing Attributes configured with PI Point data references are the individual contexts for a gSharp calculation that has been written with the intent of being applied to multiple assets.

AF Element Attributes are mapped as Data Points in gSharp (AFDataPoint class), giving the developer access to a relatively simple object in which data can be access for both read and write operations. These Data Points also expose several extension methods that provide access to standard PI summary functions (Avg, Max, Mean, Min, Range, StdDev, and Total) as well as some familiar and standard Performance Equation type functions such as:

  • FindEQ and its sibling functions (FindGE, FindGT, etc).
  • NextEvent and NextVal.
  • PrevEvent and PrevVal.
  • TimeEQ and its sibling functions (TimeGE, TimeGT, etc).

Because the AFDataPoint class is a form of wrapper around an AFAttribute, the underlying AFAttribute can be easily exposed for access to the full range of properties and methods available for this class in the AF SDK.

Also included are a couple of simplified methods for accessing archived and sampled values for the underlying PI Point. All these Data Point methods reduce the need for the developer to have to directly write AF SDK code for these standardised methods. Of course, there is nothing preventing developers from calling the AF SDK directly from within a gSharp code module for functionality that isn’t currently provided as part of the gSharp analytics library.

Lastly, there is a static FunctionLibrary class that exposes analytics methods for calculating summary functions on passed in data arrays, Curve and Poly functions, and others. Some of these methods are exposed in gSharp’s PI ACE compatibility layer as they are our AF SDK based implementation of PIACEBIFunctions methods, and we considered them useful enough to include as part of the native gSharp analytics library.

The joy of code

Using gSharp for programmable Asset Analytics brings the power and flexibility Visual Studio and .Net to PI System analytics again. Because the gSharp server provides a highly flexible scheduler for analyses, developers don’t need to spend time and effort on building Windows services based applications to host their complex analysis code and can instead focus on developing the calculations themselves.

Analyses that require complex logic, looping, interaction with the file system or other external systems such as databases, or access to third-party or custom code libraries just can’t be created with configurable Asset Analytics. These types of requirements are best met using tools such as Visual Studio and gSharp.

gSharp provides Visual Studio solution templates for both C# and VB.Net developers to create native gSharp calculations.

Take your asset-based analytics to the next level with gSharp programmable analytics for your complex calculation needs.

Fully Supported

All gSharp customers receive advice and insights from the largest AVEVA-accredited organisation in the APAC region.

    ©2023 gHost Technology – All rights reserved