AnsweredAssumed Answered

Run Analysis using AFSDK

Question asked by nthorson on Mar 12, 2018
Latest reply on Mar 28, 2018 by lmurphy

I have a scenario where out of the box Analysis scheduling is not meeting my needs (or at least I don't know how to configure it to do so).  I am currently using Analysis 2016 R2.  Here is the basic scenario.


1.  Custom Windows Service pulls data from an FTP every 24 hours and writes data to PI

2.  Service writes data to 2 PI Points, i.e. pi_point_1 and pi_point_2

3.  The values have 15 minute intervals, so every 24 hours 96 new values are written to each PI Point

4.  From here I want to use Analysis to do some additional processing of the data and write the results to a new PI Point.  For simplicity's sake, assume the following.


pi_point_3 = pi_point_1 + pi_point_2


Problem is if I use event based updates, I have to use both pi_point_1 and pi_point_2 as triggers.  Therefore, I get two values with the same timestamp for pi_point_3.  If I could configure Analysis to use "Replace" instead of "Insert" like you can with the AFSDK, it would not be a problem. However, I don't see anywhere where I can do that.  Furthermore, I can't use periodic updates because the data comes in up to 24 hours after a value's timestamp.  If I could set a delay on the periodic updates, it would fix the problem. 


The only solution I see is to have my service execute the Analysis using the AFSDK.  However, I am not sure how to do so.  Is there example code or tutorial on this capability?