Please login or register.

Login with username, password and session length

Author Topic: comm protocol question  (Read 9487 times)

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
comm protocol question
« on: January 28, 2010, 06:48:51 PM »

im currently trying to write a program for a BS2 to control the CM11a.  I have the baud rate down, and i understand how to obtain the numbers. My question is what are the numbers Like hex, or decimal? Looking at the com protocol given with cm11a...

        0x04,0x66         Address A1
         0x6a      Checksum ((0x04 + 0x66)&0xff)
   0x00            OK for transmission.
         0x55      Interface ready.

   0x04,0x6e         Address A2
         0x72      Checksum ((0x04 + 0x6e)&0xff)
   0x00            OK for transmission.
         0x55      Interface ready.

looking at this i think hex numbers because of the "6e". however its not working for me. here's what my code looks for address A1...


          SEROUT 1, 16780, [HEX 04]
          SEROUT 1, 16780, [HEX 66]
          PAUSE 10
          SEROUT 1, 16780, [HEX 00]
          PAUSE 10

if any would could clarify this i would appreciate it.
thanks
Logged

pconroy

  • Hero Member
  • *****
  • Helpful Post Rating: 9
  • Posts: 294
Re: comm protocol question
« Reply #1 on: January 30, 2010, 10:20:51 PM »

I'm sorry that I don't know Basic Stamp syntax - but those are indeed hexadecimal values.

For communicating with the CM11A or Powerlinc Serial, you need to be able to send binary values out to the serial port.
I do all of my port programming in 'C' where I find it so much easier.

Another tool that I used was a "Serial Port Monitor".
For platforms like Windows and Linux, to name two, you can install software that monitors what is sent and received over the serial port. It makes it easy to see if what you *think* you're sending out the port is indeed what is getting sent.

I just finished up with the Powerlinc interface and will start on my CM11A in a few days.
Logged

halju

  • Jr. Member
  • **
  • Helpful Post Rating: 0
  • Posts: 11
Re: comm protocol question
« Reply #2 on: January 31, 2010, 10:07:42 AM »

thanks a lot, i figured out the hex question last night. however i didnt realize that they needed to be the binary form. i was sending hex numbers but thank you very much
Logged
 

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