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

    Values not returned derivied from a table lookup

    CarolPL

      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

       

      ?mOSIPiData[Position].Value

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

          Data:
      {System.Collections.ListDictionaryInternal}

          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
      OSIsoft.AF.Asset.DataReference.TableLookupDR.InterpolatedValuesByCount(AFTimeRange
      timeRange, Int32 numberOfValues, String filterExpression, Boolean
      includeFilteredValues, AFAttributeList inputAttributes, AFValues[] inputValues)
      in
      C:\\Builds\\Agent1\\16\\s\\PlugIns\\DataReferences\\AFDRtablelookup\\TableLookupDR.cs:line
      3372\r\n   at
      OSIsoft.AF.Data.Query.InterpolatedValuesByCountQuery.QuerySourceDataReference(AFAttribute
      attribute, AFDataReference dataReference, AFDataProvider inputProvider, UOM
      desiredUOM)\r\n   at
      OSIsoft.AF.Data.AFDataCaller`1.SyncCaller.ExecuteQuery(IAFDataReferenceQuery`1
      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 4.0.0.0, runtime version v4.0.30319

       

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

      Thank you