ketchup318 Posted June 14, 2010 Posted June 14, 2010 Hi I have a program that checks to see if the garage door is opened, and if it's past sunset, it turns on the light. While writing the code, I stumbled across an interesting question. When does the ISY check the condition of a program? For instance, in the following code (paraphrasing code) IF After sunset and before sunrise AND status garage door is ON THEN does the ISY check the program every second? That seems a bit inefficient. Is it better to write the code like the following IF status garage door is ON AND after sunset and before sunrise THEN Is this more efficient since the code is only checked when the garage door status has changed? Thanks
Sub-Routine Posted June 14, 2010 Posted June 14, 2010 Hello ketchup318, Either way will produce the same result. The program will run when the garage door status changes. Rand
ketchup318 Posted June 14, 2010 Author Posted June 14, 2010 Hey Sub-Routine Thanks for the reply. I understand the result will be the same, but is it more beneficial to write it one way over the other?
Sub-Routine Posted June 14, 2010 Posted June 14, 2010 Practically there is no difference. The program will run when the status of the door changes. Then it will check the time constraint. You could put the program in a folder with the Schedule Condition on the folder which will disable the program outside of the hours you want. But it only takes a few clock cycles either way.
Recommended Posts