X10 Community Forum

🖥️ActiveHome Pro => Plug-ins => Smart Macros => Topic started by: Puck on October 19, 2006, 11:18:47 PM

Title: Empty ELSE Oddity
Post by: Puck 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?
Title: Re: Empty ELSE Oddity
Post by: Puck 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.
Title: Re: Empty ELSE Oddity
Post by: Tuicemen 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! ;)
Title: Re: Empty ELSE Oddity
Post by: Puck 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.
Title: Re: Empty ELSE Oddity
Post by: Tuicemen 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
Title: Re: Empty ELSE Oddity
Post by: -Bill- (of wgjohns.com) 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?"   ::)
Title: Re: Empty ELSE Oddity
Post by: Tuicemen on October 23, 2006, 10:14:07 PM
::) :o----Or you'll never fill 20 megs!---- :o ::)
Title: Re: Empty ELSE Oddity
Post by: Puck 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
Title: Re: Empty ELSE Oddity
Post by: ArtClark 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)
Title: Re: Empty ELSE Oddity
Post by: ArtClark 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...)
Title: Re: Empty ELSE Oddity
Post by: Puck 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.   ;) :)
Title: Re: Empty ELSE Oddity
Post by: ArtClark 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):


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


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.]
Title: Re: Empty ELSE Oddity
Post by: Puck 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?
Title: Re: Empty ELSE Oddity
Post by: ArtClark 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:


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.]
Title: Re: Empty ELSE Oddity
Post by: Puck 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.
Title: Re: Empty ELSE Oddity
Post by: Charles Sullivan on October 28, 2006, 08:55:39 PM
...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?

I believe the capability for decoding and encoding security RF signals has been in the firmware from the beginning, but all the CM15A does is report back the received security code to AHP.   AFAIK there's no working firmware code to execute macros based on received security codes -- that has to be done by AHP.

Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 28, 2006, 09:03:55 PM
I must thank you for this reply.  If the firmware of the CM15 IS altered by AHP, then ANYTHING is possible.

THat actually scarres me because software updates could change the base conditions for operation of the CM15 and therefore
any bug could really cause trouble.  Nevermind the possibility of problems comming and going during a macro change.

ANY download to to CM15 of timers, macros or whatever might cause a reload could wreck up the whole works.

I note that there is no "Download Verify" function, so this becomes even more of a question.

I am going to check out the lights a little more as well.  I hadn't noticed the lights you mentioned.  (Oh Boy, More Testing...)

As to your last comment, Elses, if there were really an else clause, WOULD NOT HAVE A TRIGGER.  The TRUE trigger would
be the FAILURE of the first IF clause, NOT THE MACRO ITSELF.  This is the premise that If-Then-Else clauses rely on in ALL
programming languages that I have ever worked with.  (Basic, C, C+, C++, True Assembler, Binary Machine Language, Fortran, Focal, Cobal, And a couple most people have never heard of.)  It is, of course, true that, as you said, the people at X-10
simply used this method to represent the true underlying If-Then-Else logic but "I don't think so" best describes it for me.

That's my way of saying "I DON'T KNOW????"  I'm going to test, but I really can only make inferences from the results of
testing.  Without the Source code, Processor Type, etc. of the CM15 AND the same for AHP, Testing the final results is all
I have to go on.  I try to use complete methods for testing, but as you have noticed, I can miss a lot.

I'm redoing my whole test setup just to answer for myself what you mentioned.  I consider myself very technical, but that
doesn't always cover everything.  If I keep adding to my tests the input I get from everybody, the results can only get better.

Life is a waste if I don't learn something new everyday.

Interesting, While I was typing this, another post came in stating that the firmware was there already.  That would explain
why ALL security macros must be run from the PC.  It would imply, however, that the "Activity Monitor" is NOT a diagnostic tool
but an accessory.  If it were a true diagnostic, it would record the security modules data even though "OnAlert" was not loaded.
I can easily accept that the Activity Monitor UI only lists what AHP processes, NOT what the CM15 outputs.  There are probably
very few people that would want to see unknown hex codes displayed and then have to manually decode what they meant.
I know many people who would have trouble just reading the Monitor as it is, never mind a double listing or pure hex output.

It's getting so I spend as much time here on the forum as I do Testing.  Not very effective for what I'm supposed to be doing here.
I had better get to work testing so I can make a meaningful reply.
Title: Re: Empty ELSE Oddity
Post by: Puck on October 28, 2006, 10:14:15 PM
Thanks Charles, that makes sense; since the security modules require the PC to be running.

The TRUE trigger would be the FAILURE of the first IF clause, NOT THE MACRO ITSELF.

But don't forget, the primary condition for all the macros in the string is that the address gets triggered.  ;)

Without the Source code, Processor Type, etc.

CYPRESS: CY7C63723 (http://www.cypress.com/portal/server.pt?space=CommunityPage&control=SetCommunity&CommunityID=209&PageID=259&fid=16&rpn=CY7C637xx&ref=sch)
Title: My First Test Results
Post by: ArtClark on October 29, 2006, 01:26:40 AM
Unfortunately, I cannot seem to figure out how to send screen shots, so all I can do is send my text results.

I may look stupid, but I will send my raw note data.  This is what I record while testing.  It's not consice nor pretty but I hope it gets the info across and gives an idea of my testing procedures.  Remember, this is my personal note data so PLEASE ignore bad remarks, junk notes, etc.  This is just step One to check out the Macro Display Indicators in AHP.  My Version seems to do something different than Puck's so there may very well be other MAJOR differences as well.  If this type of Note data is OK for people to bother to read, I'll send on the next one.  If you want screen shots, I'm afraid you will have to instruct me how to send them.  (I have my FTP and WEB server available, if that is a viable alternative here??   Enough said - here is the data.


X-10 Testing Information - Series 5
10-29-2006 - 12:16AM

ArtClark
[/b]

Notes:    New series of test as recomended by other users.  Many missed details in first tests require second verify pass.  All items and documents to be included.  (This Doc should be saved with Glossary, if Suggested)

Test Prerequisites:


Test 1 Basics:


Test 1 Setup:   


Test 1 Results:


Test 1 Final Conclusions:


Test 1 Completion:


I realize this may be useless data and is a little Off-topic, but it was the first verification test for the full "ELSE" clause test.  I had to
have a baseline reference to work from, and this was it. 

Please let me know if this is OK, what, if any, more data to send and how much to send.  I'm counting on all of you to instruct me here because I have never before shared data on a Forum before and don't Know social protocols for what is right or wrong.  I've noticed I seem to type too long and am working on that.

Thanks in advance for the input.


[TTA Edit: Re-formatted for readability.]
Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 29, 2006, 02:57:46 AM
I have Finally finished Part two of my testing.

There are some interesting results, but I have really not gotten very far in that only No condition "Elses" have been tested.

This test does offer some interesting results for multiple macros in elses or single macros without delays.

My previous post, I think, is way too long though.  This note page is longer.  Should I post this thing or shorten to results???

I'm going to follow whatever you people think.  I really am the "newbie / stranger" here and have seen other posters jamming
up the works with uneeded or unwanted posts.

Just let me Know what to do.  Calling it a morning for now.

Thanks to all.  Though I haven't been good at the rating button, I have gleaned so much info from this forum that I consider it
to be much more valuable than the X-10 site itself.  Certainly more important.

Little request....   I'm not sure what some of the common acryonms are, Like PM.  Is there a place to pick that up or am I just
so new that my basic ignorance is showing.  Any pointers would be a BIG help.
Title: Re: Empty ELSE Oddity
Post by: Charles Sullivan on October 29, 2006, 12:27:15 PM
Little request....   I'm not sure what some of the common acryonms are, Like PM.  Is there a place to pick that up or am I just
so new that my basic ignorance is showing.  Any pointers would be a BIG help.

While by no means complete, here's a list of some of the common acronyms you're likely to see in this forum:
  X10    Can be ambiguous, sometimes referring to the X-10 company, other times referring to the X10 powerline transmission protocol.
  PM     Personal Message or Private Message (via the forum message system)
  AHP   ActiveHome Pro (generally referring to the software but occasionally to the CM15A interface)
  AM     The AHP Activity Monitor  (but sometimes may be used to mean Appliance Module)
  SDK   Software Development Kit (for AHP; a free download from the X-10 website)
  AH     The old ActiveHome program which uses the CM11A serial port interface or sometimes the interface itself.
  PLC   Power Line Code or Power Line Command (generally via the X10 protocol)
  LM465, AM486, WS467, etc.   Model numbers for various X-10 modules - check the X-10 website if they're not further described.
 
I'm sure others can add to this list.

Title: Re: Empty ELSE Oddity
Post by: Puck on October 29, 2006, 12:47:01 PM
ArtClark: You experiment is nicely documented and easy to understand what you did & the results. Please continue that method for your additional tests.  ;)

I just did a test on one of my ON/OFF MACROS.

If I trigger the MACRO ON  from an RF Remote, both the ON & OFF MACROs  flash.
If I trigger the MACRO OFF  from an RF Remote, neither of the MACROs flash.
If I trigger the MACRO ON  from a DUMMY Module in AHP, only the ON MACRO flashes. (The way it should be)
If I trigger the MACRO OFF  from a DUMMY Module in AHP, only the OFF MACRO flashes. (The way it should be)

NOTE: In all 4 cases, the correct MACRO  executed correctly.

From your test, it sounds like they may have corrected this anomaly in the newer version of AHP.


Two others that I seen to add to Charles's list
OT   Off Topic
OP   Original Poster (i do believe(?))
Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 29, 2006, 09:14:32 PM
Thanks for the Info.   Soon I hope to learn how to PM, etc.  But for now, Documenting Testing is my focus so I don't lose track
of what I'm doing.  (I get confused easily...)

Puck - This is great info for me.  I noticed you used an RF Controller.  This forced me to do a complete test just to see
how much of a difference there is between RF and Direct PLC.  (I mean a wired controller.)

Instead of Posting all my Raw data again, Here is what I found.  I think you are right about a partial bug fix, but it's a grey area
because the bug is only in the RF.  (A little in the PC interface, but I'm only mentioning that because there are MANY PC to CM15
interface irregularities, which I'll get to in future Full tests.)

IF you could verify this, fine, otherwise, I'll assume that our info fits together.

Test on ON/OFF Macro (A16).

Macro Loaded in CM15:
  Trigger Macro ON (RF) - Both Macros Flash (Just what you got)
  Trigger Macro ON (PLC) - Only ON Macro Flash (Meaning - PLC is Correct, RF isn't  - Definate AHP "Bug")
  Trigger Macro OFF (RF) - Neither Flash (Just what you got again.)
  Trigger Macro OFF (PLC) - Only OFF Macro Flash (Again - PLC OK,  RF Isn't - Possibly Same "Bug"?)

What I need to remember here is - Avoid RF for Display checks.  The Macros ALL WORKED.  (Note: I Put a Delay in front..)

An Interesting little side note:  Running the SAME MACROS from the PC instead of the CM15 only changes two things .  The
Macros run slower (Of Course) and RF ON lights both but the lights flash a second time after the delay.  This second flash
only lights the Correct Macro.  RF OFF lights none and after the delay, does light the Off Macro.  Weird, but No operational
effect, so unless testing or debugging, I think these little "Bugs" can be ignored.  IF Trying to FIX a non-working Macro via
the display, I could see major headaches for a user with no experience with the X-10.  Using the PLC Wired Controller, All
Lights and macros work correctly, in or out of the CM15. 

From Now On, I will try to Include a seperate trigger test using RF just to be sure my testing includes real-world info.
Most people, including me, use the RF much more than the Wired controllers in actual use.  Testing is one thing, using another.

Again, Thanks for the other Info, It does help me out a lot.  (I usually Learn fast, so I should get up-to-speed in a year or so. ;)"
Title: Re: Empty ELSE Oddity
Post by: Puck on October 29, 2006, 10:56:04 PM
IF you could verify this...

I got the same results as you with my mini-controller. Only the correct Macro flashed for ON & OFF.
Good catch.  ;)
Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 29, 2006, 11:18:55 PM
OK, Now what to do?  I feel, at this point, that this little display problem is a defined and confirmed "Bug".

I guess you could call it that, though X-10 could have some internal reason for this operation.  My question is:  Should this be posted in the "Bugs" area or is just a little thing like this worth making a post for.  It might be easier to just answer it if someone else questions why such a display comes up?

I'll leave that choice to you because, obviously, you are much more in touch with the Forum than I. 

Please let me know what you do so I can remember it for future reference.  It's going to be on my Website, but a Little
thing like this will be buried in technospeak there and not useful for someone looking for quick answers.  They would have
to read the whole thing anyway, which would be pretty boring for someone looking for a display problem.....

I think a quick statement - "It works this way" is what most are looking for?  (Me being a social moron, I'm Guessing...)
Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 30, 2006, 01:32:34 AM
Well, Here Goes.  This is the First Real "ELSE" clause test I have preformed.  I'm Only including the Basic Note Log, and trying
a couple screen shots, if I can get them to upload.  I'm putting the text in a "Quote" to take up less space.  Notes are very
wordy.  This Entire test was repeated by me just now to verify I could repeat it on this setup.  It repeated Fine.

If anyone wants ALL the Info from this test (Rest of Screen Shots, etc. you can get them off the web page where I store all
this.  I'm leaving all the extras there instead of filling up this topic with extra junk.

Here are the Test Notes.  (I thought the results interesting, but Now I must make test With Conditions.  That's Next....)

Quote
X-10 Testing Information - Series 5 - 10-29-2006 - 03:49AM

Notes:   Next series of tests as recomended by other users.
   All items and Documents to be included. 
   (This Doc should be saved with Glossary, if Suggested)

Test Prerequisites:   
1)   All Macros to be run from CM15.  NO PC macros allowed during test.  (Eliminates certain conflicts.)
2)   All Macro outputs MUST BE Delayed at different intervals to prevent 2 PLC commands at the same time.
   (There are already documented problems with commands interferring and overlapping.  Seperate Prob.)
3)   All Macro Delays must be moved around between macros so that delay can be ignored. 
   (This eliminates the possibility that the amount of delay has an effect on outcome.)
4)   All Macros Must be "Captured" from screen and documented.  (User request for Replication!!)
5)   All Tests and results must be repeated a minimum of 3 times (Three) to ensure accuracy.
6)   All macro start (Trigger) commands must be sent the same way and from a direct PLC Controller.
   (This is to eliminate RF problem possibilities or changes in what I am doing.  Art Screw-up factor)
7)   All Modules and CM15 on same circuit and isolated from all other circuits.  No Interference allowed.
8)   ALL UNUSED controllers, modules, repeaters, transeivers, etc. MUST BE REMOVED. 
9)   Every test to be Documented, including typo's, failures, and undesired results.  (No Hiding Boo Boo's)
10)   Basic Notes should be files as much as possible.  (I want a dictionary when done....)
11)   All Results having to do with AHP can only be Verified with Version 3.206.  (I'm not re-loading.)
   (If other version test need to be done,  Allow other users to do it.  Wider range of testing that way.)

Test 2 Basics:
   
   Verify operation of "Else" clauses without Using Conditions.  (Strange Case but Necessary first Test)

Test 2 Setup:   

   Create 1 Macro with Many Else Clauses,  A9 on , A10 On, A11 On A12 On and A13 On  (Macro Trigger = A6 On)
   Use Both Lamp and Appliance Modules to Ensure no difference (Gotta Eliminate possible Junk Test.)
   Verify Delay before Outputting Command from Macro (Proven in Test One - Needed to eliminate OVERRUN)
   Preset by Manually Turning of ALL Modules Manually (Visually Check Preset Condition)
   Create Screen Shot and Save - Be Sure Each Macro Clause recorded Seperately
   Execute Test by Manually with PLC Controller - Push A6 button then On Button
   Watch and Verifiy result, record.
   Reverse Delays to ensure no effect on else results
   Re-test, Watch and Verify Result, Record.

Test 2 Results:
   
   1)   Created Macro.  Delays are 2,4,6,8,10 Seconds for A9 - A13 Respectivly.
   2)   Quick Test - Press A6 then On - All Test Units Come On.  (Make Screen Shots Now.)
   3)   Preset and Re-run Test Multiple Time and Check ACtivity Monitor and Display.  All Good.
   4)   Reverse Delay Order and Re-test.  All Good (Do not bother with Screen Shots - Only Delay Altered)

Test 2 Final conclusions:

   All ELse Clauses Execute.  Neither Delay nor Module type has any effect here.  All defined
   Modules Turn On.  Else Clauses are No Elses, but Concurrantly running Tasks.
   Tasks are started at the SAME TIME.  If they were not, the delay would be additive.  I.E.
   the final 10 second delay IS being counted from the initial command, not the end of execution
   of the previous clause.  Once started, these seperately running macros have NO interaction.

   True Results:   With NO conditions, ALL else clauses run.  Technically, they are just Multiple
         Macros that happen to have the same trigger.  Here the word "ELSE" does not apply.
         (Note to self:  if others noticed this, why didn't other notice the rest???)
         (Re-read forum posts to see specific details when i Finish..)

Test 2 Completion: 

   Note:   This test was to verify the "ELSE" clause behaves wrong, without an else ccondition.  Of course
      if this test were repeated without delays, the outputs and the activity MOnitor display
      would be USELESS.  A Non-delayed Item would fail due to the OverRun of the Interface, not
      because of the "ELSE" clause.  It seems to be VERY possible that the OverRun is being used
      to FORCE the else to not execute.  That could cause users to get the correct else results
      even though the logic is wrong.  Now This Must Be Tested to be sure of that premise.  If
      the overrun Problem causes "ELSE" to work "correctly", then X-10 Programmers, in the Lab,
      could easily have missed this, even in beta testing.  Note:  I prefer it this way, as long
      as I am aware of it and the timing between set and check, it allows more program options.
      The problem would be to normal users who have macros that work intermittantly and cannot
      figure out why.  First imaginable case, an RF transmission, repeated.  The signal could
      last long enough to jam the first outputted signal of the macro.  Oppps, it didn't work!


Test 2a Basics:

   Verify true Operation of Empty Condition Clauses with NO DELAYS.  (Proving OverRun Effects)

Test 2a Setup:

   1)   Use exact Macros as Test 2 but With All Delays Removed.
   2)   Don't Bother with Screen Save - Just Deleting Delays
   3)   Verify Preset (ALl Modules Off) and Hit A6 On  (Macro Trigger) - Watch and Verify Results.
   4)   Double Chheck Activity Monitor to See what was recorded versus What Happened (In Case...)

Test 2a Results:
   
   1)   Modified Macros.  Delays Removed.
   2)   Quick Test - Press A6 then On - Strange but Expected result - No Modules Respond - All Display
      Activity Monitor shows the A6 Command - No A On, but Shows an A9 and A9 On - Doesn't Happen
      (Note to Self:  CM15 coded basicly, no presend check for clear line? - No Presend Pause either!)
   3)   Multiple REpeat of Test accurate.  Macro Command will not work.  (Note: Nobody has seen this??)
   
   Re-set - Add SAME delay to all macros of 2 Seconds - Should allow First Clause to execute, but then
   What will happen is Unknown.  (I think rest will fail....)

   4)   Modified Macros.  2 Second Delay Inserted BEfore Command to Module in ALL Clauses.
   5)   Unexpected Results.  The Macros ALL executed perfectly.  ALL modules turned on.
      (They turned on in the Else order as well.  The CM15 MUST wait for previous commands in
       this specific case.  I'm Wrong in my guess again.  Darn.  Multiple Tests Verify Results.)

   6)   COntinuing This Test with New Conditions.  Will Remove Delay From LAST else clause and test
      Then Will work Back, removing the next to last, etc.  Once Complete, put back to current
      configuration and start from first to last.  (Note: I'm getting too detailed, but Must Finish.)

   7)   Modified Last Macro.  Removed Delay on A13 ON Command. Test and then remove A12, etc.
   8)   ANY Command without Delay is NOT executed.  The Activity still loses the ON command sent manually.
      The First Command in the chain without delay shows up on the activity Monitor, but isn't Sent.
      All Commands with Delay work Fine.

   9)   Modified Again.  Put 2 Sec Delay in ALL.  Removed first in chain. Test.  Remove Next, etc.
   10)   Again, Unexpected Results.  If First Clause has no delay, ALL clauses fail to execute.
      Activity monitor (as usual) Misses the On Command to trigger, but shows the A9 and ON which
      are not sent.  The rest of the commands don't show up nor work.  No Modifications to the
      Macros further down the chain have any effect.  Must now test the Middle of the Chain First.

   11)   Modified Again.  2 Sec Delay in ALL.  Removed Delay in Middle of Chain  (A11 On). Test.
   12)   VERY INTERESTING RESULTS. - Final in test.  Activity Monitor Still Misses On of A6 Trigger.
      Next on Monitor is the Non-working A11 On.  This doesn't actually work, as it shouldn't.
      Next comes a surprise.  The First two Clauses DO Execute.  A9 ON and A10 On execute as well
      as show up corectly on the monitor.  A12 and A13 have no response.

Test 2a Final Conclusions:

   1)   First and foremost, with NO delay in front of a Macro command, the operation must be
      checked VERY carefully.  If a delay is needed, or any other process will do the same, I won't
      test here.  This testing is for ELSE Clauses, not system analysis.  The end rule is, for
      unambigous operation, precede all macro commands with a delay.  I hope and assume that
      only one is needed at the start.  The CM15 seemed to stack commands from multiple macros
      without any trouble.  I may return to that test later....
   2)   If no delay is used, the ELse clauses stop at that point.  No further clauses will execute
      nor will they show up in the activity monitor.  Only the first without a delay shows in
      the activity monitor, and this command is not really sent.  (Neither One.  By This I mean:
      The Monitor Shows A9  and Then Shows A On.  Neither of these is really sent.)  Even though
      this is (In Effect) the correct operation of an else clause, it is produced by an error in
      processing as shown.  It is not really using an else.  (Bad for normal Users...)
      (Note to self:  Probable that this is how this was missed in testing.  Look how long it
       took me to find this, and I was looking for it specifically.....)
   3)   All of these test only apply to this setup.  NO verification has been done to see if RF
      transmissions, etc. will be affected the same way as far as delay are concerned.  The ONLY
      commands verified are ON and Off of Modules.  Module Type makes no difference and Command
      type SHOULD not, but This can not be confirmed with this simple test setup.
      (Note to Self:  I'm sounding like an alpha tester again.  Notes only, remember, not opinion.)

Test 2a Completion:

   Note:   This test was to prove the effects of OverRunning the interface.  There are some OverRun
      prevention buffers working, but only in the certain cases noted.  The complexity of knowing
      When they will work is simple as long as the first thing a Macro does is delay.  It seems
      that a running Macro is buffered, once it is really running.  The FIrst thing a mocro does
      Usually won't work unless it is not a command.  If it can be other than a delay is not yet
      known from these tests, but the "ELSE" clauses ARE terminated from running as soon as the
      first overrun is encountered.  A simple Macro check is now available!!!  If the activity
      monitor shows a command that did not execute, That macro and all elses further down the
      chain have terminated.  Again, weather the Failing macro continues execution has not been
      tested here.  This was ONLY for else clauses.

Questions and Comments are desperately needed.  I'm going to continue, but should I keep posting these?

I Hope the Macro Screen Shots Follow.

Title: Re: Empty ELSE Oddity
Post by: Puck on October 30, 2006, 09:27:37 AM
Well it definitely appears that an ELSE doesn't work as we interpret it when there are no conditions. But writing a MACRO with Non-Conditional ELSEs isn't really practical either. I'm sure a real compiler would send out a warning  or syntax error.

It will be interesting to see your results with ELSE conditions. I'm not sure what your plan is, but I'd like to see a test with all ELSEs having the same trigger condition. Particularly your Test 2a Step 4) that executed all ELSEs. If they still all execute, then there is a real issue.
Title: Re: Empty ELSE Oddity
Post by: Tuicemen on October 30, 2006, 11:28:56 AM
OK, Now what to do?  I feel, at this point, that this little display problem is a defined and confirmed "Bug".

I guess you could call it that, though X-10 could have some internal reason for this operation.  My question is:  Should this be posted in the "Bugs" area or is just a little thing like this worth making a post for.  It might be easier to just answer it if someone else questions why such a display comes up?

Others have reported bugs that are of a lesser concern!
It is best to report any or all bugs/problems you find in the Software Problems & Bugs area (http://www.x10community.com/forums/index.php?board=26.0)!
Little bugs tend to grow into Big bugs! ::) ;) :D
It's probably best if you post to an existing thread for the version of AHP that your running ! ;) :D
Title: Re: Empty ELSE Oddity
Post by: ArtClark on October 30, 2006, 10:16:36 PM
OK.  I'll look in the area mentioned and try to stick the little display bug there.

I have completed the testing I was doing on the "ELSE" oddity, and have the results.  Just read the end of the notes to get the final results.  THere is was too much info and too many screen shots that go with this for me to gum up the works with all of it so I sending the lab notesheet only.  If more data is desired, just let me know.  (I don't imagine anyone needs all that junk...)

Quote
X-10 Testing Information - Series 5 (Continued.) - 10-30-2006 - 08:18PM

Notes:   Basic Initial Check of Else WITH Condidtions.  Test Configuration Limited.
   All Configurations should be Screen Shot for Other Users.  (ALso Save .ahx Files for Each....)
   Remember Art, This document will be exposed to external users, watch the language!!!
   Save this Doc in Site as well as test data drive.

Test Prerequisites:   (These are Copied and Continued from Previous Tests...)
1)   All Macros to be run from CM15.  NO PC macros allowed during test.  (Eliminates MANY conflicts.)
2)   All Macro outputs MUST BE Delayed at different intervals to prevent 2 PLC commands at the same time.
   (There are already documented problems with commands interferring and overlapping.  Seperate Prob.)
   (There will be a seperate Test documenting this.  For Now I'm Avoiding possible extra Problems..)
3)   All Macro Delays must be moved around between macros so that delay can be ignored. 
   (This eliminates the possibility that the amount of delay has an effect on outcome. Min Delay 2 Sec.)
4)   All Macros Must be "Captured" from screen and documented.  (User request for Replication!!)
5)   All Tests and results must be repeated a minimum of 3 times (Three) to ensure accuracy.
6)   All macro start (Trigger) commands must be sent the same way and from a direct PLC Controller.
   (This is to eliminate RF irregularities noted from other tests.  RF interaction tests will be later.)
7)   All Modules and CM15 on same circuit and isolated from all other circuits.  No Interference allowed.
8)   ALL UNUSED controllers, modules, repeaters, transeivers, etc. MUST BE REMOVED for My sake. 
9)   Every test to be Documented, including typo's, failures, and undesired results.  (No Hiding Boo Boo's)
10)   Basic Notes should be files as much as possible.  (I want a dictionary when done....)
11)   All Results having to do with AHP can only be Verified with Version 3.206.  (I'm not re-loading.)
   (If other version test needs to be done,  Allow other users to do it.  Wider range of testing that way.)
   (Note to Self:  If request comes up for earlier version test, consider setting up 3rd PC....)

Test 3 Basics:
   
   Verify operation of "Else" clauses WITH Conditions. 
   (This will require 4 Sets.  1) if X   2) If X or Y   3) If X and Y   4) If X or Y and Z)
   Each Set will require several sub sets for verification, however the True set should be the only
      set that alters operation.  WHAT makes the set false should not make a difference (??)
   Important:  Use of only 2 of the Three possible "OR"'s or "AND"'s shouldn't change outcome (??)
   (Verify this during testing by running Quick series filling conditions all the way!!!)

Test 3 Setup:   (Special Note:  Follow Test 2 Setup as close as possible to reduce change interactions.)

   Create 1 Macro with Many Else Clauses,  A9 on , A10 On, A11 On A12 On and A13 On  (Macro Trigger = A6 On)
   Create Test Preset Macros to Set / Clear Condidtions.  These must be MANUALLY TRIGGERED.
   (The manual trigger prerequisite I'm self-imposing is to prevent Set / Clear problems from
      changing the test outcome.  Want to test "ELSE" options only....)
   This Setup shall use "Flags" for conditions ONLY.  Module Status depends on monitored House Code.
   (There are other considerations, but for this test, Flags should be a dependable condition source.)
   (Note to Self:  Run Quick Subtest to verify other conditions being used does not affect outcome...)
   Use Both Lamp and Appliance Modules to Ensure no difference (Gotta Eliminate possible Junk Test.)
   Verify Delay before Outputting Command from Macro (Proven in Test One - Verified in Test Two.)
   Preset by Manually Turning off ALL Modules Manually (for a Visual Check of Preset Condition)
   Create Screen Shot and Save - Be Sure Each Macro Clause recorded Seperately. Preset Macro Too!!
   Execute Test by Manually trippin with PLC Controller - Push A6 button then On Button to Execute Test.
   Preset Macro for Flags Shall use House Code "A7" for simplicity.  All Manually Run anyway.
   Watch and Verify result, record.  No Special Delay changes needed.  Test Two provides guidelines.
   Re-test, Watch and Verify Result, Record.

Test 3 Results:
   
   1)   Created "ELSE" Macro.  Delays are 2,4,6,8,10 Seconds for A9 - A13 Respectivly. (Same as Test 2.)
      Conditions for Each else is Same Number Flag (Flag 9 for A9, Flag 10 for A10, etc.)
   2)   Created "Preset" Macro.  Will Need to change preset MANY Times.  First Set A9 - A13 (ALL!).
   3)   Quick Test - A7 then ON on PLC Controller.  Wait 10 Seconds to be sure.  Press A6 then ON.
      (Guess:  I Think All will Come On....)
   4)   Guess WOrked!!  - ALL Macros Executed.  This means ALL ELSE Clauses ran.  Make Screen Shots.   
   5)   Now Reset and Re-run Test.  ALL Else running Verified.  Now for Options.
   6)   Modified Preset Macro to This:  2 Sec Delay, Clear ALL Flags used, 2 Sec Delay, Set 9,10,12,13
   7)   Ran Test with Flag 11 Cleared.   VERY strange Results.  9, 10, 12, 13 Ran.  (All Elses Run.)

   ********************  Ignore 8 - 9   Made Human Error   ***   Retained for Completeness  *************
      Strange Part.  Time Delays were incorrectly executed.  Pulling Flag 10 to Double Check This.
   8)   Ran Test with Flag 10 and 11 Cleared.  Problem Verified.  Delays ARE Affected!!!!
   *****   To Detail Failure:  Normal is a sequence with 2 Second Delay between each MOdule ON   *****
   *****   The Non-activated Modules SHOULDN'T affect other timers, but they DO.  Each is STILL 2 Sec. 
   *****   To Make Clear - The Output in Words:
   All Flags Set - Trigger Macro, 2 Sec delay, A9 ON, 2 Sec Dly, A10 ON, 2 Sec Dly, A11 On, 2 Sec Dly, Etc.
   The Actual Timmimg is 2 Sec for A9, 4 SEc for A10, 6 Sec for A11, 8 Sec for a12 and 10 Sec for A13   
   Drop A10 and A11 Flags and the Result changes to:
   Trigger Macro, 2 Sec Delay, A9 ON, 2 SEC DELAY, A12 ON, 2 SEC DELAY, A13 ON !!!!!
   There Should be an 8 Second Delay for A12.  It Changes to 4 Seconds in this process.  This IS a Bug.
   The most likely cause is internal to the CM15, the counter used for timing is not multi-tasked right?
      Take Screen Shot of Preset Timer for reference.

   9)   Ignoring this Initial Bug, the Operation is OK, but different Timings Must be Tried Next
      All Timings will be Set to 2 Seconds.  POssible that Else down chain could be Killed?
      (Guess:  I will shoot in the dark - Maybe Elses won't execute!!!
      Start with ALL Flags set to verify Correct ALL ELSE operation.  ALL Should Trip OK. (Test 2)
      During Verification, My personal error discovered.  IGNORE ABOVE STATEMENTS.
      ALL Macros WERE Set to 2 Seconds.  (I was WAY ahead of testing versus conditions.)
      If this were not a lab note sheet, I would delete all my comments above.  Please Ignore Them!!
   ******************************************************************************************************

   10)   Previous Error forces me to set the timers to 2,4,6,8 and 10 seconds and check results.
      Quick Test: All Flags On - All Modules ON at Correct Delay Interval.
   11)   Flags 10 and 11 off - A9, 12 & 13 On at correct Intervals.  (CM15 is Right on, I messed up!)
         
Test 3 Conclusions:

   1)   Errors in test procedure force me to list what is proven so far, so as not to confuse
      myself as to what I am checking.  This is embaressing.  (To Err is Human?)
   2)   With Single Flag set condition, All Else Macros do Run if Condition is Met.  Previous clauses
      DO NOT prevent the running of Else clauses.
   3)   WIth Delay, to ensure correct start of macros, commands stack up in the CM15 correctly.
   4)   Removing Macros from execution in a chain DOES NOT affect timing of other chains. (Good Operation)


Test 3a Basics:

   Verify Operation of Condition Clauses with Multiple Conditions.  (May be severe OverKill.)

Test 3a Setup:

   1)   Use exact Macros as Test 3 but With More Conditions Added.
   2)   Ensure Screen Save.  (I already messed up once, Prevents unrecorded Human Error.)
   3)   Verify Preset (ALl Modules Off), Hit A7 ON (Preset), Wait 10 Sec. and Hit A6 On  (Macro Trigger)
   4)   Double Check AM to See what was recorded versus What Happened (In Case...  Missed this in 3)

Test 3a Results:
   
   1)   Modified Macros.  Added "OR" Flag 14.  Set Flag 14 in Preset Macro.  Take Screen Shots.
      During Modification, Realized I meant "AND" not "OR" (Top row of Conditions.)
      No "OR" added yet.  Preset Clears ALL, Sets 9-14.  Run Quick Test:  (Here Goes Nothing)
      All Macros Executed.  (SHould Have - All Flags Set.)
   2)   Changing Start Delays to 2 Sec FOR ALL MACROS to check Command Stacking.  (2 Sec Req'd to Run?)
      Quick Test (Means Three Executions, by the Way...): Preset and Ran:
      All Macro Executed Great.  CM15 Stacked them and ran the next clauses at approx 1 Sec intervals.
      (This is all working too Well, I had better find something, although ELse clauses running is...)
   3)   Modified Preset - Clear Flag 14.  (This should Kill ALL Macro Outputs!!)
      Quick Test:  Excellent - NO macros fired.  "AND" clauses seem totally predictable.
   4)   Modified PReset - Set 14 again but drop 10 and 11 - Should Light 9,12,13
      Quick Test:  Excellent - 9, 12 and 13 Came On Like They Should. 10 & 11 Flag stopped Macro.
   5)   Modified Macros.  Added "OR" Flag 15.  (Really put in "OR" line this time!!!!)
      Modified Preset to Clear flag 15, not set it.  No Change should be seen.
      Quick Test:  Excellent again.  Still working as it Should.  9,12,13 function.
   6)   Modified Preset:  Leave 10 and 11 Cleared but turn on 15.  Should force ALL to execute.
      Quick Test:  Perfect.  All Condition clauses are completly predictable.  As long as one
      Takes into account they ALL fire, no matter what the previous clause did, all works right.

   7)   Weird Test for Me:  Removed Delay to see if Flag Condition tests use enough time to remove
      the need to delay macro execution of module control.  (Could cause strange effects..)
      MOdified Macros:  Removed ALL Delays.
      Quick Test: Unfortunately, (Or Fortunately, depending on what you want.) the removal of
      the Macro initial delay has the same effect as in test two.  Macros fail to execute.
      AM shows the A6 but not the A ON, Shows the first macro A9 and A ON but actually sends
      neither command.


Test 3a Final Conclusions:

   1)   ELse Clauses ALWAYS TRY to execute.  They Start in correct order, but all start immeadiately.

   2)   There Must be a delay before ANY Module control command to be sent. (From Test 2 and Verified.)
      Note:  The Internal effects are not tested.  It's possible that a Dummy module on the
      monitored house code might receive these commands.  This would need seperate testing.....

   3)   Else Conditions, as far as Flags go, all verify perfectly if in the CM15.  Macros from the
      PC have not been tested, although forum postings and undocumented tests show trouble here.

   4)   The CM15 DOES NOT OVERRUN if the Macros start correctly.  I.E.  As long as the needed delay
      is at the start of a macro, the next steps don't mess up other macro commands.  If Five
      outputs (the max tested) trip at the same time, they execute sequentially without error.
      (Note:  Extremely Long Concurrant Macros might alter the execution order.  Not tested yet...)
      (Note 2:  Not tested at all.  Macro a does CMD1 and CMD2 while Macro B does 3.  If both are
      started with the same delay, the ending order is untested.  (1,2,3 or 1,3,2 ???) Logic says
      the first is correct, but the second would be more likely.  This is a future test...)

Test 3a Completion:

   Note:   This Test was to Prove that ALL else clauses execute at the same time, without regard to
      execution status of any other macro.  This is now Tested enough to say "YES" !!!

      The Only way to prevent ELSE clauses to NOT execute is with conditions (Using Flags..)
      or throwing an Overrun (Test 2).  The Overrun error terminates ALL remaining else clauses
      while the flag conditions handle just the else clause you are in. 

      I am assuming that other conditions that may be tested would operate the same as flags, but
      this is not a proven fact, seeing I only tested using flags.  I am confident enough in this
      that, other that a quick check, I will not be running a full spec test to verify.  If any
      data or errors that show up that say other conditions (Module status, etc.) act differently, I
      will setup and execute a complete test cycle.

      (Note to Self:  If testing Module Status, recheck Delay requirement re: Execution time in CM15)


Hope this answers the Else clause question this all started with.  I'm sure I got carried away, but I'm really an Old-School person when it comes to testing and try to not take anything for granted.  I'll admit, I really enjoy this stuff too much for my own good.  (And probably everyone elses too.)  Thanks
Title: Re: Empty ELSE Oddity
Post by: Puck on October 31, 2006, 02:09:43 PM
ArtClark: Good work on the ELSE's. Thanks. There definitely appears to be a problem there that needs to be addressed.

I will do a few tests on my AHP Version  as well. (Been too focused to getting some Halloween MACROS  ready.)
We'll take Tuicemen's advice and move a list of the ELSE Problems  over to the Software Problems & Bugs area. That way others can see what the problems are more easily and can look at this thread if they want the background.  ;)  :)