Access PI Point from AF Attribute #612
-
From an email I received recently: We are currently using your python library to get access to PI AF info. Our interest is on extracting the PI points within a PI AF element, and we have been able to, but then, from those PI points, getting the description attribute related to each PI DA tag. We know how to do that from PI Datalink though for automation, the best thing would be to reach description attribute from python directly. We would appreciate if you could provide support on this topic. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is linked to issue #528. Currently it isn't implemented in import PIconnect as PI
with PI.PIAFDatabase() as db:
elem = db.descendant(r"Some\Path\To\An\Element")
attr = elem.attributes["Interesting attribute"]
# Here it gets a little dirty:
data_ref =attr.attribute.DataReference # returns the data reference for the underlying .NET AFAttribute
if data_ref.Name == "PI Point":
pi_point = PI.PI.PIPoint(data_ref.PIPoint) # construct a python PIPoint object from the returned .NET object
print(pi_point.description) |
Beta Was this translation helpful? Give feedback.
This is linked to issue #528. Currently it isn't implemented in
PIconnect
yet, so in the meantime it is probably best to use something like this: