3 Replies Latest reply on Sep 11, 2018 7:22 AM by Eugene Lee

    Time to totalize especific value in PI Web API

    PedroCampos

      Hi everyone!

       

      I need to get the time to totalize a knowed value of a certain attribute, from a specific datetime.

      For example, I want to know the time passed to totalize 1000L of flow rate L/s, knowing of the initial time is 2018-09-07 14:30:00.

      There is a way to do that in PI Web API and without create new PIPoints?

      I try to build a calculation request with no success.

       

      https://<WEBAPISERVER>/piwebapi/calculation/summary?webid=<WEBID>&starttime=2018-09-07T4:30:00.000Z&endtime=*&expression=TimeLE('<ATTRIBUTEPAHT>', '2018-09-07T14:30:00.000Z', '*', 1000)&summarytype=Total

        • Re: Time to totalize especific value in PI Web API
          Eugene Lee

          It seems like you are asking for this.

           

          Given a varying flow rate, what is the time taken so that the time weighted total is 1000L. Am I right? I know we can do it the forward way where by we provide the time and the flow rate as inputs to calculate the time weighted total. But I am not sure if we are able to do the reverse integration.

            • Re: Time to totalize especific value in PI Web API
              PedroCampos

              Thanks for the help Eugene!

              This is exactly my problem. I know how to get the totalize by passing a start time and a end time.

              What I want is pass the initial time and the target totalization and know the end time to get this totalization.

              This is possible?

               

              I think in create an atrribute "Flow Rate Total" with a variable initial time  and the end time is "*". And then call a TimeLE() function in piwebapi. If I create an atribute with TimeLE() the Analisys forces to create a PIPoint.

              If I call the piwebapi calculation for the attribute "Flow Rate Total" I get an error. This is a new aproach, diferent of the fist aproach.

               

              https://<WEBAPISERVER>/piwebapi/calculation/intervals?webid=<WEBID>&starttime=2018-09-07T4:30:00.000Z&endtime=*&expression=TimeLE('<ATTRIBUTEPAHT>', '2018-09-07T14:30:00.000Z', '*', 1000)

               

              But I still getting the error: 

              "An exception has occurred. Please contact your PI Web API administrator for help in enabling debug mode."