I have a condensation pump I monitor in my basement. It counts how many times it runs and if it runs for more than 5 minutes, it is supose to send me an email. I don't get many false alarms, but I am getting them. I know that it is not running for more than 5 minutes. Here is my code...
START
CALLSUB RESETS
TSTEQ IP7 1
CALLSUB CONCOUNT
END
RESETS:
TSTEQ IP7 0
SET RAM5 0
TSTEQ IP7 0
SET RAM8 0
RET
CONCOUNT:
TSTEQ RAM5 0
ADD VAR2 1 VAR2
TSTEQ RAM5 0
SET RAM6 CM
SET RAM5 1
SUB RAM6 CM RAM7
TSTGT RAM7 6
GOTO CONALERT
RET
CONALERT:
TSTEQ RAM8 0
EMAIL EM3
SET RAM8 1
RET
What would make this code work better?
Thanks
START
CALLSUB RESETS
TSTEQ IP7 1
CALLSUB CONCOUNT
END
RESETS:
TSTEQ IP7 0
SET RAM5 0
TSTEQ IP7 0
SET RAM8 0
RET
CONCOUNT:
TSTEQ RAM5 0
ADD VAR2 1 VAR2
TSTEQ RAM5 0
SET RAM6 CM
SET RAM5 1
SUB RAM6 CM RAM7
TSTGT RAM7 6
GOTO CONALERT
RET
CONALERT:
TSTEQ RAM8 0
EMAIL EM3
SET RAM8 1
RET
What would make this code work better?
Thanks