4 Replies Latest reply on Jul 14, 2017 6:50 PM by MikeSpath

    Interpolated data from uncompressed points

    MikeSpath

      Hello data experts,

      We use the AF SDK to get data from our pi data archive. Namely, RecordedValues() method. The data sources are varied in the resolution we need to save in the archive.

      The slow data (could be hours between data points) we do not compress as we want the raw data. We plot this on the same timeframe as fast data (compression is used in archive)

      I've had a request to see if it possible to add interpolated data on the slow data to lineup the timestamps from the fast data when plotted together.

       

      My gut feeling is that is up to our custom code to do this but I'm wondering what the method InterpolatedValues() will do for us. If raw data fed is into it with same timerange, interval, etc.(signature below) will it line up with the fast data?

       

      public AFValues InterpolatedValues(

      AFTimeRange timeRange,

      AFTimeSpan interval,

      string filterExpression,

      bool includeFilteredValues

      )

       

      Thanks in advance,

      Mike

        • Re: Interpolated data from uncompressed points
          Rick Davin

          Hi Mike,

           

          Are you doing your own custom plotting, i.e. not using ProcessBook or PI Vision?  I mention this because the OSIsoft visuals would call the PlotValues method, and not RecordedValues not InterpolatedValues.  Also, what do you mean by "lineup"?  If passing the same time range, your fast and slow trends will have curves within time range window.  It's just that the slow trends would may have 2 points (at bare minimum the first and last) and your fast tags could have several hundreds.

           

          I don't see how this is going to buy you anything with a trend.  However, If you were interested in producing a CSV, then InterpolatedValues will give you values for all points at the same events rather than having scattered events for slow versus fast tags.  A CSV would make sense in trying to line things where each row is one timestamp.

          2 of 2 people found this helpful
          • Re: Interpolated data from uncompressed points
            Roger Palmen

            In addition to Rick's pointer to the PlotValues (that gives you all data you need, and the minimum set you need), there is the question of line-up. How do you visually want to line up?

            If you need markers on your chart on the minute, then interpolated values seems to be easiest to use as you get the same density of data points for both high and low frequency datasets.

            If you only need to draw a line, then Plotvalues gives you all you need to draw a line between each individual point.

            1 of 1 people found this helpful