2 Replies Latest reply on Apr 4, 2018 1:10 PM by sraposo

    Values not returned derivied from a table lookup


      I have an issue where I’m using the PI AF database trying to return the value of an attribute whose result is derived from a table lookup

      If the start and End dates are identical, for this query the AF SDK call returns



      {"'4/04/2018 5:53:23 AM - 4/04/2018 5:53:23 AM' is not
      a valid AFTimeRange"}


          HResult: -2146233067

          HelpLink: null

          InnerException: null

          Message: "'4/04/2018 5:53:23 AM -
      4/04/2018 5:53:23 AM' is not a valid AFTimeRange"

          Source: "OSIsoft.AF.Asset.DataReference.TableLookup"

          StackTrace: "   at
      timeRange, Int32 numberOfValues, String filterExpression, Boolean
      includeFilteredValues, AFAttributeList inputAttributes, AFValues[] inputValues)
      3372\r\n   at
      attribute, AFDataReference dataReference, AFDataProvider inputProvider, UOM
      desiredUOM)\r\n   at
      query, AFAttribute attribute, AFDataReference dataReference, AFDataProvider
      inputProvider, UOM desiredUOM, IErrorPackager errorPackager)"

          TargetSite: {OSIsoft.AF.Asset.AFValues
      InterpolatedValuesByCount(OSIsoft.AF.Time.AFTimeRange, Int32, System.String,
      Boolean, OSIsoft.AF.Asset.AFAttributeList, OSIsoft.AF.Asset.AFValues[])}



      If I change the start and end date to be 1s apart, then no
      problem and the value is returned. The lookup is totally time independent

      This does not occur for similar AF calls to attributes that
      are formula related.


      Table properties for the lookup I have tried Stepped
      (checked or not checked) – no effect. ConvertToLocal for timezone is checked


      AFSDK version, runtime version v4.0.30319


      Please let me know if you have an idea for this issue.

      Thank you