Jump to content

Better to enable/disable program or have it check flag?


peterd

Recommended Posts

I have a program which alerts me of a condition. I only want 1 message per day, so the program tests the value of a flag variable (reset @ midnight by another program).

 

Would enabling/disabling the main program be significantly more efficient than using the flag?

 

Thanks,

Peter

 

EDIT: I should mention that the condition I'm checking (back-pressure indicating that a filter needs changing) should only occur once every 12 - 18 months. When it does there may be a period of several days (to several weeks if I were out-of-town) before the filter is changed, During this time, the pressure switch would close & re-open every 5 - 10 minutes when the pump cycles. All the rest of the time the main conditional test (Insteon status = ON) in the program would be false.

 

Do I understand correctly that until the ON event occurs, the program never actually runs?

Link to comment
[...] Both approaches have the same efficiency.
Thanks, Michel -

I find that the program as I've written it

If
        Status  'Filter Pressure Switch' is On
   And $Filter_Clogged_Msg_Sent_Today is $FALSE

centralizes both conditions in one place and is completely self documenting, so thank you again for variables! :)

 

Peter

Link to comment

Archived

This topic is now archived and is closed to further replies.


×
×
  • Create New...