is it possible to reference an element or attribute which resides in another model?
Definitely, do like this
You can use a stringbuilder data reference. Example: if model1 and model2 are both at the root level of the AF structure, then to reference attribute1 in model1 from model2, you can use the following as the config string.
I realize I did not formulate my question well. I want to reference an element or attribute in a model in another AF Database. Is that possible as well somehow?
Thanks so much Eugene! That is exactly what I was looking for. Great. It works.
I do still have a question. So I am able to reference an attribute in another database, but when I update the value of the attribute in the other database the change does not happen in database I am in.
Somehow this other database must be refreshed?
Did you try hitting the refresh button?
Ofcourse :-) The first thing I did.
It seems that when I create an attribute with this reference to another database element attribute that it takes a snapshot of its current value at creation.
Even when I close PI system Explorer and reopen the database with the reference, it does not reflect the current value in the other database.
Also when I fetch the value in C# code the changes are not reflected in the attribute that references the other attribute. Probably because the other database is not refreshed.
I have tested on my own machine with the source attribute's DR as pipoint, table lookup and none. In all cases, the destination attribute was updating. So the behavior that you are experiencing is not expected. What is the DR of your source attribute?
I tried it with DR none with string, integer and double as datatype. Nothing is refreshing. Seems like something is broken on our site.
Retrieving data ...