Please login or register.

Login with username, password and session length
Advanced search  

News:

The Buster PiX10Hub is here! Created by the Community, for the Community.:)% #:)

Author Topic: Very basic else is not working.  (Read 9052 times)

JJtech

  • Sr. Member
  • ****
  • Helpful Post Rating: 0
  • Posts: 101
Very basic else is not working.
« on: April 15, 2009, 08:19:27 PM »

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.
Logged

JJtech

  • Sr. Member
  • ****
  • Helpful Post Rating: 0
  • Posts: 101
Re: Very basic else is not working.
« Reply #1 on: April 15, 2009, 08:20:03 PM »

Here is the second screen shot.

JJ
Logged

Kramer Chins

  • Hero Member
  • *****
  • Helpful Post Rating: 16
  • Posts: 262
    • Kramer Chins
Re: Very basic else is not working.
« Reply #2 on: April 15, 2009, 08:47:28 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"....
« Last Edit: April 15, 2009, 08:50:14 PM by Kramer Chins »
Logged
Registered Members of MCBA... WWW.KRAMERCHINS.COM

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

JJtech

  • Sr. Member
  • ****
  • Helpful Post Rating: 0
  • Posts: 101
Re: Very basic else is not working.
« Reply #3 on: April 15, 2009, 09:24:20 PM »

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.
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Very basic else is not working.
« Reply #4 on: April 16, 2009, 12:15:50 AM »

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.

Logged

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Very basic else is not working.
« Reply #5 on: April 16, 2009, 12:53:38 AM »

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!

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

  • Sr. Member
  • ****
  • Helpful Post Rating: 0
  • Posts: 101
Re: Very basic else is not working.
« Reply #6 on: April 16, 2009, 09:15:57 AM »

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
Logged

steven r

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 74
  • Posts: 2189
  • Halloween with X10
Re: Very basic else is not working.
« Reply #7 on: April 17, 2009, 02:37:03 PM »

...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:(
Logged
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. :)
 

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