3 Replies Latest reply on Sep 14, 2018 7:57 PM by jamespr

    How to avoid write unnecessary values when a new Output parameter is created using PI Analysis?

    jamespr

      I’m creating an analysis to detect when two conditions are true and collect that Boolean value into an Output Attribute with the Save Output History to Yes. The problem that I’m having is how to avoid write unnecessary values to the PI Point. I follow the example on the “Guide to Tips and Tricks in Asset Based Analytics” (Page 20) but I’m not able to achieve the desire result.

       

      This is my code so far:

      Name

      Expresion

      Output Attribute

      Condition1

      If BadVal(‘Cond1’) Then 0 Else ‘Cond1’

      Map

      Condition2

      If BadVal(‘Cond2’) Then 0 Else ‘Cond2’

      Map

      StatusActive

      If  Condition1 > 5 And Condition2 > 15

      AF_Status_Output

       

      This is an example of the Preview Results:

                                                                                                                                                                                                                                                              

      Trigger TimeCond1 [output]Cond2 [output]StatusActiveCond1 [input]Cond2 [input]
      2/3/2018 21:435.73281.036405.73281.0364
      2/3/2018 21:433.8153003.81530
      2/3/2018 21:450.818780.4716900.818780.47169
      2/3/2018 21:462.33643.068302.33643.0683
      2/3/2018 21:462.33647.317202.33647.3172
      2/3/2018 21:469.16812.00309.16812.003
      2/3/2018 21:4712.24314.139012.24314.139
      2/3/2018 21:4712.67516.798112.67516.798
      2/3/2018 21:4714.20117.496114.20117.496
      2/3/2018 21:4714.20118.825114.20118.825
      2/3/2018 21:4716.89417.892116.89417.892
      2/3/2018 21:4720.87718.789120.87718.789
      2/3/2018 21:5435.10419.796135.10419.796
      2/3/2018 22:1935.86819.702135.86819.702
      2/3/2018 22:1931.73718.708131.73718.708
      2/3/2018 22:1924.8649.8382024.8649.8382
      2/3/2018 22:1920.9656.2293020.9656.2293
      2/3/2018 22:1916.4742.5621016.4742.5621
      2/3/2018 22:1911.660.55718011.660.55718
      2/3/2018 22:199.7864009.78640

       


      Every item is written to the PI Tag defined thru the AF_Status_Output. My question is, it is possible to write the values only when an change from 1 to 0 or vice versa occurs? Like in the table below? If I follow the example describe in the guide I'll get a calc fail status because Tag does not have a value yet.

                                                                                                                                                                                                                                                                          

      2/3/2018 21:469.16812.003-
      9.16812.003
      2/3/2018 21:4712.24314.139-
      12.24314.139
      2/3/2018 21:4712.67516.798112.67516.798
      2/3/2018 21:4714.20117.496-
      14.20117.496
      2/3/2018 21:4714.20118.8250
      14.20118.825

       

       

      Any help will be very welcome!