Timer Alarm Email

MobileMe

Active Member
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
 
CM is current minutes in the hour.
SUB RAM6 CM RAM7
may get value that is not exactly you wanted.
When CM is 58, SET RAM6 CM will put 58 in RAM6. However, 3 minutes later, CM will be 1.
 
CM is current minutes in the hour.
SUB RAM6 CM RAM7
may get value that is not exactly you wanted.
When CM is 58, SET RAM6 CM will put 58 in RAM6. However, 3 minutes later, CM will be 1.

So putting in a timer would be the way to go? I just have to figure out how long my code takes to run through itself and count each run. Then set off the alarm when the counter gets high enough. Sound like I have some testing to do.
 
Back
Top