RS232 Public Protocol

Discussion in 'General Discussion' started by xrmichael, Aug 19, 2007.

  1. xrmichael

    xrmichael

    Joined:
    Nov 20, 2006
    Messages:
    113
    Likes Received:
    1
    Location:
    uk
    Is there a way to mimic an actual button press via the pci and an external device that can generate a rs232 command at the moment i can ramp, switch on and off via the public release protocol but i rally want 1 button that will act as if it was an actual cbus switch to dim up and down etc.
     
    xrmichael, Aug 19, 2007
    #1
  2. xrmichael

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    The C-Bus switches issue commands in exactly the same format you see in the public release protocol.

    Of course, there is a *lot* of software running in the switch to detect how long a button is being held, and so on.

    Example of a press & hold dimmer:

    When press detected, issue a command "Ramp to 0 at rate blah blah".

    Start timers internal to switch to pretend switch is doing the ramp as well.

    when button released, use the INTERNALLY calculated level (from doing the ramp) to issue another command "Ramp to level X instantly".

    From the basic commands, as you can see, its all just software running in the switch.
     
    ashleigh, Aug 20, 2007
    #2
  3. xrmichael

    xrmichael

    Joined:
    Nov 20, 2006
    Messages:
    113
    Likes Received:
    1
    Location:
    uk
    Rs232

    Slightly clearer,

    If i issue a ramp to 0 command to the pci wont the light just ramp to 0 and stop irrespective, of how long the button is held on my remote that is driving the pci? Then if i press the button again i presume nothing will happen because it will just try and ramp the light off again?
     
    xrmichael, Aug 20, 2007
    #3
  4. xrmichael

    rhamer

    Joined:
    Aug 3, 2004
    Messages:
    673
    Likes Received:
    3
    Location:
    Melbourne, Australia
    When you hold in a button on a C-Bus switch it sends a ramp to either 100% or 0% over x seconds. I can't remember what x is but is's something like 8. So it's the dimmer that is doing the ramping over time

    When you do this the switch starts an internal ramp of its own that tracks the ramping of the dimmer. The internal switch ramp does nothing except provide the switch with a way to figure out what the level is if (or when) you lift off your finger before x seconds has elapsed. At that point (lets say the 4 second mark) the switch calculated the dimmer would have the light at 50% so the switch sends a ramp to 50% over 0 seconds (instant) this effectively stops the previous dimming command.

    You can sometimes see a small correction happen when you are dimming and release your finger, you will see the actual brightness shift slightly.

    So in theory you can do all that yourself and just issue the 2 commands at the appropriate time.

    Cheers

    Rohan
     
    rhamer, Aug 20, 2007
    #4
  5. xrmichael

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Thanks - got it in one :)
     
    ashleigh, Aug 20, 2007
    #5
  6. xrmichael

    xrmichael

    Joined:
    Nov 20, 2006
    Messages:
    113
    Likes Received:
    1
    Location:
    uk
    rs232

    Going to be a tough call to wright a programm to mimic a switch then.
     
    xrmichael, Aug 20, 2007
    #6
  7. xrmichael

    ashleigh Moderator

    Joined:
    Aug 4, 2004
    Messages:
    2,391
    Likes Received:
    24
    Location:
    Adelaide, South Australia
    Depends on how complex you want it to be.

    Mind you, the code for cbus wireless switches does come in about about 70,000 lines of source code. Does a lot more than you are after though.

    Basic function should be able to be achieved in about 500 - 1000 lines of code.
     
    ashleigh, Aug 21, 2007
    #7
  8. xrmichael

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    I am interested in what you are trying to do. Are you trying to incorporate a C-Bus interface into one of your products and present the user with your own buttons to mimic a C-Bus unit?

    If so, you could use a bus coupler to do the C-Bus button interface with your buttons, and use the PC Interface to detect commands on the bus for your system to use. This is probably the easiest way if your system is a one-off.

    If you want to integrate C-Bus more directly into your system, there are more ways to achieve what you want, but you would have to join the C-Bus Enabled program to gain access to the details.
     
    Don, Aug 21, 2007
    #8
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.