I have word document with tags and I would like to create attribiute element in PI systme using ASSDKby reading from the document.
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.
Hello Aruna and Eugene,
I suppose you will read the tags from the text document. If this is true, I don't believe it is possible to read a document text directly from Microsoft Word File using the StreamReader class. After some research, I would follow this article from codeproject in order to get started converting the word document to text programmatically.
Concerning the PI AF SDK, if your attributes share somehow similar properties, you might want to consider creating an attribute template and then creating new attributes derived from it.
Let us know if you have any issue,
Retrieving data ...