X10 Community Forum

🖥️ActiveHome Pro => ActiveHome Pro General => Software Problems & Bugs => Topic started by: Puck on November 05, 2006, 03:07:00 PM

Title: An ELSE *IS* an ELSE.... Unless...
Post by: Puck on November 05, 2006, 03:07:00 PM
I just did a few tests of my own, I won't go into the details here, but you will understand what I did.

A string of ELSE's WILL react as expected under most normal uses.

However, if JUST ONE ELSE starts with a DELAY command, the whole string becomes a bunch of ANDS. All that meet their conditions WILL execute.

FIX THIS X-10!!!

Workaround: If you must start a macro with a delay, and it is part of an ELSE string, place a real command at the start (even a dummy switch).

This explains why in my original Empty ELSE Oddity (http://www.x10community.com/forums/index.php?topic=10681.0) post, why my macro string didn't work properly when I just added a delay (do nothing) task if a certain condition was met.
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: KDR on November 05, 2006, 05:49:38 PM
Thanks for the tip and workaround Puck :D

My small little setup has 57 macros and most of them have time delays at the beginning. I do this to help keep PLC traffic jams down since allot of timers are set to the dusk/dawn setting. I use some + 5 - 5 settings in my timers but that doesn't fit my time frame for some macros. This also explains why some of them never seemed to work right with ELSE in them.


"good click"
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: ArtClark on November 06, 2006, 12:08:26 AM
Thank-You very much.  I did a large amount of testing, then saw the same thing.  What is stranger, the macros "Run from PC" do
NOT act this way "All the time"  I'm not detailing this, but the PC USUALLY works correctly while the CM15 doesn't.

This drove me crazy, because my CM15 cannot be told to execute a PLC command as the first macro instruction.  That Fails.

I'm wagering, without testing, That the delay causes the next else to fire?  (Other commands don't).

Puck, I knew you would find this out because I couldn't believe it was always not an else.  Wait till you see the strange PC - CM15
flag responses.  It's all inter-related and beyond what I could ever document.  Two Best bets.  1) You said it - X-10 Fix This...
2) Always Test the operation of else clauses.  I use this irregularity as an advantage as long as it's predicable.
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: Puck on November 06, 2006, 08:47:10 AM
Thank-You very much.  I did a large amount of testing, then saw the same thing.

ArtClark: A BIG thank you to you too. Your observations & tests were very Helpful in figuring this one out.  ;)

As far as X-10 fixing this, well I think we are out of luck. This sounds like an operational bug in the firmware. The micro-controller is a One-Time-Programmable  device. Hopefully they can figure out a way to fix it in the SmartMacro  software.

The source code of the firmware would be nice to have [nudge, nudge,  ;),  ;) ]
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: ArtClark on November 06, 2006, 02:26:36 PM
gee, I little thought.....   Do you think it might be possible to find the low-level data being sent to the CM15 from the PC.

If that Info could be obtained, then the actual code sent for smartmacros could be modified, even if it meant creating a
small program to download Macros and timers directly.  What do you think?  I myself can think of ways to monitor the USB
cable, save the binary dump, and decode, but the amount of work that would take, and decoding that I stink at, would
take a long time. 

Just a thought.  I have the feeling that X-10 will consider this proprietary and never release this type of info.

If they do, the smartmacro fix that is being looked for could be created with a "Post Processor" and then sent to the CM15.
To get really fancy, just "Post" the .ahx file and send to CM15.   

Anyone have good information sources inside X-10? ;)
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: Charles Sullivan on November 06, 2006, 04:36:48 PM
You can see what's downloaded to the CM15A EEPROM easily enough.   After you've downloaded, look at file:
  C:\Documents and Settings\All Users\Application Data\Active Home Professional\ahpeeprom_w.txt

It's even annotated for your perusal.
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: ArtClark on November 07, 2006, 03:00:54 AM
Thank-you Charles.  This is EXACTLY the information I was looing for.  I should be able to decode the exact operational
methods from the annotations and the true binary code seems to be there as well (Havn't verified that yet, but it looks like)

My next question though.  Is there any way to actually send the hex/binary directly to the CM15.  Knowing what to change
and how to change it is fine, but if I cannot send this to the CM15, it won't help to be able to change the binary.

I'm sure there is a simple method, but I can't seem to find it in the Documentation for VB, script, or any of the other
places I have looked.  Obviously, I can miss the easy things, seeing I missed this file  ::) ,but maybe someone else isn't
as blind as me?

TIA  (Thanks in Advance....)
Title: How to Patch the CM15A EEPROM Memory
Post by: Charles Sullivan on November 07, 2006, 11:36:40 PM

Thank-you Charles.  This is EXACTLY the information I was looing for.  I should be able to decode the exact operational methods from the annotations and the true binary code seems to be there as well (Havn't verified that yet, but it looks like)

My next question though.  Is there any way to actually send the hex/binary directly to the CM15.  Knowing what to change and how to change it is fine, but if I cannot send this to the CM15, it won't help to be able to change the binary.

I'm sure there is a simple method, but I can't seem to find it in the Documentation for VB, script, or any of the other places I have looked.  Obviously, I can miss the easy things, seeing I missed this file  ::) ,but maybe someone else isn't as blind as me?

TIA  (Thanks in Advance....)

How to Patch the CM15A EEPROM Memory

It's completely undocumented, not well tested, slow going, and you're on your own if you do it.  But you download to the CM15A the same way you would download to the old CM11A, i.e., you send 19-byte packets, each consisting of a 1-byte header (0xFB), a 2-byte Hi|Lo hex EEPROM address, and a 16-byte block of EEPROM code.  The 16-byte block has to be aligned with a 16-byte EEPROM page boundary, i.e., 0x0000, 0x0010, 0x0020, etc.  You can use the 'ahcmd sendrawplc' command in the ActiveHome Pro Software Development Kit to accomplish this from the command prompt.

Steps:


Example:

Suppose you change the value of the byte at EEPROM location 0x0123.  Then you would download the 16 bytes beginning at address 0x0120 including your change:

Quote
ahcmd sendrawplc FB 01 20 X0 X1 X2 CC X4 X5 X6 X7 X8 X9 XA XB XC XD XE XF

where CC is your changed hex byte and the XN's represent the other bytes in that page.

Notes:


Have fun!


[TTA Edit: Formatted for improved readability and added to User-Submitted Work-Arounds [Updated: 2007/06/15] (http://www.x10community.com/forums/index.php?topic=12198.msg68850#msg68850).]
Title: Re: An ELSE *IS* an ELSE.... Unless...
Post by: ArtClark on November 08, 2006, 01:10:31 AM
Thanks again.  Now that I know what and where I can start really playing with internal programming.

Of course, this will mean that AHP may not be useable once a Macro is written this way, but it will
always be the starting point.

I've been looking for this and it's like finding the pot of gold at the end of the rainbow.  Now if I can
only learn to utilize it to it's full potential......

Thanks again.