Timer Resets Before Completion (168-Hour Countdown)

I’ve written a simple code to run a countdown timer for 168 hours (i.e., 604800 seconds), but the timer unexpectedly resets after running for some time, without completing the full duration. Here is the code I’m using BB Controller:

10 IF TIMERST = 1 THEN TIMER = 604800 , TIMERST = 0
20 IF TIMERST = 0 THEN TIMER = TIMER - 1
30 IF TIMER > 1 AND TIMER <= 10 THEN TIMERST = 1
40 WAIT 1

Maurice’s response:

Try something like this:

if+ interval(0:0:01) then timer = timer + 0:0:01

If+ timer = 01:0:0 then hours = hours + 1

If timer > 01:00:00 then timer = 0:0:0

Needs a bit of work still but this is the idea