Hi All

I'm studying Custom Data Reference in AF.

I've successfully developed my first CDR using GetValue. It works as expected, and I'm able to use it in analysis.

What I'm trying to do with next step I to try to return multiple values from Custom Data Reference, and write results to different PI Points.

Please see attached... Is it possible to use GetValues to accomplish this task? Is there any other solution?

Thanks

Ernesto

Hello again Ernesto,

Here are a few options for you to consider:

Custom App- you could write a custom console app or Windows Service. A console app would need to be scheduled periodically with a Task Scheduler. The problem here is there is a very high burden placed on you to create how it gets scheduled or how frequently a Windows Service polls itself.ACE- okay this pains me to admit but any complex calculations require looping constructs cannot be done in Analytics so ACE still has a very limited but special place. But at least ACE has a scheduler built-in. Note that in PI AF 2018 (AF SDK 2.10 ), there will be some support for arrays. We will touch upon the array features on March 21 webinar: Asset Analytics native integration with MATLAB.To me the easiest way to do this is have as simple an ACE calculation as possible to calculate the Gas Flow Rate for a given instant in time, and of course, have ACE save that calculated result back to a PIPoint. Then you would have Analytics to generate the averages (see below).

Analytics, then you would have one analysis just to calculate the instantaneous Gas Flow Rate, and also write that back to PI. Then you would have other analyses that would trigger off the new GasFlowRate tag in PI. Those other analyses would perform the averages. In other words, break it down into discrete analyses and let one analysis propagate to another.If your Gas Flow Rate calculation relies upon PI pointsFormula and Analytics, then the Formula DR will have an AFEventSource to publish data to an AFDataPipe. What that means to you is that Analytics can getIf your Gas Flow Rate calculation relies upon PI pointsupdates from your formula. Your formula must be streamlined and focused to only calculate a given Gas Flow Rate for a given instant in time (no averaging just yet). However, since the Formula DR has the AFEventSource (backed by input PI points), Analytics can be event-triggered or also periodically-triggered. You would then have an analytic to create the various averages and persist the calculated averages back to a PIPoint(s).event-triggeredAnother option along with this is to have an analytic read your Gas Flow Rate from the formula, and persist the instantaneous Gas Flow Rate back to a PIPoint. Note this is a two-stage process because of the previously discussed nature of data references: they only should produce a value. They do not write back to PI. So let the Formula produce the value in the first stage, and then for the second stage let an analysis write the value back to PI.

Hybrid Solution using a CDR with an AFEventSource and AnalyticsSimilar to Formula solution above but with a custom data reference. You will need to implement the AFEventSource yourself. I have a code sample to do that if you choose this route.