4 Replies Latest reply on Mar 28, 2017 5:53 PM by ekuwana

    PI AF SDK - Update string value of an attritube

    santhosh2r2

      hi,

      i am novice to PI AF SDK. Im challenged with the task to update the value of an attribute of string data type. The data reference is null.

      Is there any method available for this task? Please find below a compressed version of my code.

       

      I have tried to use AFValue, but no success.

       

      public void SetAttr()

              {

                  List<string> path = new List<string>();

                  path.Add(@"\\DESKTOP-945B9S8\BASTEST\Location\Pumps\P8182

                  CurrSubElements = DbAF.Elements;

                  var q = AFElement.FindElementsByPath(path, null);

                   var t = q[@"\\DESKTOP-945B9S8\BASTEST\Location\Pumps\P8182"].Attributes["Type"].Attributes["SourceTag"].Data;

                     // Update the value of the attribute "SourceTag" to "TestString"

                }

       

      Any pointers for solving this would be highly appreciated.

       

      cheers,

      Santhosh