Please login or register.

Login with username, password and session length

Author Topic: Can a macro be interupted?  (Read 10000 times)

Ice

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Can a macro be interupted?
« on: August 29, 2009, 09:29:16 PM »

After a macro has been activated, can it be interrupted if it is called again?  Does it continue to run until the end and ignore the intervening call?  Are the intervening calls applied after the macro is finished? 

Or does it start over from the beginning if it is called while it is working? 
Logged

bitman

  • Hero Member
  • *****
  • Helpful Post Rating: 9
  • Posts: 597
Re: Can a macro be interupted?
« Reply #1 on: August 29, 2009, 11:57:02 PM »

I don't know myself.
But when I wish I could, I retest at macro end to see if the cause of the macro firing is still necessary.
Then bail out if not.

Such as:

Oh NO! The garage door is open!
I'll wait 10 minutes then I'm calling him on the phone.  <<-- if door closes, I want don't want a call, here is where I       wanted to interrupt it.
                   
-after 10 minutes:

Door still open?
No,

Reset everything

Yes,

Panic, and call.
Logged
Long live X10! - Because I just like it is all.....

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Can a macro be interupted?
« Reply #2 on: August 30, 2009, 03:03:40 AM »

Generally speaking:
Once a macro starts, it continues to the end.
If the macro is triggered again before it finishes, it starts again from the beginning.  (Off the top of my head, I'm not sure if that means there are two instances of the macro running now, or just one that started at the top.  Maybe someone else can clarify that.)

To keep a macro from re-triggering when it's already running, you can check either a flag or a module's status at the beginning of the macro and only continue if the flag is / is not set, or the module is on / off (your choice).  Obviously, if the macro checks these and decides to run, you need to set or clear the flag, or issue a command to turn the module on or off as the second step in the macro so that if it gets triggered again, it will see that it is already running.  Also on any exit of the macro, you will have to change the flag or module status back, to show the macro is not running, otherwise, it will never run again.


Clear as mud?   B:(

 >!
Logged
-Bill- (of wgjohns.com)
bill@wgjohns.com

In the real world, the only constant is change.

When I'm online you can find me in the Home Automation Chat Room!

Ice

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 7
Re: Can a macro be interupted?
« Reply #3 on: November 15, 2009, 12:02:47 AM »

Can Active Home Pro run two macros at the same time?  Or does it run a first macro until it is finished and then start a second macro?  If it is the latter, does it store the second macro request for execution later or must the second macro request come after the first macro has finished? 

Thanks
Logged

joako

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 24
Re: Can a macro be interupted?
« Reply #4 on: December 27, 2009, 03:09:21 AM »

Yes it can run 2 macros at once. What you can do is create a 2nd macro triggered from the first

Macro a1
IF whatever for your powerflash
wait 10 minutes
trigger macro a2

macro a2
IF whatever for your powerflash
whatever for your phone call
Logged

Mellowmark

  • Hero Member
  • *****
  • Helpful Post Rating: 6
  • Posts: 195
  • M M Electric
Re: Can a macro be interupted?
« Reply #5 on: December 27, 2009, 10:19:49 AM »

I know for sure AHP can run more than one macro at a time.  Flags are the way I use to keep a specific macro from being re triggered. I would have to think that some logic could be used to successfully accomplish the task   {re trigger some event inside an existing macro} using flags and conditions.  As I do not think there is any way to automatically purge the running macro's without a hard purge in the tools menu.  Ice if you lay down the specifics of your task, someone can most likely help you layout some code to accomplish it.
                                                          :)+
I would also like to see some
examples of macros that will
start over like you are suggesting.
Logged
M M ElectricMan
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.