AnsweredAssumed Answered

How to save a specific timestamp of output based on a calculation (avg) of an Input TAG using PI Analyses?

Question asked by Lowreno on Oct 8, 2015
Latest reply on Nov 6, 2015 by Lowreno

    I’d like to know if is possible using PI Analyses to save the timestamp of output relative an avg of an Input TAG.  See below the picture:




      So, let´s say that NAGUA value arrived at “01/01/2015 01:21:12” and triggered “Calc_PERVOLUTIL_ONE_SHOT”. The first instruction line is taking the average of NAGUA values from “01/01/2015 01:11:12” (*-10m) until “01/01/2015 01:16:12” (*-5m)”; the second instruction will use the attribute “avgNAGUA” which will execute a table lookup according the attribute “PERVOLUTIL_ONE_SHOT” and save the result to TAG “PERVOLUTIL_ONE_SHOT_Output”. So, according advanced options, we will have the following options (and values according NAGUA tag input):


- Trigger time (default option) -> “01/01/2015 01:21:12”;

- Execution time -> “01/01/2015”.  Where “x” depends how much time of processing was used to execute the calculation;

- Relative to trigger time -> any time based on “01/01/2015 01:21:12”;


    What I’m looking for is a way to have an output time based on something "simple" like below:


If  Minute(“Trigger Time (Eg. '01:21:12')”) > 30 then

       Output time must be:  02:00:00.000 // Add some minutes until the immediate next “on the hour”


       Output time must be: 01:00:00.000 // Remove some minutes until immediate previous “on the hour”


     In my example, the output to be recorded at "PERVOLUTIL_ONE_SHOT_Output" should be: “01/01/2015 01:00:00.000”.


     ... Should "Event Frame Generation" do the job ? ?...

     ... Should I create another attribute on my template to have success on it?

     ... Shoul I pray ?... ;-)


    Thanks in advance!