1 Reply Latest reply on Nov 7, 2017 8:47 PM by rschmitz

    Synchronized time stamps using PI webAPI and streamsets?

    ChristopherWeh

      I want to use PI web API to read multiple values from the PI Server. Is there a possibility to use the getrecorded function for the first WebID and then getting the values from the other WebIDs with synchronized timestamps? 

      Thanks for your help! Christopher

        • Re: Synchronized time stamps using PI webAPI and streamsets?
          rschmitz

          Hi Christopher,

          In order to do this you'll need to perform a batch request to get the WebIds of the point you're looking for recorded values for as well as the a call getrecorded values, whose timestamp in the results you can substitute in for your getinterpolated call. I drafted up a sample batch query request for you to take a look at as an example:

           

          {

               "GetPIPoint":

                    {

                         "Method": "GET",

                         "Resource": "https://<URL>/piwebapi/points?path=\\\\<SERVER>\\CDT158&selectedFields=WebId;Name"

                    },

               "GetRecorded":

                    {

                         "Method": "GET",

                         "Resource": "https:/<URL>/piwebapi/streams/{0}/recorded?startTime=*-1h",

                         "ParentIds": ["GetPIPoint"],

                         "Parameters": ["$.GetPIPoint.Content.WebId"]

                    },

               "GetPIPoint2":

                    {

                         "Method": "GET",

                        "Resource": "https://<URL>/piwebapi/points?path=\\\\<SERVER>\\sinusoid&selectedFields=WebId;Name"

                    },

               "GetInterpolatedAtTime":

                    {

                         "Method": "GET",

                         "RequestTemplate": {

                             "Resource": "https://<URL>/piwebapi/streams/{0}/interpolatedattimes?time={1}"

                        },

                    "ParentIds": ["GetPIPoint2", "GetRecorded"],

                    "Parameters": ["$.GetPIPoint2.Content.WebId", "$.GetRecorded.Content.Items[*].Timestamp"]

                    }

          }

           

          --Rob

          1 of 1 people found this helpful