Please login or register.

Login with username, password and session length

Author Topic: Macro and flag problem  (Read 4062 times)

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Macro and flag problem
« on: March 23, 2005, 10:13:19 AM »

I have create 2 macros on one address
code : A7 On - macro #1 checks a flag if
Off it turns a light On, else if Off it
resets the flag. Macro #3 (A7 Off) turns On
the flag. For a couple of times everything
works fine and then when you trigger macro
#1 - ALL 3 macro buttons flash and the
light does not turn On.
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Macro and flag problem
« Reply #1 on: March 23, 2005, 11:10:02 AM »

Donald:  Three questions:
- Which flag are you using?
- You say, "ALL 3 macro buttons flash,"
what is Macro #2?
- For Macro #1 you say both the if and else
conditions are when the flag is OFF,
shouldn't one of them be when the flag is
ON?
Logged

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: Macro and flag problem
« Reply #2 on: March 24, 2005, 12:02:00 AM »

I am using Flag #2.

Macro #1 checks flag #2 - if On it executes
macro #2, otherwise it turns on a light
(macro #1).
Macro #2 - Clears flag #2.
Macro #3 turns flag #2 on. Used to skip one
instance of a timed macro.
When macro #1 executes via timer macro
#1/#2 buttons flash which is expected but
after a few times the button for macro #3
also flashes and macro #1 does not execute -
flag #2 gets set but is not cleared.
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Macro and flag problem
« Reply #3 on: March 24, 2005, 10:10:38 AM »

I noticed that v3.183 (which was just
released) has the following fix: “- Fixed a
problem with timers for off-triggered
conditional macros not working.”  I don’t
know if this fix will solve your problem or
not, but it would be worth a try.

I am curious what exactly you are trying to
do with this set of macros?  To me it looks
like if f2 is off it will continuously send
A7-ON and M2 (what ever address it is at)
alternately until A7-OFF is received.  Do
you have any delays in the macro?  Without
them, the powerline will be flooded with
messages.

Regarding your problem, I am not sure how
the CM15a handles macros calling macros but
I would expect the child macro to run
before the parent macro stops.  If this is
true and I understand what you are doing
correctly, you have created a recursive
loop.  You have to be careful with these in
the best of circumstances and with only 256
bytes of RAM to be shared by both the stack
and the heap it won’t take very long to get
a stack overflow which is exactly what I
suspect is happening.  If my assumptions
are correct, what you are seeing isn’t so
much a bug as a limitation.  Optimally what
is needed is a proper looping mechanism
within the Smart Macros Plug-in.
Logged

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: Macro and flag problem
« Reply #4 on: March 24, 2005, 11:00:34 AM »

The intent is to temporarily skip the
execution of a timed macro sequence. Macro
#1 is triggered by a timer - and checks
flag #2 if it is set it runs macro #2 (else
macro) which clears the flag (macro #1 does
not run). Macro #1 runs on the next
scheduled timer event and continues to
until you trigger macro #3 which sets
flag#2.
Logged

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: Macro and flag problem
« Reply #5 on: March 24, 2005, 11:05:11 AM »

I have not tested this with AHP 3.183 yet.
Macro #1 uses a conditional to test flag
#2. It does the module activations. Macro
#2 is the "ELSE" macro and clears Flag #2.
Macro #3 is the macro that sets flag #2.
Logged

roger1818

  • Hero Member
  • *****
  • Helpful Post Rating: 28
  • Posts: 1072
  • Roger H.
Re: Macro and flag problem
« Reply #6 on: March 24, 2005, 11:28:10 AM »

Donald: Oh OK.  I thought you said the
light was macro #1 (a technique sometimes
used to allow macros to call other
macros).  If this isn’t the case, then it
sounds like it is a bug.

Version 3.183 may or may not solve the
problem so it is worth a try.  Let us know
either way.  If it doesn't fix the problem,
I am sure X10Pro will want a copy of your
file.
Logged

X10 Pro

  • Hero Member
  • *****
  • Helpful Post Rating: 23
  • Posts: 1416
Re: Macro and flag problem
« Reply #7 on: March 24, 2005, 12:53:36 PM »

Donald: Pretty interesting macro set-up. If
you send me the file you're using, I'll take
a look at how it's being encoded and see if I
can figure out where it's going wrong.
Logged

jerry r

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 15
Re: Macro and flag problem
« Reply #8 on: March 24, 2005, 01:14:50 PM »

X10, others. A while back I asked for help
regarding a module with timers set to turn
off at night. Since this module controls a
power supply hard to get to, I thought if
there is a way to defeat this should I be
home and not want this turned off, what could
I do.

Donald came up with this idea for me. Since
then I was trying to understand how to test
and apply this to my ahp. When I finally got
this to work with 3.179, I dl the 3.183 and
now this macro and the flags don't set. The
flags seem to just stay off.

I did try clearing the memory too.
Logged

X10 Pro

  • Hero Member
  • *****
  • Helpful Post Rating: 23
  • Posts: 1416
Re: Macro and flag problem
« Reply #9 on: March 24, 2005, 03:31:11 PM »

Jerry: Could you send your data file to
ahpsupport@x10.com? Also, do you have a
diagnostic interface, or your original one?
Logged

donald mcmow

  • Hero Member
  • *****
  • Helpful Post Rating: 0
  • Posts: 306
Re: Macro and flag problem
« Reply #10 on: March 24, 2005, 04:37:47 PM »

OK My test file is on it's way to you. But
it is pretty simple - not as complex as you
are thinking it is though. I have had a
chance to test it with AHP 3.183 and it now
seems to work as expected. There was a
problm with it executing properly under AHP
3.180/1 because the flags weren't being set
properly and there also was a problem with
macro's using the same address code but one
for ON and one for Off that appears to be
fixed this time.
Logged

jerryray

  • Guest
Re: Macro and flag problem
« Reply #11 on: March 25, 2005, 11:50:38 PM »

My file on it's way.
As I said set a flag or two with ver 3.179
and clear them ok, with 3.183 cannot set or
clear them.
Logged

jerryray

  • Guest
Re: Macro and flag problem
« Reply #12 on: March 26, 2005, 12:16:19 AM »

Found the problem

Seems 3.183 will not execute any flag changes
by clicking on the macro (as in testing) but
if a macro is triggered it will set/clear flags.

3.179 would allow testing by clicking on the
macro.

At least that is the case here.

Anyone confirm this?
Logged
 

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