Another feedback question

Discussion in 'C-Bus Serial Protocols' started by mbuster, Mar 16, 2011.

  1. mbuster

    mbuster

    Joined:
    Mar 8, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    US
    OK, I'm sure this has been covered, but I've read a lot of threads, as well as the protocol documentation, and I'm still a little bit fuzzy. My main questions are in regards to properly initializing the RS232 interface.
    My desired end result would be to have the system respond to my level status requests when my program launches, to initially populate levels. This is working now.
    Then, when a level is changed by any source (keypad, or the RS232 port) I'd like to have that be reported as well, so that other instances can see the updated levels. That is the part I'm having trouble getting to work properly.
    I am trying to avoid constantly polling with level status requests due to the amount of traffic it creates.
    Any info would be greatly appreciated.
     
    mbuster, Mar 16, 2011
    #1
  2. mbuster

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Whenever a C-Bus unit sends a message to turn something on, change the level, etc, you should see the message it sends on the serial port. You will most likely already be receiving these messages (depending upon PCI mode). If you're using the C-Bus module, these will be decoded for you.

    There are very few cases in C-Bus when polling is required.
     
    Newman, Mar 16, 2011
    #2
  3. mbuster

    mbuster

    Joined:
    Mar 8, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    US
    Thanks for replying. I do see messages when a keypad changes a light level. I do not see changes when the level change was initiated by a device connected to a serial port. Basically, I will have multiple RS232 devices. When one makes a change to the network, I was hoping for some kind of broadcast update to let the others know.
     
    mbuster, Mar 16, 2011
    #3
  4. mbuster

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    OK, your initial post seemed to indicate that you weren't seeing these messages from any devices, which is a different thing. The messages are being sent, but they're not being sent in a format that your current PCI mode is decoding for you.

    You will need to turn on the Local SAL option in the interfaces that you are using to send messages on to C-Bus. This option needs to be set when you initialise the PCI.

    If you look in the Serial Interface Users Guide you will see this option explained in Section 4.2.9. There's some further info in section 10.3.6.
     
    Newman, Mar 17, 2011
    #4
  5. mbuster

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    There are a few documents you need to read. The Serial Interface Users Guide is one of them (lots of yummy gory detail).

    The C-Bus Interface Requirements document sets out very clearly the type of initialisation you must perform, for the type of function you want to have.

    I strongly suggest you read this. It's a lot to wade through but if you don't read it you will be back asking questions here over and over, and you will have things that do not work as expected.

    Referenced documents are here: http://training.clipsal.com/downloads/OpenCBus/OpenCBusProtocol.html
     
    ashleigh, Mar 17, 2011
    #5
  6. mbuster

    mbuster

    Joined:
    Mar 8, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    US
    Thanks guys. I actually did read the serial protocol guide before posting, which is how I got as far as I have. Clearly I missed something, or didn't properly implement what I read.
    I'll tackle it again, thanks.
     
    mbuster, Mar 17, 2011
    #6
  7. mbuster

    mbuster

    Joined:
    Mar 8, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    US
    So, after trying this again, I cannot make the CNI report level changes initiated via the RS232 port.
    I see the MMIs coming in every 3 seconds. If I press a button on a keypad, I see the monitored SAL on the serial interface. But no matter how I initialize the CNI, I cannot see a monitored SAL come back for a command sent into the serial interface, which is my main hurdle.
    I have tested this by creating my own commands, using the diagnostic utility, etc.

    Let's say I press a button on my keypad. I see the following message come through the serial port:
    05023800790048<CR>

    Now I want to perform the exact same function via my device attached to the serial port, so I send in:
    \05380079004A<CR>

    But alas, I cannot see a return. The client device connected to the serial port has multiple other devices connected to it, sharing that serial port. So if one of those secondary clients initiates a level change, I want the others to be able to see that change through a SAL on the shared rs232 interface. I suppose I am still missing something, but I have been playing with those interface options for a while now and cannot get the desired behavior.
     
    mbuster, Mar 17, 2011
    #7
  8. mbuster

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    You have described your set-up slightly differently this time.

    It sounds like you have multiple devices sharing a single serial (RS232) port through a "client" (which I assume multiplexes the messages). You haven't stated what this serial port does, but I assume it is connected to a PCI. If this is not correct, maybe draw a diagram for us.

    When you send a command to C-Bus you don't get an echo of that command from the PCI if you have SMART mode set. You could initialise your PCI to not use SMART mode (see Serial Interface User Guide), but this changes the format of received messages as well.

    This sounds like the problem previously diagnosed as requiring Local SAL to be set. You haven't said if you have done that.

    If you still have problems, I would suggest posting a block diagram of your system so that we can get a clear picture. I am not sure if we are correctly understanding your questions at the moment.
     
    Last edited by a moderator: Mar 17, 2011
    Darren, Mar 17, 2011
    #8
  9. mbuster

    mbuster

    Joined:
    Mar 8, 2011
    Messages:
    5
    Likes Received:
    0
    Location:
    US
    Yes, I have set Local SAL on (and off, along with any combination of initialization options I can think of) and had it set before I made my first post.

    The simplest way to describe it is this:
    I am not looking for a local echo.
    If I send the PCI a message to control a lighting load, I want all PCIs on the network (including the one the message was sent into) to respond with the SAL message, EXACTLY as if the command originated from a keypad.
     
    mbuster, Mar 18, 2011
    #9
  10. mbuster

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,397
    Likes Received:
    26
    Location:
    Adelaide, South Australia
    OK, from that description it is now clear.

    This will not (ever) happen.

    Using Local_SAL mode when you send a message in to a PCI you will see the equivalent message [just lkike a keypad] come out of other PCIs.

    It will NEVER come back out of the PCI through which you injected it.

    Now... before considering this to be bad, think for a moment about the implications. If you sent the message into the network on device X, then you know the network state [which is all about sharing a network variable.... its updated everywhere or nowhere]. So if you sent it in on device X you know the state is consistent everywhere, including the other devices where it pops out.
     
    ashleigh, Mar 18, 2011
    #10
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.