PDA

View Full Version : INFO: Looping mControl Macros


Ted Singh
10-01-2010, 10:15 PM
While mControl does not include any explicit looping or iteration elements, it is possible to create macro loops.

As a protection mechanism an mControl macro must enter a "Ready" state before it can run again. A "Ready" state is usually available 2 seconds after the last macro action is complete. This protection mechanism hence precludes using a Run macro command to re-run the same macro.

As a workaround, you may consider calling a second macro, which delays for 2-3 seconds, before calling the original macro. This two macro solution provides a mechanism to create loops.

To step out of these loops, you may need a third macro, which issues Macro Stop actions to the looping macros.

modemmike
10-23-2010, 10:14 PM
Thanks for clearing that up for me. I was pulling my hair out wondering my macro was not working. I used this scenario for making my over head LED lights change from one color to another throughout the night... kind of a light show.

Also, it should be noted that I had trouble getting the "Run Macro - stop" to work properly. I discovered issuing the pause command works but if you then send the stop it will start running again but the pause works just fine.