4 Replies Latest reply on Jan 9, 2013 6:44 PM by sovain

    How to get/Update compressed values  for a tagname using SDK

    sovain

      Hi All,

       

      Probably my question look simple but it is better to ask.

       

      I need to get some PI values/time  in a date range by(NOT interpolated) Tag name predefined using PI SDK.  

       

      After that, make some calculations ov values and update these values on PI (without changing original date/time).

       

      I could find many options to get it in AF, but I am using direct Tagname.

       

      It seems that something like below is not my case:

       
      ......
      myServer = g_SDK.Servers[textBox1.Text];
      myPoints = myServer.PIPoints;
      snapPoint = myPoints[textBox2.Text];
      myValue = snapPoint.Data.Snapshot;
      ..........
      

       Could somebody give an idea of where to investigate (a sample in C# would be just perfect) ?

       

      I see there is some methods:

       

      snapPoint.Data.TimedValues  -    snapPoint.Data.UpdateValues

       

      But I am not sure if these I have to use.

       

      Thank you 

       

      Oleg

        • Re: How to get/Update compressed values  for a tagname using SDK
          mhamel

          @Oleg: You will need to use the RecordedValues method of the PIData object. You can find explanations and examples on how to do this in the PI Application Development Course workbook that you can find here.

           

          I would suggest you take a look at the new AF SDK 2.5 that allows you to data from a tag name directly. This is more efficient and it gives you the same flexibility as the PI SDK. Don't be annoyed by the name of the AF SDK, you should see this as the 'PI System' SDK that gives you access to perform data access with any components of the PI System. Take a look at the documentation of the AF SDK under the OSIsoft.AF.Data namespace and search for AFData Class.

           

          Let me know if that helped you.