ASCII strings

Discussion in 'C-Bus Serial Protocols' started by Robert Gangi, Aug 1, 2011.

  1. Robert Gangi

    Robert Gangi

    Joined:
    Aug 1, 2011
    Messages:
    2
    Likes Received:
    0
    Location:
    Melbourne
    Hi,
    I've been asked by a 3rd party security device to supply some ASCII strings to control some basic function of my cbus system. I have never used ASCII and would like to know how to turn on, for example, group 35 in the standard lighting application using an ASCII string. Can anyone help?

    Thank you
     
    Robert Gangi, Aug 1, 2011
    #1
  2. Robert Gangi

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    The Serial Protocol, for talking to C-Bus, is available as a free download from the Clipsal website here. It explains how to create commands that you can send to C-Bus, via a C-Bus interface, for a whole range of C-Bus functions.
     
    Newman, Aug 1, 2011
    #2
  3. Robert Gangi

    Robert Gangi

    Joined:
    Aug 1, 2011
    Messages:
    2
    Likes Received:
    0
    Location:
    Melbourne
    Thank you for the info. I had a good look at it, but am getting stuck at the check sums. Not sure how this is calculated, even though it is explained in the document.
     
    Robert Gangi, Aug 3, 2011
    #3
  4. Robert Gangi

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,392
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Take the numbers as presented (hex, readable), and turn them into read hex numbers. Calculate on those. Get the checksum. Turn back into readable.

    Example:

    Readable text = \05ABCDEF

    Whats the checksum?

    Calculate ( on numbers, not the ASCII characters):

    0x05 + 0xAB + 0xCD + 0xEF = 0x26C.

    Now, because the checksum is byte-based, the overflow into more than a single byte are discarded:

    0x26C -> 0x6C

    Now, flip all the bits and add 1 (this makes the negative, or 2's complement):

    0x6C -> (flip the bits) 0x93.
    Add 1: 0x94.

    So the checksum, back in ASCII characters is "94".
     
    ashleigh, Aug 3, 2011
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.