Does AF stores attributes that their value are based on formula in AF database? We can't seem to find these kind of attributes inside databse.
AF does not store the data for any DataReference (such as the Formula Data Reference in your case). The DataReference is actually executed on the client side (the dll is downloaded to the client machine). When the AF client requests the value or values for a given context, it calls the GetValue or GetValues method of the AFDataRefence class (which you would override for your custom DR) and returns the results. This data is not sent back to the AF Server/Database and is essentially lost once the client has finished with it. The upside of this is that each request will return the correct results for that period in time, reflecting any changes made to the component attributes.
An AFAnalysisRule, on the other hand, has functionality for publishing results back to some data store (PI Server, XML Output, a printer, it's all up to you!) This is another reason to use an Analysis Rule over a Data Reference.
Furthermore, as the DataReference does not store history, it cannot naturally provide updates. So, when setting up PINotifications, you should use a periodic time rule when using a Data Reference as a trigger.
Please let me know if you need any more information.
Sounds like AFAnalysisRule is the answer. Here is the template structure I have.
Attribute (Data Referenced to PI)
ChildAttribute1 (Stored in AF)
ChildAttribute2 (Stored in AF)
ChildAtrribute3 (Based on formula using current value of root Attribute from Pi and ChildAttribute1, ChildAttribute2)
And I have hundreds of Attributes for each ChildElement.
How can set up the analysis rule and/or pi notification so that I can get the ChildAttribute3 value whenever it changes.
ArmadilloDoes AF stores attributes that their value are based on formula in AF database? We can't seem to find these kind of attributes inside databse. Thanks.
Yes. See table "AFElementAttributeDR" under column "configstring".
>> Yes. See table "AFElementAttributeDR" under column "configstring".
Well, this is partially true. Don't forget the sandbox or querydate or the template.
I would not recommend accessing the AF tables directly from your application logic, since we are likely to change the table schema in future releases to add functionality or improve performance and scalability.
In the future, the new PISysOLEDB provider will provide access to AF data via OLEDB:
Very true, was not encouraging that it should be directly accessed but the question was asked if it was stored in the database (which it has to otherwise how would the definition/configstring for a DR ever be known by clients).
Retrieving data ...