Very basic else is not working.

Started by JJtech, April 15, 2009, 08:19:27 PM

Previous topic - Next topic

JJtech

After more years of programming than I care to admit, X10 seems to have done me in.  I can’t for the life of me see why this isn’t working.

Very simple:

If trigger L8 is on as well as flag 5, then clear flag 5 and turn on K9 else set flag 5 on and turn on K6. 

JPEGs attached.

Results:  First time (with flag 5 off), K6 turns on and flag 5 is set to on.  That part works as it should but from then on, both K6 and K9 turn on every time.

Am I going crazy here???

JJ

P.S.  I must be jinxed, now the forum is telling me my attachment is too large.  My jpeg is only 114 and 121 KB.  I will try to post the two jpegs separately.

JJtech


Kramer Chins

#2
Quote from: JJtech on April 15, 2009, 08:20:03 PM
Here is the second screen shot.

JJ


From what I see in your "Else Conditions" you have it set "If Flag 5 is OFF" and in your "Falg" settings you have it under "Set Flag" instead of "Clear Flag Set"....
Registered Members of MCBA... WWW.KRAMERCHINS.COM

Trying to learn X10 Day by Day...........

JJtech

In the "else Turn on K6" macro, I only want to execute that macro if flag 5 under the conditions test is off.  If that is so, then I want to turn flag 5 on so that the next time the "Turn on K9" will execute.

The way it is written, it should flip flop from one to the other.  At least that is what I am shooting for.

Puck

Quote from: JJtech on April 15, 2009, 08:19:27 PM
Am I going crazy here???

Nope.

Move the set & clear flag statements so they occur after the Kx ON in each macro (IE make the set & clear the last thing you do in each macro). I have seen this before. "Smart" macros execute all elses if their conditions are satisfied; and sometimes one else macro starts to execute before it checks the conditions of other else macro, and sometimes the previous can set the conditions right for the latter.


-Bill- (of wgjohns.com)

JJtech,

May or may not apply, but since nobody else has mentioned it...

When testing macros, if you click on the macro in AHP, trigger conditions are ignored!

>!
-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!

JJtech

Puck,

YOU ARE THE MAN!  That did it!  Is there some logical reason behind this that I missed or just a case of the high quality standard of the X10 code?

Thanks much!  I feel I have regained a small bit of my sanity back this morning!

Bill,

Thanks for you input.  No, I am executing the macro via a mini controller trip.

JJ

steven r

Quote from: JJtech on April 16, 2009, 09:15:57 AM
...Is there some logical reason behind this that I missed or just a case of the high quality standard of the X10 code?...
I'm don't see any logical reason so I suppose we have to attribute it to the high quality X10 programing code.

Personally I'd like to call it as I see it. A bug.  B:(
BVC let's me tell my camera where to go!
:) Murphy is my beta testing pal. He helps me find problems whether I like it or not. :)

SMF spam blocked by CleanTalk