Please login or register.

Login with username, password and session length
Pages: [1] 2

Author Topic: Empty ELSE Oddity  (Read 40409 times)

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Empty ELSE Oddity
« on: October 19, 2006, 11:18:47 PM »

Since Smart Macros only allows you to check 3 conditions per macro, I use an ELSE so that I can check for a 4th condition.

The macro1 looks for one particular condition, if it's false it moves onto macro2 to check it's 3 conditions. This works fine.

However, here is the oddity I am seeing....

In macro1, I don't want any action to be performed, so I just put a 1 second delay in it and thats it. But when I trigger the macro string (via a motion sensor) and macro1's condition is met (I can see the correct monitored house code status in the report), it doesn't just execute the 1 second delay and end the macro string.... it executes macro2 (when it's conditions are met).

Now, if I put any function in macro1 (i.e. do something real, don't just do nothing), it actually executes macro1 and ends the macro string properly.

Has anyone ever experienced an empty macro being ignored in an ELSE string?
« Last Edit: October 20, 2006, 08:54:26 AM by Puck »
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #1 on: October 23, 2006, 09:24:13 AM »

I guess I'm the only one who felt the need to use an empty else  ::)  :D

Oh well, just to let you know what I had to do to get the else string to execute properly was create a "do absolutely nothing" dummy module to turn on & off. So now the else is no longer empty, but doesn't do anything either and exits the IF-ELSE string properly.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Empty ELSE Oddity
« Reply #2 on: October 23, 2006, 07:43:26 PM »

Interesting! thanks for the info! :) ;)
It may come in handy for a work arround of some sort! ::) ;) :D ;D
As your finding out Elses can be a little tricky to get running the way you want! ;)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #3 on: October 23, 2006, 09:20:46 PM »

As your finding out Elses can be a little tricky to get running the way you want! ;)

No kidding eh?

On many of mine I'm in 6 deep now, you try to test for all possible situations, but you usually get reminded in the middle of the night (by the wife who kicks you) that there was one you didn't think about.  :D

... and I need to add in one more level on some for Halloween  :-

Which will be determined by a flag...so X10 If you are listening.... 15 FLAGS IS NOT ENOUGH!!!!  :D
That's my wish list for the next update... at least 8 more flags.
Logged

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Empty ELSE Oddity
« Reply #4 on: October 23, 2006, 10:01:08 PM »

Puck: You can use a combination of flags eg: if flag 1,4 & 7 is set and flags 2,6,9 is clear then do..... ;) :D
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

-Bill- (of wgjohns.com)

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 81
  • Posts: 1340
  • He's just this guy. You know?
    • wgjohns.com
Re: Empty ELSE Oddity
« Reply #5 on: October 23, 2006, 10:08:01 PM »

...so X10 If you are listening.... 15 FLAGS IS NOT ENOUGH!!!!  :D
That's my wish list for the next update...

I'll second that!   ;D

Reminds me of the old PC and DOS!  "Who would ever need more than 640K of RAM?"   ::)
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!

Tuicemen

  • Administrator
  • Hero Member
  • ****
  • Helpful Post Rating: 283
  • Posts: 10523
  • I don't work for X10, I use it successfuly!
Re: Empty ELSE Oddity
« Reply #6 on: October 23, 2006, 10:14:07 PM »

::) :o----Or you'll never fill 20 megs!---- :o ::)
Logged
Please Read Topic:
General Forum Etiquette
Before you post!

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #7 on: October 23, 2006, 10:33:29 PM »

You can use a combination of flags...

Yeah I know.... I have different combinations at different times for different scenios... scary
Logged

ArtClark

  • Guest
Re: Empty ELSE Oddity
« Reply #8 on: October 25, 2006, 12:35:27 AM »

I saw this oddity as well.  I found out that if running from the PC and setting up major macros
that the ActiveHome main program (User interface?) likes to be exited and then re-started.

MANY of the macros I run will not execute correctly until I have closed and opened.  I spent
quite a few hours playing until I discovered this.

Also, The number of flags is way too small.  They replace Phantom modules so well that I would
love to see 256 or more available.  (This comes from PLC programming....)

(Note:  That's programmable Logic Controllers, not Power Line Communications)
Logged

ArtClark

  • Guest
Re: Empty ELSE Oddity
« Reply #9 on: October 26, 2006, 10:59:22 PM »

Hate to drone on, but.....

There is NO SUCH THING AS ELSE!!!!!!
I'm posting this in it's own thread as soon as I type this but here are the facts....

(This I have test very thouroughly!!!)

ALL Else clauses as well as the first Macro start their on seperate task!  (Macro?)

If you use conditions, then they will be correctly determined but Just because task (Macro) one runs DOES NOT
prevent nor affect the next one.  ALL ELSE CLAUSES run.  ONLY a condition failure will prevent an ELSE task (Macro)
from running.  (Please note:  Flags, if used, are NOT useable from macros run on the PC.  They MUST be run from the
interface to work correctly.  I'm starting testing now to see if this is a  NO set problem, a No read Problem, a No access problem, or a cached read problem.  I'll post my results in the area I'm going to start.  No one reads my stuff anyway
so it will take less space up there...)
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #10 on: October 26, 2006, 11:34:26 PM »

I'll post my results in the area I'm going to start.  No one reads my stuff anyway
so it will take less space up there...)

ArtClark: You first post was read.

I run all my main macros from the interface, so I never had any issue with having to reset AHP. When I want to add sound or email to a macro I do this in a dummy module macro and trigger it from the main macro. This way the main functions of the macro does what it's suppose to do if the PC is not connected or running AHP.

In just about all my macro strings, the last one doesn't have a condition and it doesn't get executed if a previous one's condition(s) is/are met. Again, maybe this is just a run from PC Macro execution method.

If you do more test and have examples of what you did & see, I'm sure it will interest a lot of people.   ;) :)
Logged

ArtClark

  • Guest
Re: Empty ELSE Oddity
« Reply #11 on: October 27, 2006, 02:08:23 AM »

Here are the basics of what I setup for a test (If I'm a little long winded, just ignore me):

  • I set up 5 Modules and cleared the interface (Just to be sure I'm checking ONLY what I'm testing.)
  • I then made sure ALL macros are loaded in CM15.
  • All triggering is done via a PLC controller plugged in to the same outlet as the CM15 to eliminate possible interference. (Hopefully...)
  • Setting up a macro with 4 "Elses" to start.  All but the last are the same.
  • The last "Else" calls a new macro via A15 On to check the flag status of Flag 16.  On status turns on module and off turns it off.  This is to verify flag status easily.
  • Also created A14 on macro to turn off all modules individually and clerar flags for a reset. 

Basics are - All results are delayed for 1,2,3 or 4 seconds to avoid "Overrunning" the interface (A proven internal interface problem - I'll deal with that in another thread).

Here goes the results (If more explanation is needed, my hand notes are 5 pages long. But I can type them if needed.):

  • The Basic 1st Macro is: No condition - Turn on Flag 16 - Turn on Device X - End  - 3 SAME Else's follow - ALL Execute
    .
  • The Basic 2ndt Macro is:   If Flag 16 Off - Turn on flag 16 - Turn on Device X - End - 3 Same Follow - ALL do Execute
      (NOTE:  Last Else is always the A15 ON to test Flag - This ALWAYS RUNS and Does the Test!!)
      In this test ONLY the First Device goes on - The Flag prevents the next three.
    .
  • The Basic 3rd Macro is:   if Flag 16 Off - Delay 1 Sec - Turn on Flag 16 - Turn on Device x - End
      Then Next 3 Else are the same but with no delay before the flag set (This get interesting for me, but expected)

Result: Both first and second device go on - Flag from second (Non-delayed flag set) stops 3 & 4.  Of course the Final else test on A15 still runs.

I have repeated this many times (More than 10) with MANY single changes to prove all of this.  I hope the Firmware in the CM15 isn't different for other users because programming elses would be a nightmare to debug for other units.  Running macros from the PC is a whole different story because of losses and huge time delays involved.  (I have tested this as well but it would take me too long to type in the results.  (I would have to write a paper.  This is supposed to be for FUN!!!   At this rate, I am getting a good picture of the interface between PC and CM15, but again that's for a different thread....)

The final point is...  ALL elses try to run, and if they do get going, each else is it's own task running in the CM15.  Next I need to find out what the task/macro limit is.  Just with this test I would have 6 running at a minimum with an extra if I ran a seperate flag monitor macro.  If the 8 limit I read elsewhere really exists, this could be a problem for me.

Sorry to rant on for so long.  If you want more info or test results, let me know.  I have a thing for finding and documenting weird program setups (Never errors, only people like me make those.)  This is what I do.


[TTA Edit: Added LIST to improve readability.]
« Last Edit: October 28, 2006, 09:08:31 PM by TakeTheActive »
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #12 on: October 27, 2006, 09:15:26 AM »

I then made sure ALL macros are loaded in CM15.

Just to be clear, are the MACROS set to Run from Interface or Run from PC?

The last "Else" calls a new macro via A15 On to check the flag status of Flag 16.

From what I've read & seen, Flag 16 is used internally and is best avoided by the users.
I would be curious if this Flag is causing some of the problems you are having.

Also, for the record, what version of AHP are you running?
Logged

ArtClark

  • Guest
Re: Empty ELSE Oddity
« Reply #13 on: October 28, 2006, 06:35:56 PM »

I hadn't heard about the Flag 16 internal use before.  I will re-run ALL my tests to be sure.  (Gotta re-set my system again.)

Running AHP 3.206 with ALL plug-ins installed (I Think? - Smart Macros, Iwitness, My house Online and OnALert)

As I mentioned - I ran all macros from the interface.  Running from the PC adds confusion seeing that the results of ALL processing on the PC is from the AHP program rather than the CM15.  I made a few shorts as far as testing and didn't notice any differences, but I haven't done anywhere near enough testing and prrofs to say anything for sure about the PC processing.  Thats why I'm sticking with the internals of the CM15.  I assume that a different version of AHP COULD effect how the PC runs macros, but I don't believe that AHP alters the firmware of the CM15.  If this is a valid assumtion (I know what happens when you assume, but this seems to be a good one?) then the version of AHP should have no effect on the internal operation of the CM15.  If COULD program the unit differently for the same macro but I don't want to open THAT can of worms at this time.

I'm wondering.  Didn't I mention that this is observable right on the AHP screen, in two places.  The actual Macro edit screen says that the Else clauses are another macro "With the same Trigger".  TEchnically, that would mean they are defined as individual macros and not a decision chain.

Also, and this is only a display, not a proof,  If you create a macro, with multiple "Else" clauses, and then look at the "Room" view, you see all the else macros seperately.  Trip the macro with an external command (A on or whatever) and ALL the else macros light up at the same time.  This view is what started me on testing.

I usually don't believe what books and manuals tell me.  I follow the creedo.  "It works when I see it work, physically".  Just because I'm told that this is how it should be doesn't mean that I accept it unless I can prove and SEE it.  I realize I can be a bit compulsive in this way, but it helps me in programming.  At least the X-10 system is small enough that ALL cases can be solved without having to spend days pouring through code to find a typo. 

I've ranted enough.  I'm going to repeat my whole series of tests using these decision tracks.  Let me know if you think I have missed anything:

  • 1. ) ELse with NO conditions.
    .
  • 2. ) Else with Flag Conditions (I'll use 1,2,3,4,8,9,11,12 and 16 seperately and if no differences found I'll double up and use multiple flags in both the Check and Decision area).
    .
  • 3. ) Module status (I'll try several house codes, of course monitoring the correct one each time.).
    .
  • 4. ) Else with other decision options.

I figure that if the first three ALL check out, I will be somewhat safe in running small check runs on the rest of the decision checks that are available (3 to 5 different checks?).   IF I get any different results, I will post them right here.

This may take a while, at least a few hours, maybe a day or so, so don't wait for me to reply.  Boy, I thought AHP and the CM15 would be easy to just set and forget.  Little did I know that the deep testing would be more fun that using it....


[TTA Edit: Added LIST to improve readability.]
« Last Edit: October 28, 2006, 08:53:50 PM by TakeTheActive »
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: Empty ELSE Oddity
« Reply #14 on: October 28, 2006, 07:33:13 PM »

Running AHP 3.206 with ALL plug-ins installed (I Think? - Smart Macros, Iwitness, My house Online and OnALert)

That's the new version when you install OnAlert. I don't have OnAlert, but I do have the other 3 plug-ins, and that AHP Version is 3.204.

Since we have 2 different versions and not seeing the same things, you may have stumbled onto something here.

...I don't believe that AHP alters the firmware of the CM15.

Since the CM15A has 8K of EPROM inside it's RISC micro-controller, and an external 8K EEPROM, I suspect the firmware gets loaded along with the macros & timers. If so, that would make the firmware "AHP Version" specific. I don't know this for sure, but how else would they be able to add security module recognition without firmware control?

Trip the macro with an external command (A on or whatever) and ALL the else
macros light up at the same time.

I see that too, but if you notice, the Ax OFF Macro also flashes when the Ax ON is triggered.

I'm wondering.  Didn't I mention that this is observable right on the AHP screen, in two places.  The actual Macro edit screen says that the Else clauses are another macro "With the same Trigger".  Technically, that would mean they are defined as individual macros and not a decision chain.

Logistically, not sure how else you would show that all the ELSES are part of the same string with a common trigger?

If you can post some screen shots of the Macros your testing and what you are seeing in the Activity Monitor I would be happy to create the same Macros on my version of AHP so we can compare results. Pictures along with the descriptions greatly improves the chances of having identical tests. If the problem does exist in Version 3.206, I'm sure others with that version will try the Macros also.
Logged
Pages: [1] 2
 

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