Please login or register.

Login with username, password and session length

Author Topic: CM11 / CM12 interface poll.  (Read 26448 times)

Pag

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
CM11 / CM12 interface poll.
« 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!
« Last Edit: April 10, 2006, 06:24:36 AM by Pag »
Logged

Charles Sullivan

  • Hero Member
  • *****
  • Helpful Post Rating: 94
  • Posts: 1565
    • HEYU - X10 Automation for Linux, Unix, and Mac OSX
Re: CM11 / CM12 interface poll.
« Reply #1 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.)
Logged
Yesterday it worked.
Today it doesn't work.
X10 on Windows is like that.

HEYU - X10 Automation for Linux, Unix, and Mac OS X     http://www.heyu.org

Pag

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: CM11 / CM12 interface poll.
« Reply #2 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
Logged

Pag

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: CM11 / CM12 interface poll.
« Reply #3 on: May 02, 2006, 12:17:41 PM »

The RI solution works fine - thanks for the suggestion!
Logged

hkactive

  • Full Member
  • ***
  • Helpful Post Rating: 1
  • Posts: 50
Re: CM11 / CM12 interface poll.
« Reply #4 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
Logged

Pag

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 5
Re: CM11 / CM12 interface poll.
« Reply #5 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
Logged
 

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