-
Re: Accessing PIPoint security/access control information from AFSDK
tramachandranAug 9, 2018 2:43 PM (in response to Mark.Derbecker)
1 of 1 people found this helpfulIn AF SDK, you can load a PI Point along with required attributes using the PIPoint.FindPIPoints which has an overload for IEnumerable<string> attributeNames.
The attributenames are available in the PICommonPointAttributes Class, and in your case you can use the DataAccess/DataSecurity fields.
-
Re: Accessing PIPoint security/access control information from AFSDK
vkaufmannAug 9, 2018 2:51 PM (in response to tramachandran)
Here is a little code snippet that will get the PIPoint property from an AF attribute and then load and print all of the PIPoint attributes and their corresponding values.
PISystems myPiSystems = new PISystems(); PISystem myPiSystem = myPiSystems.DefaultPISystem; AFDatabase myDb = myPiSystem.Databases["Test"]; AFElement myElement = myDb.Elements["Test"]; AFAttribute myAttribute = myElement.Attributes["Sinusoid"]; object drAttrValue; myAttribute.PIPoint.LoadAttributes(); IEnumerable<string> list = myAttribute.PIPoint.FindAttributeNames(null); Console.WriteLine("Found PIPoint Attributes: nameFilter='<null>'"); foreach (string item in list) { drAttrValue = myAttribute.PIPoint.GetAttribute(item); Console.WriteLine(" {0} = '{1}'", item, drAttrValue); } Console.ReadLine();
--Vince
-
-
Re: Accessing PIPoint security/access control information from AFSDK
Mark.Derbecker Aug 9, 2018 4:59 PM (in response to Mark.Derbecker)Thanks folks! I'll try this out. I wasn't looking in that direction so thank you very much for the pointer.
-
Re: Accessing PIPoint security/access control information from AFSDK
tramachandranAug 9, 2018 5:09 PM (in response to Mark.Derbecker)
A minor remark, for PIPoint.LoadAttributes if supplied with null or an empty list, then all PIPoint attributes will be loaded. If multiple PIPoints are being accessed, use the bulk call PIPointList.LoadAttributes for improved performance.
To load specific PIPoint Attributes refer to the latter portion of the example in documentation.
-