1 Reply Latest reply on Jan 9, 2014 2:59 PM by lZheng

    AFAttribute GetValues without interpolation

    dennisn

      Hi!

       

      I am trying to read in all AFAttribute values for a specific time range.
      In case of a PiPoint reference this is done using the point.Data.RecordedValues functions which works fine.

       

      If the AFAttribute uses a Formula reference I am having issues to just get the archived values without any interpolated added on. Is there any way to have a function similar to the RecordedValues that only returns formula results for actual result values?

       

      My scenario in detail:
      Attribtute1: PiPoint reference
      Attribute2: FormulaReference -> A=Attribute1;[roundfrac(1,2)]
      Using the AFAttribute.GetValues(TimeRange, 0, null) returns additional interpolated values instead of only the ones based on PiValues from Attribute1.

       

      Thanks!

        • Re: AFAttribute GetValues without interpolation
          lZheng

          Hi Dennis,

           

          You can use RecordedValues function from AFData class where you can specify the AFBoundaryType.

           

          I did a simple test, Attribute2 has a formula data reference with an input attribute Attribute1, Attribute1 has a PIPoint data reference to Pi Tag sinusoid. Values1 and values2 return same amount of values.

           

          AFValues values1 = sinusoid.RecordedValues(timerange, AFBoundaryType.Inside, null, false);

           

          AFValues values2 = Attribute2.Data.RecordedValues(timerange, AFBoundaryType.Inside , Attribute2.DefaultUOM, null, false,0);