scene cycle & Ramp

Discussion in 'Pascal Logic Code Examples' started by wealie, Dec 26, 2015.

  1. wealie

    wealie

    Joined:
    May 24, 2015
    Messages:
    4
    Likes Received:
    0
    Location:
    France
    Hi all I have a problem that I know can be solved in code but ive been begging Cbus Uk for some logic training for over 6 months now with no sign of getting any soon. My issue is my client has had custom push button switch plates manufactured. I'm using the cubs couplers which all work fine. My problem is that in the bedrooms he has 2 push buttons switches on each plate and 3 plates (each bedside and main entrance) he wants each plate of 2 switches to do the same thing which is each push of the top button cycles through 4 pr-defined scenes, I have actually achieved this already with the help of this forum and a pascal controller. But the real issue is the bottom button he wants to hold it to ramp the active scene down. This is where I have come unstuck, can anyone offer me any advice as I can not find any literature on this scenario... He has spent hundreds on having the custom plates engraved so I wont lie im kind of stressing about this. Ive been using cbus for yrs and know the product well, and am really interested in getting my head around code level programing but for the life of me Schneider are not forth coming.
    Thanks in advance
     
    wealie, Dec 26, 2015
    #1
    1. Advertisements

  2. wealie

    jboer

    Joined:
    Apr 27, 2012
    Messages:
    458
    Likes Received:
    35
    Location:
    Sydney
    Hey Wealie,

    Can you post the logic you have for the Scene Cycling? We should be able to adapt that to do that you need.

    Thanks!
     
    jboer, Dec 27, 2015
    #2
    1. Advertisements

  3. wealie

    wealie

    Joined:
    May 24, 2015
    Messages:
    4
    Likes Received:
    0
    Location:
    France
    once GetLightingState("Group 4") then
    begin
    if SceneIsSet("Test Scene 1") then
    SetScene("Test Scene 2")
    else if SceneIsSet("Test Scene 2") then
    SetScene("Test Scene 3")
    else if SceneIsSet("Test Scene 3") then
    SetScene("Test Scene 4")
    else if SceneIsSet("Test Scene 4") then
    SetScene("Test Scene 1");
    end;
     
    wealie, Dec 27, 2015
    #3
  4. wealie

    wealie

    Joined:
    May 24, 2015
    Messages:
    4
    Likes Received:
    0
    Location:
    France
    Hi, Thanks in advance, Here is the simple code im using to cycle through the scenes. There are 4 scenes here i will only need 3. Sorry for the format ive posted it in i tried to do it in the format the forums requested.
     
    wealie, Dec 27, 2015
    #4
  5. wealie

    Dave Byron

    Joined:
    Aug 3, 2004
    Messages:
    835
    Likes Received:
    0
    Location:
    Casurina
    Wealie
    Did this sort of thing a long time ago, think I started a timer when the button was pressed then when it release I look at timer.
    Short time onto next scene, long time ramp scene.
    Dave
     
    Dave Byron, Dec 28, 2015
    #5
  6. wealie

    Roosta

    Joined:
    Nov 22, 2011
    Messages:
    560
    Likes Received:
    1
    Location:
    Australia
    Did your code above work as shown? I see a few flaws in it that would hamper its effectiveness..

    I always like using counters, makes my life easier, and allows for a bit more customisation..

    Ie set up top button to 'scene select button'..
    Use logic to count by adding 1 each time button is pressed and then reset at the end..
    Once 'scene select button' = on then
    'Scene count' = 'scene count' + 1
    Once 'scene count' = 1 then
    Setscene '1'
    Setlightingstate 'scene select button' to off
    Once 'scene count' = 2 then
    Setscene '2'
    Setlightingstate 'scene select button' to off
    Scene count = 0
    Obviously u can repeat above as many times as you like.. Can even change the dynamic labelling for each scene in above based on the count..

    From there based on your situation i would probably try using the nudge/ramp scene functionality using the currently selected scene..
     
    Roosta, Dec 28, 2015
    #6
  7. wealie

    wealie

    Joined:
    May 24, 2015
    Messages:
    4
    Likes Received:
    0
    Location:
    France
    ok, thanks guys im definately looking forward to having a play with this. im sure i will be back on here asking for help soon.

    Is this a universal code or is ir specific to cbus?
     
    wealie, Dec 28, 2015
    #7
  8. wealie

    Roosta

    Joined:
    Nov 22, 2011
    Messages:
    560
    Likes Received:
    1
    Location:
    Australia
    Its based upon a universal Pascal based code but adapted to suit cbus..
     
    Roosta, Dec 28, 2015
    #8
    1. Advertisements

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.