X10 Community Forum

🔌General Home Automation => Original ActiveHome => Topic started by: Pag on April 10, 2006, 05:51:41 AM

Title: CM11 / CM12 interface poll.
Post by: Pag on April 10, 2006, 05:51:41 AM
I'm currently writing a Java API to control my X-10 system from my PC.  Does anyone out there know what the behaviour of the CM11 / CM12 should be if it receives a power line command (for example from a tranceiver module) at the same time as it's handling a command from the PC?  It seems that it stops receiving the PC signal and sends an interface poll (0x5A).  This means that the PC must check for this code being received during a command transmission.  However, 0x5A could also be a valid checksum (for example Address A1: 0x04 + 0x56 = 0x5A).  Therefore, if the PC is monitoring the data coming back from the interface there's no way to distinguish between a checksum and an interface poll.  Is this the correct behaviour?

Many thanks!
Title: Re: CM11 / CM12 interface poll.
Post by: Charles Sullivan on April 10, 2006, 09:31:17 PM
Yeah, this is one of the quirks in the CM11A design which causes a lot of problems.  But there are two things you can look at:
1. If you're sending a signal you know when the checksum is 0x5A and can act appropriately.
2. When the CM11A receives a signal from the power line, it asserts the Ring Indicator serial line.  (Unfortunately I don't know the exact
timing between the RI and the 0x5A - it may be gone by the time the 0x5A is received.)
Title: Re: CM11 / CM12 interface poll.
Post by: Pag on April 11, 2006, 04:17:32 AM
Thanks - I'll have a look at the RI signal, that looks like the cleanest solution.  I can set a flag when it's asserted that should still be there when the 0x5A is received.

Thanks for your help,
Ian
Title: Re: CM11 / CM12 interface poll.
Post by: Pag on May 02, 2006, 12:17:41 PM
The RI solution works fine - thanks for the suggestion!
Title: Re: CM11 / CM12 interface poll.
Post by: hkactive on May 31, 2006, 06:31:27 PM
There is no timing issue. The problem is that you need to deal with the comEvReceive in the OnComm event properly with the right code.
Extract the buffer from the input in the OnComm event. See the hints at the end of this string that I posted: http://www.x10community.com/forums/index.php?topic=8512.0

If you set the the RThreshhold to 1, you should not miss any transmissions. Also setting the Inputlen to 0 (default value) makes the MSComm Control receive the entire transmission: check the MSDN documentation for your MSComm Control.

Hank
Title: Re: CM11 / CM12 interface poll.
Post by: Pag on June 01, 2006, 05:33:29 AM
Thanks for the message Hank, although I already have some fairly reliable code now.  My main stubling block was finding a serail port API for Java runnning on a windows platform that bothered to implement the RI events.

Cheers,
Ian