2 Replies Latest reply on May 22, 2015 1:16 PM by Marcos Vainer Loeff

    Hello, how to read data element attribute from word and create the attribute in PI system

    ArunaNamadev

      I have word document with tags and I would like to create attribiute element in PI systme using  ASSDKby reading from the document.

        • Re: Hello, how to read data element attribute from word and create the attribute in PI system
          Eugene Lee

          You can use the StreamReader Class to read from MS Word and do some sort of parsing to get the tag names and then do something like this in AFSDK with C#:

           

          // This example demonstrates how to create an attribute for an

          // element and display information about it.

           

          // Get the Database
          PISystems myPISystems = new PISystems();
          PISystem myPISystem = myPISystems.DefaultPISystem;
          AFDatabase myDB = myPISystem.Databases.DefaultDatabase;
          
          
          // Create an Element
          AFElement myElement = myDB.Elements.Add("MyElement");
          
          
          // Create an Attribute
          AFAttribute myAttribute = myElement.Attributes.Add("MyAttribute");
          myAttribute.Description = "Attribute for MyElement";
          myAttribute.DefaultUOM = myPISystem.UOMDatabase.UOMs["Kelvin"];
          myAttribute.DataReferencePlugIn = AFDataReference.GetPIPointDataReference(myPISystem);
          myAttribute.ConfigString = @"\\%Server%\sinusoid";
          

           

           

          In this example, sinusoid is the tag name.