11 Replies Latest reply on Jun 12, 2014 5:48 PM by torsteins

    The data method 'Interpolated Values' is not supported

    torsteins

      I've used AF SDK for a while now, and it has been running without any issues on the server. Now I suddenly get "The data method 'Interpolated Values' is not supported" exception on my queries for data. I can get and iterate all elements / attributes from AF, but when i try to get my values it's throwing this exception. As mentioned this have been working for a while now, and i don't think there has been made any changes to the environment (except some windows updates maybe... )

       

       

        • Re: The data method 'Interpolated Values' is not supported
          Marcos Vainer Loeff

          Hello Torstein,

           

          Which PI AF SDK method do you call when you receive the exception error? Could you paste here the code snippet? Which PI AF SDK version are you using? Are you sure that there is data within the selected period of time of the chosen attribute? If you create an attribute and link it to the sinusoid  PI tag, would you work? Are you using PI Point DR or a custom one?

            • Re: The data method 'Interpolated Values' is not supported
              torsteins

              Hello,

               

              I'm calling afAttribute.Data.InterpolatedValues(timeRange, afTimespan, null, null, false), and this code has been running for a couple of months without any trouble. I'm sure there is data in the selected period since I'm able to use the same code and request on another computer.  I'm using PI AF SDK version 2.5.0.5039.

                • Re: The data method 'Interpolated Values' is not supported
                  torsteins

                  And yes, i'm using the PIPoint DR :-)

                    • Re: The data method 'Interpolated Values' is not supported
                      Marcos Vainer Loeff

                      Thanks Torstein. If you create a new attribute using PI Point DR and link it to the PI Tag sinusoid, would it work?

                        • Re: The data method 'Interpolated Values' is not supported
                          torsteins

                          No, it doesn't work. When i debug on a working computer, my afAttribute - DataReference - SupportedDataMethods stating a lot of available methods. When I debug on a computer not working is says "None". Any clues of what to check to get this working again?

                            • Re: The data method 'Interpolated Values' is not supported
                              Marcos Vainer Loeff

                              I would follow Anna's suggestion and upgrate PI AF Client to 2012 SP2 (and not SP1). Are you using simultaneous multithreaded Rich Data Access calls? Please create a new custom console application in Visual Studio and test the following code snippet:

                               

                               

                               
                              using System;
                              using System.Collections.Generic;
                              using System.Linq;
                              using System.Text;
                              using System.Threading.Tasks;
                              using OSIsoft.AF;
                              using OSIsoft.AF.Asset;
                              using OSIsoft.AF.PI;
                              using OSIsoft.AF.Time;
                              
                              namespace InterpolatedValuesErrorException
                              {
                                  class Program
                                  {
                                      static void Main(string[] args)
                                      {
                                          AFAttribute myAttribute = AFObject.FindObject(@"\\MARC-PI2014\AFSDK Test\myElements|Sinusoid") as AFAttribute;
                                          PIPoint myPIPoint = PIPoint.FindPIPoint(@"\\MARC-PI2014\SINUSOID");
                                          AFTimeRange myAFTimeRange = new AFTimeRange();
                                          myAFTimeRange.EndTime=new AFTime("*");
                                          myAFTimeRange.StartTime=new AFTime("*-1d");
                                          AFTimeSpan myAFTimeSpan = new AFTimeSpan(new TimeSpan(1,0,0));           
                                          AFValues myAFValues = myAttribute.Data.InterpolatedValues(myAFTimeRange, myAFTimeSpan,null,"",false);
                                          AFValues myPIValues = myPIPoint.InterpolatedValues(myAFTimeRange, myAFTimeSpan,"",false);
                                          ShowValues(myAFValues);
                                          ShowValues(myPIValues);
                                          Console.WriteLine("Finished");
                                          Console.ReadKey();
                                      }
                              
                                      private static void ShowValues(AFValues myValues)
                                      {
                                          foreach (AFValue myValue in myValues)
                                          {
                                              Console.WriteLine(myValue.Value + "\t" + myValue.Timestamp.LocalTime.ToString());
                                          }
                                          Console.WriteLine("\n\n");
                                      }
                                  }
                              }
                              

                              You must fix the paths from the first two lines. Please let us know if you receive the error message when executing not only the myAttribute.Data.InterpolatedValues() but also myPIPoint.InterpolatedValues().

                          • Re: The data method 'Interpolated Values' is not supported
                            asorokina

                            Hi Torstein,

                             

                            Could you please try upgrading to the PI AF Client 2.5.1? From the release notes:

                             

                            This section lists items that were resolved in Release 2.5.1.5159 - 1/24/2013 of the PI AF Client.

                             

                            77653

                             

                            Simultaneous multithreaded Rich Data Access calls to single attribute data reference can unexpectedly fail.  Errors that are possible are an unexpected null value returned for the data reference, “The data method <x> is not supported”, or “The given key was not present in the dictionary”.

                             

                             

                             

                            Kind regards,

                             

                            Anna