The manual for T3000 - Overview / Software (p16) notes the feature Run-time totaliser.
How do I implement this? I do not see any predefined function anywhere.
I want to record the total life-time running hours for (say) a pump, and have this increment in real time while the pump is running, stop when the pump stops, then resume accumulation when pump starts again.
One approach could be:-
10 REM run-hours totaliser (eg for pump PMP1)
20 REM define VAR1 = total run-hours including last start (Previously stored)
30 REM define VAR2 = total run hours including this start so far
40 REM display VAR1 until pump starts, then display VAR2
50 START PMP1
70 REM Calculate total run-time so far this start
80 VAR2 = VAR1 + TIME-ON(PMP1)
85 REM when pump running, display VAR2 instead of VAR1
90 REM totaliser updates every scan
500 STOP PMP1
510 REM update VAR1 totaliser when pump switched off
520 VAR1 = VAR2
525 REM when pump stopped, display VAR1 instead of VAR2
Is there a better way to achieve this?
Maurice will probably have a better answer than mine, but I had some problems with data stored in variables (after a shut down/reboot) and I’m still using this:
Label P1 is related to my motor (in fact, a pump, so P1), an output
define 3 inputs (pulse count, slow count) for seconds, minutes and hours
OUT1 Rtime sec (label P1RS)
OUT1 Rtime min (label P1RM)
OUT1 Rtime hour (label P1RH)
in your program:
150 REM MEASURE RUNNING TIME OF PUMP1 ( IN SEC/MIN/HOURS )
160 IF INTERVAL ( 00:00:01 ) AND P1 = 1 THEN P1RS = P1RS + 1
170 IF P1RS >= 60 THEN P1RM = P1RM + 1 , P1RS = 0
180 IF P1RM >= 60 THEN P1RH = P1RH + 1 , P1RM = 0
that means: every second the pump is running, P1RS increases
after 60 secs, P1RM increases and P1RS reset to 0
after 60 mins, P1RH increases and P1RM reset to 0
I used that counter since months without problems, even after reboot of lan failures (values are kept). I use seconds because I can see in my display the real running time of this pump and not wait for a minute.
In my case, I also added a standby time (no work since) and another counter just for the running time of the day
Thank you Mike,
Your approach seems a bit simpler than mine