4 Replies Latest reply on Jul 25, 2016 12:51 PM by LSIndK

    AF analysis writing wrong value in DB


      Hi: I have  some issues with AF analysis.

      I have an analysis that write a value in a tag. In AF it looks ok, but a different value is being written in the tag.

      In the picture you can see the correct result.  It shows the result to write is Zero 0, but when I check  the tag in the DB, the value written is 921 (it is CurrentDuration) 



      Tag Values:



      When I do Backfill, the backfill works ok, writing the right values…  Any clue? Any suggestions about what can I check?





        • Re: AF analysis writing wrong value in DB

          Hi Lisaury,


          Would you be comfortable sharing the expressions you used for each of the variables in your analysis so we can have a better understanding of what steps are taken?

          • Re: AF analysis writing wrong value in DB
            John Messinger

            Have you looked at this KB article that discusses the type of behaviour you are describing? Is there anything in here you see that might apply in your particular situation?

            1 of 1 people found this helpful
            • Re: AF analysis writing wrong value in DB

              Hi Lisaury,


              could you please also share the analysis, as well as the origin of the input tags?


              • Re: AF analysis writing wrong value in DB



                Thank you for the comments.  I couldn't find a solution, so I deleted the analyses. I found another way to do the calculations I wanted.


                The functions I was using were PrevEvent, TimeEq and TagVal. There was one input tag ('VoltageException' int16) and the output tag for the duration (VoltageExceptionDuration float32)


                The analyses were:

                timeCurrentevent  PrevEvent('VoltageException','*+1m')

                CurrentValue if BadVal(TagVal('VoltageException',timeCurrentevent)) then 0 else Tagval('VoltageException',timeCurrentevent)

                Duration if BadVal(TimeEq('VoltageException',timeCurrentevent,'*',1)) then 0 else TimeEq('VoltageException',timeCurrentevent,'*',1)

                CurrentDuration if BadVal(TagVal('VoltageExceptionDuration','*')) then -1 else TagVal('VoltageException|Duration','*')

                DurationToUpdate if CurrentDuration=Duration then NoOutput() else Duration  (OUTPUT)


                With the analyses  I noticed:

                (1) The analyses worked with a Schedullig Event-Triggered, but they didn't work with a scheduling periodic.

                (2)if  I didn't use the functions  PreEvent or  timeEQ, the analyses worked with a periodic schedule.  Are there limitations in the use of these functions with a periodic schedule???

                (3) The backfill worked well with any schedule.