Please login or register.

Login with username, password and session length

Author Topic: Help needed with CM11/12 DIM commands within Real Basic or anything  (Read 7018 times)

daferrisda

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3

Hi,

I've managed to write a test RB program which switches on and off X10 modules fine, however I've now moved on to dimming and can't get it working. This is what's being sent and received all in hex &h

> Is Sending to the CM12
< Is receiving

>0466              04=Header 6=HouseCode A 6=DeviceCode 1
<6a                 Checksum
>00                 OK to transmit
<55                 Interface Ready
>8664              8=DimCommand 6=HouseCode 64=DimValue
<ea                 Checksum
>00                 OK to transmit
<55                 Interface Ready

I know these are being sent as the test program confirms this and the timing is correct, I think as it works ok when I'm using ON and OFF commands. I only send the next command when I receive either the checksum or the 55

Would really appreciate some help.

Thanks
David

Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Help needed with CM11/12 DIM commands within Real Basic or anything
« Reply #1 on: December 09, 2011, 06:55:05 PM »

Have you tried with other dim values or only with 64?
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

daferrisda

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: Help needed with CM11/12 DIM commands within Real Basic or anything
« Reply #2 on: December 10, 2011, 05:15:01 AM »

Have you tried with other dim values or only with 64?
I've tried with several but all of them seems to be ignored. I've noticed there is a delay between last 00 and 55 responses, so I guess it is sending something through the mains?
Logged

JoKer

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 21
Re: Help needed with CM11/12 DIM commands within Real Basic or anything
« Reply #3 on: December 10, 2011, 05:57:43 AM »

I'm certainly no expert in programming this stuff, but it seems like I recall seeing somewhere that in order to dim a module, it first requires an ON command, and then the dimming command, so maybe it would be worth trying that.

HTH...
JK
Logged

dhouston

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 37
  • Posts: 2547
    • davehouston.org
Re: Help needed with CM11/12 DIM commands within Real Basic or anything
« Reply #4 on: December 10, 2011, 07:17:50 AM »

It has been 3 or more years since I worked on low level code so things may have changed and the CM12 may differ from the CM11A but the current CM11A protocol documentation (Section 3.1.1) says...
Quote
Number of Dims is a value between 0 and 22 identifying the number of dims to be transmitted (22 is equivalent to 100%)
It  can take quite some time for a Dim or Bright command to be sent over the powerline and the CM11A doesn't return the 0x55 until that has completed. From a web article I wrote...
Quote
21 contiguous commands require 231 half cycles of the powerline or 3.85 seconds @ 60Hz. If an address + gap precedes the sequence, the total becomes 4.27 seconds.
It will take 20% longer at 50Hz.
OTOH, if you are sending extended dims, that requires a different method. See Section 3.2 of the documentation.

I wrote a CM11A demo in RealBasic several years ago but no longer have the source. A networked HDD died a couple of years ago and it had lots of things like this.

I no longer use RealBasic as it appeared their main motivation was to milk maximum revenue from their victims customers. I do have some ZBasic code but I'm not sure it will help you much and, as it was written 3+ years ago, I may not be able to answer questions. If you want the ZBasic code, send me a PM with your email address.
« Last Edit: December 10, 2011, 07:34:19 AM by dhouston »
Logged
This message was composed entirely from recycled letters of the alphabet using only renewable, caffeinated energy sources.
No twees, wabbits, chimps or whales died in the process.
https://www.laser.com/dhouston

daferrisda

  • Newbie
  • Helpful Post Rating: 0
  • Posts: 3
Re: Help needed with CM11/12 DIM commands within Real Basic or anything
« Reply #5 on: December 10, 2011, 07:51:54 AM »

Thanks for your advise it has helped, although I think I may have found my error. I'll do some more testing but I think my understanding of this line wrong


>8664              8=DimCommand 6=HouseCode 64=DimValue

Will let you know how I get one.

Thanks
David
Logged
 

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