Announcement

Collapse
No announcement yet.

TMRAG bug?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts


  • TMRAG bug?

    I've noticed that I'm losing the persistence of global timers over a power failure. Is that a bug or a feature?


  • #2
    It does NOT time when power is off, if that's what you are seeing. The calendar clock does keep time (as long as you have a battery), so if you can deal with second resolution (not millisecond), you could write code that uses DST21 (UTC 1970 Epoch value) or DST22 (Local 1970 Epoch value) to evaluate "time".

    Basically store off DST21 when you "start" (say D42), then calculate the "accumulator" in a MATH box and store the accumulator in seconds in D100
    MATH D100 "DST21 - D42"
    There are 10 kinds of people in this world, those who know binary, and those who do not.

    Comment



    • #3
      I'm sorry, I was vaguebook posting again... What I'm seeing is that either on the way down or the way up, the accumulators are getting zeroed.
      It would be a neat trick to have it continue counting with no power! Thanks for the recovery trick though, I do that to determine downtime.

      Comment



      • #4
        Check the power flow input to your RSTT for that specific T timer, maybe stick an INC on the same rung to help debug it. The INC value should only be different whenever you believe the TMRAG should be resetting.

        Also, if you have more than 1 RSTT to that T timer, definitely stick an INC on all of them.
        There are 10 kinds of people in this world, those who know binary, and those who do not.

        Comment



        • #5
          Ok, thanks, I'll dig deeper. Not a known bug then?
          Only one RSTT per timer at the end of day, when I roll logs (3 TMRAG's). They're counting on time for clutches and motors. It's also possible I have a race condition, as I log then reset.

          Edit - Strike the race condition - it only happens after power loss. Without PL, code logs and resets just fine.
          Last edited by psvail; 04-16-2019, 03:47 PM.

          Comment



          • #6
            Originally posted by psvail View Post
            Ok, thanks, I'll dig deeper. Not a known bug then?
            No. I'm playing with a TMRAG synchronized with the ST4 (half second on/half second off), and it is accumulating a half second on every second, on the nosey (to the millisecond). 500ms, 1000ms, I am now up to 9m 39.500s, in sync with ST4.

            There are 10 kinds of people in this world, those who know binary, and those who do not.

            Comment



            • #7
              Try pulling the plug, then look at the accumulators after it comes up, of course. I'm on a BRX18e-23, btw.
              Last edited by psvail; 04-16-2019, 04:10 PM.

              Comment



              • #8
                Originally posted by psvail View Post
                Try pulling the plug, then look at the accumulators after it comes up, of course. I'm on a BRX18e-23, btw.
                They did reset, but that's because my RSTT rungs also reset at power-up ($FirstScan). I put an INC below my RSTT and saw it went from 0 to 1 after power-up (hence I know the RSTT instructions executed, which explains why my TMRs reset).
                There are 10 kinds of people in this world, those who know binary, and those who do not.

                Comment



                • #9
                  What happens if you remove the RSTT and cycle power?

                  Comment



                  • #10
                    I no longer reset on power-up, and they are not resetting, and their .Acc values are being retained. I presume all your Timers are retentive (they are by default).

                    BTW, I am doing the same thing with a TMRA as I am with my TMRAG (T1 and T0 respectively), and they are in-sync, to the millisecond.
                    There are 10 kinds of people in this world, those who know binary, and those who do not.

                    Comment



                    • #11
                      Huh. Must be me then. Yes, I checked that too. Thanks for experimenting, I'll let you know how I make out.

                      Comment

                      Working...
                      X