News:

  • April 15, 2026, 10:30:20 PM

Login with username, password and session length

Author Topic: Global Accumulating Timer and PLC Restart  (Read 5471 times)

Bolt

  • Hero Member
  • *****
  • Posts: 594
Global Accumulating Timer and PLC Restart
« on: August 24, 2020, 12:42:29 PM »
I have two TMRAG's, and whenever I do a PLC restart, they revert to 0 accumulated time.
I have addressed with some rungs, in $tLastScan I copy both Timer.Acc's values to D registers.
Then, in $tFirstScan, I copy the values back to the Timer.Acc's.

One of the Timers, T37, always continues with "old" value, the other, T0, does not, it starts over at 0.

EDIT: Both timers start over at 0, they are not "taking" the COPY of the restored value.

The T0 logic is in $tBottomOfScan, whereas the T37 logic is in a Program.  They are both really simple logic: if contact closed, run timer.

Both the INC functions do occur, so the rungs are triggering.  See attached screenshots.

What can I do to troubleshoot here?  Both of the D registers have the correct, $tLastScan, value in them after restart.
« Last Edit: August 24, 2020, 03:17:18 PM by Bolt »

franji1

  • Bit Weenie
  • Host Moderator
  • Hero Member
  • *****
  • Posts: 3803
    • Host Engineering
Re: Global Accumulating Timer and PLC Restart
« Reply #1 on: August 24, 2020, 01:40:48 PM »
Good diagnostics.

Make sure you are not using T0 in multiple timers (e.g. TMR and TMRAG).  T37 sounds like it would never get re-used.  T0 is definitely a possibility.

Also, make sure you are not doing a RSTT (Reset Timer) with T0.  If so, make sure that rung's input logic survives a re-start.

One thing to do, do a Find All for T0, but make sure you do NOT check "Match Exactly", but you DO check "Match In Range" (this should be the default).  The Find All will dump the Find Results to the Find Results window (it's like the Output Window).  It will include any .Done .Timing .Acc, etc.  Look at all of those and see if you see anything "strange" (e.g. a rogue MEMCOPY???).

Bolt

  • Hero Member
  • *****
  • Posts: 594
Re: Global Accumulating Timer and PLC Restart
« Reply #2 on: August 24, 2020, 04:37:04 PM »
I have replicated the problem into a simple program that runs in Do-more Simulator.  I have placed instructions in the first rung of $Main.

The problem occurs ONCE after a RSTT instruction, and then not again on subsequent program mode cycles.

Please have a look at your convenience.

Bolt

  • Hero Member
  • *****
  • Posts: 594
Re: Global Accumulating Timer and PLC Restart
« Reply #3 on: August 27, 2020, 11:12:18 AM »
Were you able to re-create the scenario using my simulator code?

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6154
  • Yes Pinky, Do-more will control the world!
Re: Global Accumulating Timer and PLC Restart
« Reply #4 on: August 27, 2020, 12:21:25 PM »
Were you able to re-create the scenario using my simulator code?

Yeah, sorry. It's a bug. And it's fixed. Hopefully the fix doesn't break anyone. This was a Day 1 problem.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO