Good morning,

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.

Thanks,

Erick

Good morning,

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.

Thanks,

Erick

- 1 person found this helpful
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.

Example:

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=*

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.

Example:

If your equation is

TimeEq('MYTAG', t', '*', "RUNNING")/3600then your URI would be https://

<WEBAPISERVER>/piwebapi/calculation/recorded?webid=<WEBID>&expression=<EQUATION>&starttime=t&endtime=*