Please login or register.

Login with username, password and session length

Author Topic: Help with model Railroad  (Read 2597 times)

BernieB

  • Newbie
  • Helpful Post Rating: 1
  • Posts: 7
Help with model Railroad
« on: March 16, 2012, 04:57:09 PM »

I finally got around to using Home Pro and now I have smart macro. A while a go I asked how to start a looping macro to run to turn on a device on my railroad, run it a while, shut it and put on the next, etc., and then at the end start over. I got the following advice. What I have no idea is how to turn on flags and put in the commands. Can someone give me more detailed instructions for the start.


Here's a basic way to do it, using a few macros that call each other:

This is the setup for one of the groups, but you would set the other one up the same way.
In this example, the trains are on modules L1 to L5, and the macros are on M1-M5.

Macro M1 On:
    If Flag 2 is on then (Allows for breaking out of the macro loop - explained below)
        L1 On (turns train on)
        Delay 1 minute
        L1 Off (turns train off)
        M2 On (calls next macro)
   End of Macro

Macro M2 On:
    If Flag 2 is on then
        L2 On
        Delay 1 minute
        L2 Off
        M3 On
   End of Macro

Macro M3 On:
    If Flag 2 is on then
        L3 On
        Delay 1 minute
        L3 Off
        M4 On
   End of MacroMacro M4 On:
    If Flag 2 is on then
        L4 On
        Delay 1 minute
        L4 Off
        M5 On
   End of Macro

Macro M5 On:
    If Flag 2 is on then
        L5 On
        Delay 1 minute
        L5 Off
        M1 On (calls first macro in the sequence, starting the loop over again)
   End of Macro

You can create separate macros to turn on and off Flag 2 (It has been suggested to avoid using Flag 1 as it has been unreliable in the past). Turning off Flag 2 will stop the sequence when the currently running macro ends (since the next one will start, see the flag is off, and stop). You can restart the chain at any point by turning the flag back on, and starting any one of the 5 macros. You can also run each train manually using their L# addresses.
Logged

evadorev

  • Sr. Member
  • ****
  • Helpful Post Rating: 4
  • Posts: 79
Re: Help with model Railroad
« Reply #1 on: March 21, 2012, 02:56:13 PM »

I need the info too for a future project !!! ::)

I`M REALLY NOT SURE but i think, you have in smart macros, a flag set step that you can add in a macro. you have to make a macro that only set a flag.

Most of the people know better how to do it  :)
Logged
Mary had a little lamp, little lamp, controlled by X10 !!!! (kid song!!)

gg4000

  • Sr. Member
  • ****
  • Helpful Post Rating: 2
  • Posts: 116
  • Been playing x-10 since Windows 3.0
    • GG4000.com
Re: Help with model Railroad
« Reply #2 on: April 12, 2012, 05:27:06 PM »

I need something like that too. I set the flag with Macro 1. Macro 2 should not run. But it does. B:(

Noam

  • Community Organizer
  • Hero Member
  • ***
  • Helpful Post Rating: 51
  • Posts: 2818
Re: Help with model Railroad
« Reply #3 on: April 12, 2012, 05:50:25 PM »

I need something like that too. I set the flag with Macro 1. Macro 2 should not run. But it does. B:(

I replied to your other post. It sounds like you are either not setting the condition right, or aren't testing correctly.
Logged
 

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