🖥️ActiveHome Pro > Software Problems & Bugs
"Looping" Macros revisited
LAF:
I don't know if this has been fixed as a search for "looping macros" only turns up old, previous AHP versions, posts.
Anyhow, I have run a macro experiment and am getting poor results. My program consists only of two simple macros each of which delays for 2 seconds and then triggers the other via an appliance On command. So, it cycles back and forth between the 2 macros and seems to continue indefinitely. Until however, a command is received from a remote controller, either via power line or RF, not matter what HC the remote is set to. When that happens, the macros stop (but not always if only one command is received, sometimes two or three are required i.e. it seems kind of random in that respect).
Now, I see no logical reason why any of that should happen so I'm wondering if the past admonishments against using looping macros are still valid? If only a single macro which triggers itself after some delay was being used, I can see why that might cause problems as the macro would be re-entered repeatedly without ever exiting and causing a stack overflow or some-such thing but the two macros triggering each other do not do that so I don't see why it shouldn't work.
LAF:
Update: Tried it with only one macro triggering itself (after 2 sec delay). It's now gone over 1200 iterations w/o stopping (but also will halt if a remote command is executed as the two macro case).
LAF:
OK, I think I've answered the question why other commands are stopping the macros. The macro trigger commands are on the power line and the remote commands are stepping on them. This even happens with an RF remote command as the resultant command is also put on the power line(??).
This, if the case, is IMO bad news as it implies that anything triggering a macro, a remote command or a command from another macro, can be randomly defeated. :( B:(
It looks like X10 does not handle "party line" communication very gracefully.
Tuicemen:
There are situations where one would wish looping macros.
But you must create an exit like using a flag, time, module condition
If you only have polite transmitters you shouldn't have signals stepping on each other
LAF:
What's a polite transmitter?
I still don't see why an exit is a necessity - my test macro(s) seem to run w/o problems (other than the signal collisions but that could occur with looping macros or not).
Navigation
[0] Message Index
[#] Next page
Go to full version