T3-TB resetting : one Pulse Counter Slow variable reset and not another one

my T3-TB usually works normally.
I’ve added a simple water meter which is connected (2 wires) to an input (set to Pulse Count Slow 1Hz). No programming for the moment. This system worked as expected for about a day, accumulating increments in this variable (1 count = 1 gallon).
The next day, I noticed that my meter was at about a few dozen gallons, whereas the day before, it was at about 500 gallons. A control graph showed me that the counter went to zero at around 3 a.m. The next day, it was at a few dozen gallons.
No power failure at that time (I have another T3-TB that didn’t reset).
More surprisingly, only this variable went to zero, while other variables of the same type (used as counters) retained their values.
Do you have any idea why this happened and why just one variable reset to 0?
A (perhaps stupid) idea: would this error be possible if the counter stopped just at the moment of “contact activation” measured by the T3 unit?

230905 - T3-TB auto resets

Update for today

Some entries have been changed spontaneously today for unknown reasons. See image below.
5 variables lose their range and become undefined.
And, of course, the program that manages these variables no longer works as intended.
Is my unit dying?

In the meantime, again, when I reset my unit, this new variable (Pulse Count Slow) loses its value (resets to 0), while the others, previously created, keep their value.

is it possible to force a value into a counter? When I set a value for this variable, it spontaneously resets to the value measured before the change.
Was it 0? It resets to 0
Was it 5? It resets to 5

Update 2

I solved the problem of variables losing their range.
Another PLC extracts (modbus) values from this T3-TB (statistics and monitoring). For some unknown reason, some parameters of this PLC are interfering with the variable itself (its range).
I removed the monitoring from my plc and the variables kept their range, which solves my first problem.

There remains the problem of the variable resetting to 0 on T3 reset, and the possibility of forcing a value for this kind of variable.

Update 3 (partial solution)

I created another variable (Pulse Count Slow) which takes the value of the first variable (which spontaneously sets to 0) according to :

40 IF WATGNOW <> 0 THEN WATGDAY = WATGDAY + WATGNOW , WATGTOT = WATGTOT + WATGNOW , WATGNOW = 0
50 WATLDAY = INT ( WATGDAY * 4.546 )
60 IF TIME = 00:01:00 THEN WATGDAY = 0

where WATGNOW is my problematic variable and WATGDAY is the variable that memorizes the value of WATGNOW (but does not reset when the T3 reboots).

So the only question left is: why does one Pulse Count Slow variable reset and not another?

1 Like

We are analyzing the cause and thank you for your feedback.

1 Like

One thing that I often end up emphasizing to folks is to keep the program statements simple, it makes for easier debugging and reduces the chance that the interpreter is getting caught up somehow. I have created a new local variable FLAG1 in order to save one of the global variables. Use that flag and break your long line 50 into three simpler lines.

I also like to use the IF+ statement throughout the program so that it triggers exactly once per event.

40 IF WATGNOW = 0 THEN FLAG1 = TRUE ELSE FLAG1 = FALSE
41 IF+ FLAG1 THEN WATGDAY = WATGDAY + WATGNOW
42 IF+ FLAG1 THEN WATGTOT = WATGTOT + WATGNOW
43 IF+ FLAG1 THEN WATGNOW = 0
50 WATLDAY = INT ( WATGDAY * 4.546 )
60 IF+ TIME = 00:01:00 THEN WATGDAY = 0

Thank you Maurice for the clue. I made that quick prg in a hurry to check my T3.

Btw, if I want to reset a variable once a year (1 of january), the correct instruction is :

100 IF+ DOY = 1 THEN WATGYEAR = 0

and this one is not needed
100 IF+ DOY = 1 AND TIME = (00:00:01) THEN WATGYEAR = 0

Correct ?

1 Like

Looks ok at first glance. Why not just test it out with a different date to confirm. You could create a variable to hold the day of year (DOY command) and manually toggle the date var back and forth through time.

Maurice

1 Like

For TB, we did not store the pulse counter when it reboot before. i fixed it in latest firmware rev64.4. you can update it by T3000.exe automatically.

T3000->help->check for updates->

2 Likes