Does anyone have any examples of using PI Web API to calculate total run hours? I'm looking for some examples of time filtered expressions with PI Web API to share with our developer.
You can use the Calculation controller in PI Web API for your purpose. These methods provide mechanisms to evaluate Performance Equation expressions over objects in Asset and Data Servers. Calculations over values interpolated at intervals, over recorded values, and at specific times, as well as summary calculations, are supported.
If your equation is TimeEq('MYTAG', t', '*', "RUNNING")/3600
then your URI would be https://<WEBAPISERVER>/piwebapi/calculation/recorded?webid=<WEBID>&expression=<EQUATION>&starttime=t&endtime=*
Very good thank you much!
Retrieving data ...