Serial interface problems

Discussion in 'C-Bus Wired Hardware' started by raiya_23, Nov 7, 2009.

  1. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    I am programming a crestron processor to control a Clipsal C bus lighting system.
    I have read and understood the serial interface user guide. The serial command in the examples of the guide is in the form:
    \x0538000108BA

    I know 05=header
    38=lighting application address
    00=default
    01=off command
    08= group number
    BA=checksum

    Can anyone please tell me how to assign the group number?
     
    raiya_23, Nov 7, 2009
    #1
  2. raiya_23

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,400
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    CORRECTION:
    I know 05=header
    38=lighting application address
    00=default ROUTING (this means into the local network only)
    01=off command
    08= group number
    BA=checksum

    AS TO HOW GROUP NUMBERS ARE ALLOCATED:

    Toolkit places (programs) the group numbers into devices on a network. The numbers of the groups are assigned by the installer as part of how they figure out how the network should operate. So - answer to the question is 2 parts:

    1. Groups numbers are chosen by a person (the installer) and can be anything in the range 0..254.

    2. The chosen group numbers are programmed into one or more units on the bus, using Toolkit.
     
    ashleigh, Nov 7, 2009
    #2
  3. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    Can you please tell me the procedure? you are not talking about the groups we select from the drop down menus in the unit programming right?
     
    raiya_23, Nov 11, 2009
    #3
  4. raiya_23

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,400
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    Yes. Those are the groups.

    You allocated them when you program the relationships between devices using Toolkit.

    Once you know those groups (by HEXADECIMAL number) you can issue serial command strings to control them.
     
    ashleigh, Nov 11, 2009
    #4
  5. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    I have used the command

    \x0538007908\r

    where

    05=header
    38=lighting application address
    00=default
    79=on command
    08= group number

    This command is being used to light up the group of channel one on an eight channel relay. I have used the address 008 when assigning the group in the C bus toolkit programming. I am using a crestron processor to send the command yet the channel doesn?t turn on. Is there a mistake in the command I am sending?

    Plus I have not assigned the checksum in the command. What is the default value of the SRCHK option? Is it turned on or off?

    I am using only one relay right now but what if I decide to use more than one? How should the addressing be done then?
     
    raiya_23, Nov 13, 2009
    #5
  6. raiya_23

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You should send the following:
    \0538007908r

    That will send an On command to Group Address 08.

    Fresh out of the box, the Checksum parameter is turned off in a PCI. If the checksum option is turned on, then every message sent to the PCI will require you to calculate the checksum and append it to the message, just before the "r" character.

    If the command is successful, you will receive an "r." back from the PCI.

    If you wanted to turn on 3 relays, for example, and their Toolkit Groups were 008, 009 and 010, then you would send the following command:
    \05380079087909790Ar

    This is called a concatenated command, where you send multiple commands within a single message. The reason that it is 0A and not 10 for the 3rd command is that Toolkit, by default, uses decimal addressing, whereas the C-Bus devices use hexadecimal addressing.
     
    Newman, Nov 13, 2009
    #6
  7. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    I wrote the code as you instructed but now when I complie I got the notice:

    NOTICE (RLCMCVT106)
    Invalid Escape Sequence "\0" detected in S-1, Prompt "str1".

    However I uploaded the program to my processor anyway but when I tested it the group number 8 did NOT light up.

    I cannot figure out the problem.
     
    raiya_23, Nov 17, 2009
    #7
  8. raiya_23

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    If you are sending the string to the interface through a computer program you need to include a carriage return <cr> on the end of the strings for the PC Interface to be notified that the incoming message is complete, and can now be processed.

    I suggest you open a hyperterminal session to your interface and try sending the string "\0538007908r" to it, followed by a carriage return. If it works, then you know that the problem is in your program/code.

    If it doesn't work then send the string "~~~" followed by "\0538007908r<cr></cr><carriage return="">" followed by a carriage return. This will reset the interface to basic mode prior to processing the command. If this works, then the problem is that you're not initialising the interface correctly in your program.</carriage></cr>
     
    Newman, Nov 17, 2009
    #8
  9. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    Yes I am sending the commands through a computer program but how do I include a carriage return?
     
    raiya_23, Nov 18, 2009
    #9
  10. raiya_23

    hoofie

    Joined:
    Jul 17, 2008
    Messages:
    5
    Likes Received:
    0
    No-one can answer that for you as it entirely depends on what software you are using [Crestron] ?
     
    hoofie, Nov 18, 2009
    #10
  11. raiya_23

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    We aren't really the right people to ask, as we are not necessarily familiar with Crestron.

    It looks like the Crestron compiler doesn't like the \0 in the string. In C and some other languages, the \ has a special meaning in a string. In those languages, if you want a backslash in the string, you put in two of them, so your string would be \\0...

    Give that a try.
     
    Darren, Nov 18, 2009
    #11
  12. raiya_23

    raiya_23

    Joined:
    Jun 22, 2009
    Messages:
    16
    Likes Received:
    0
    Location:
    Pakistan
    Yes I am using crestron
     
    raiya_23, Nov 19, 2009
    #12
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.