Question:
If a program executes and begins a "wait", and the original conditions that executed the program become true again before the wait elapses, what happens? Does the ISY99i spawn a second copy of the program, terminate the original and start over, or does the original have to finish before we can re-execute? If the original program is not terminated and restarted, then how do we build timers that can be terminated or reset before completing?
Practical example:
I want to brighten the outside lights when motion is detected, then dim them back down after a minute without motion. I'm using a Dakota EZSnsRF motion sensor which briefly turns on every time motion is detected. Program should be simple enough, if (status of EZSnsRF motion sensor = on) then (brighten, wait 1 minute, dim).
What happens if, 40 seconds into the wait, the motion sensor is triggered again? Does the initial execution of the program continue and execute the dim function after the remaining 20 seconds have lapsed? If so, have we now spawned multiple copies of the same program, each with their own wait running? Or is that initial execution terminated and restarted, effectively resetting the 1 minute timer? I'm hoping for the latter, of course; if that is not the case, how do I handle this?
Thank you!