3 Replies Latest reply on May 27, 2015 7:13 AM by Eugene Lee

    PI Web API 2015

    alokbedi

      We have a requirement to do bulk data retrieval for multiple tags which was not supported in the 2014 version of PI Web API we are currently using but was planned for the 2015 version.

      I recently downloaded the documentation of PI WebAPI 2015 and looking at the programmer reference guide there is a new service StreamSet that seems to be exactly for this purpose. Just need some technical expertise to guide us in implementing the service correctly for our requirements.

       

      • Need to confirm that StreamSet is the only service available in PI Web API 2015 for doing bulk data retrieval of multiple time series tags.
      • Need to confirm that before invoking StreamSet service we’ll need to get the webID of the element (meter) just like we are doing today with Stream service. The service also has start time and end time input parameters similar to Stream service.
      • Need help understanding how to pass multiple tag names in input to StreamSet service that we need values returned in response. I see one sample response in documentation but there is no sample request.
      • Is there a way to use the service to return results by apply conditions on tag values in request e.g. can we get only the time series data for tag Wh_d_Int where tag value Wh_d_Int_Status =2 ?  If this is not supported, I assume the service will return time series data for both tags and the calling application will need to apply the conditional logic on the results.

       

      Thanks

      Alok Bedi

      alok.bedi@capgemini.com

        • Re: PI Web API 2015
          Eugene Lee

          Hi Alok,

           

          • PI Web API 2015 supports bulk retrieval (snapshot, recorded, interpolated, plot, summary) for all or selected attributes from a given parent element or event frame through the StreamSet controller.
          • You will need to specify the WebID of the parent together with various filters such as nameFilter for filtering attributes that you want etc.
          • There is no way to do that currently. You will need to configure them as different attributes with PIPoint DR in the parent element in your asset hierarchy.
          • You can do that by using the filterExpression parameter in all calls except GetPlot and GetValues.
          2 of 2 people found this helpful
            • Re: PI Web API 2015
              alokbedi

              Hi Eugene - Thanks for your reply, I am clear on the first 2 questions and need some clarification on the last 2 questions:

               

              • Yes, we do have different attributes defined as PI Points within the parent element in AF. In the name filter do we separate them by , character ? We don't want to use wildcards, we need to give exact attribute names. Specifically if I have element that has PI Point attributes e.g. Wh_d , Va_avg, max_VAR etc..  how can I retrieve recorded data for only Wh_d and Va_avg. Or can you give any type of sample request using name filter with more than one attribute name.
              • We are going to use GetRecorded and it does have filterExpression parameter, but I am thinking filter expression will only filter results of attribute specified in expression so it won't fulfill this requirement. We are not looking to get result values of attribute in filter expression. Instead we need value of a different attribute, like doing a select query from a database with where condition.  Specifically if I have an element that has PI Point attributes e.g. Wh_d and Wh_d_status our requirement is to return recorded values of attribute Wh_d where Wh_d_status =2.  Do you think that is possible ?

               

              Regards,

              Alok

                • Re: PI Web API 2015
                  Eugene Lee

                  Hi Alok,

                   

                  • From my testing, I have not been able to find a way to do what you want. (i,e, using name filter with more than one attribute name) I think you can only do that by making more than one call. Other might want to chime in here.
                  • For this request, I think that you don't have to use 'where'. Let me explain why. SQL queries such as 'where' works because the data is in a relational format. Whereas for our case, the PIPoint time series are independent of each other. With that being said, the only thing that can link these two time series together will be the time stamp. So in your case, all you have to do is specify ?'Wh_d_status'=2 at the end of your url. Here is a sample that I tested.

                   

                  ?filterExpression='Attribute2'=222

                   

                  Capture.PNG

                   

                  The parent element only has 3 attributes, "Attribute1" and "Attribute2" and "Root Attribute". "Root Attribute" didn't return anything since it didn't have an archive value at the corresponding timestamp where "Attribute2"=222