Hi, I would really appreciate some feedback on doing calculations in AF, specifically comparing DR formula vs Analysis.

I have used mostly data reference formula for several reasons.

(1) It is easier to configure simple expression (eg. mass = volume *density). The formula is built in the attribute. It is also easy to understand the calculation.

(2) I copied and pasted similar attributes structure to different templates. So once I started with some calculations templates in formula, I basically relied on similar structure.

(3) As an DR attribute, I have on demand calculation. No need of PI TAG. When performance is not an issue, it was ok.

Then came Analysis. It offers some advantages, but copy and paste is not straight forward like in formula. The advantages I see are:

(a) it can save the result in PI TAG.

(b) Performance equation is available.

Question 1) With the new features in analysis (I am currently using 2015 R2), what are the best practice to do calculations in AF?

I already have some complex templates with DR formula. I would like to know if it is worth to convert them to analysis. The main advantage of formula was the on demand calculation (reason 3). Since analysis can now act like on demand calculation (save no history option), I wonder if analysis offers better performance over the formula (eg. faster on demand calculation).

Question 2) Can I mix formula and analysis?

I am having stability issue when I mix formula with analysis. Eg. An formula attribute is an input to an analysis. I couldn't find any recommendation on that. So I wonder if have to use analysis only.

Thanks, Danke, Merci, Gracias in advance

Hi Mauricio:

You are correct that if you configure your analyses not to save history, then your output attribute would be configured with the Analysis Data Reference which is on demand and would not require a PI Point. In terms of performance, if you compare the same calculation in Formula DR and Analysis DR, they would be fairly similar. This is because Formula DR are relatively simple. However, Analysis DR supports many more functions and has a more flexible way of composing the calculations, which can provide benefits to you. You would have to make the determination as to whether you can simplify or enhance your Formula DR by converting it to Analysis DR.

For me, the Analysis DR gives me more flexibility with more available functions and also allows me to name my variables which makes the calculations much easier to read and debug so I lean towards using Analyses.

We have had some bugs when using Formula DR attributes as inputs to Analyses. I suggest you look at the AF 2016 and PI Analysis Service release docs to see if any of the bug fixes applies to you. Lastly if you're still having trouble, please contact tech support so we can identify the issue and fix it.

Hope this helps.

--

Steve Kwan