Jump to content

Need clarification on From/To program running after boot


smorgasbord

Recommended Posts

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 by smorgasbord
Link to comment

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 by larryllix
Link to comment

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 by smorgasbord
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Forum Statistics

    • Total Topics
      37k
    • Total Posts
      371k
×
×
  • Create New...