2 Replies Latest reply on Sep 24, 2018 4:31 PM by nigeloldham

    PIPoint.UpdateValue - how to use references such as T, Y, "*", "*-2d"

    nigeloldham

      Hello,

      Hopefully this is an easy one.

      If you want to write values to PI tags using AF SDK, I can use this code, but I really don't want to pass the DateTime to the AFValue,

      Is there a way to pass "*", "*-2d", "*-23s", "T", or "Y" as the datetime?  Or does AFSDK only use a specific datetime in .NET?

       

       

      public void Update_PITag_with_SpecificTime(String PITagName, String PIValue, DateTime PI_Timestamp)

      {

       

           try

           {

       

                myPIPoint = PIPoint.FindPIPoint(DataArchive, PITagName);

                AFValue AFValue2 = new AFValue();

                AFValue2.Value = PIValue;

                AFValue2.Timestamp = PI_Timestamp;

                myPIPoint.UpdateValue(AFValue2, OSIsoft.AF.Data.AFUpdateOption.Replace);

           }

           catch (Exception ex)

           {

                Console.WriteLine(ex);

           }

      }