smorgasbord Posted 23 hours ago Share Posted 23 hours ago (edited) I've read https://wiki.universal-devices.com/index.php?title=ISY-99i/ISY-26_INSTEON:Scope,_Precedence_and_Execution_Order#Boot/Startup_Sequence_and_Program_Execution_Order but still have questions. I have a program like this: If From 7:00:00AM To 10:00:00PM Then Repeat while $sOnVacay is not 0 (Actions) Else (No Actions) If the EISY reboots during the day, will this program get started (if enabled)? Or, should I set it to Run At Startup and let the "If Schedule" do its thing? The Repeat code essentially does a thing every 30 minutes (there's a Wait) during the From/To time period. I don't want to have two (or zero) copies of this routine running, naturally. EDIT: What I mean by that last comment is a question as to whether programs in EISY are re-entrant. That is, can you have multiple copies of the same program running in different threads at the same time? Basically, if a program is running, and say is at a long Wait, and another program directly invokes the Run(If) of that first program, what happens? And then, if a program is running and is at a long Wait, and one of the If conditions change, how is the program re-run? Does it wait for the first execution to complete or does it terminate what's running to run it again with the new conditions? TIA Edited 23 hours ago by smorgasbord Quote Link to comment
larryllix Posted 18 hours ago Share Posted 18 hours ago (edited) If you call the program (If, Then, or Else), previous execution will be cancelled as soon as it encounters a Wait or Repeat command line. There is no threading/multitasking of a program. Run at Startup will execute the If section and consequentially run Then or Else. The program will self start after power up at 7:00 AM and 10:00 PM and run Then or Else respectively. Edited 17 hours ago by larryllix Quote Link to comment
smorgasbord Posted 10 hours ago Author Share Posted 10 hours ago (edited) Thanks. What about calling other programs? Will something like this work as expected: Repeat while $sOnVacay is not 0 Run Program 'Prog2' (Then Path) $sOnVacay -= 1 I understand that if a single program gets called while it's already running the previous instance of that running program will stop at Wait or Repeat, but if a program calls another program (which could even call a third program), is that all "normal" as an old "C" programmer would expect, or is the execution stack somehow different? Edited 9 hours ago by smorgasbord Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.