Logic stepping - please show me how to

Discussion in 'General Discussion' started by tobex, Nov 12, 2010.

  1. tobex

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    I would like to know a method (without PACA) to step through a series of associated logic functions linked to repeated short press on a key.

    Using only one button I want the key to behave in the following manner.

    From Off,
    Pressing button ----> Logic 1 ----> Logic 2 ----> Logic 3 ----> Logic 1 .........

    I want a different button to be the off switch (all off)

    The nature of the logic is that each press opens more and more channels till it is totally lit. It is a quasi "scene switch" for lighting quantity.

    What is the best combination of hardware to get this result ?
     
    tobex, Nov 12, 2010
    #1
  2. tobex

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    I am starting to think that a nested PACA coding is needed. I dont see many ways of doing it with normal coding.
     
    tobex, Nov 13, 2010
    #2
  3. tobex

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    It sounds like you are describing something we call "scene cycling" where repeated pressing of a button results in a series of different scenes. If I understand correctly, you are wanting a few groups on in the first scene, a few more in the second scene and all on in the third scene.

    This can not be done directly without using logic in a PAC or touch screen.

    Assuming the groups you are controlling are on relays, you could have your switch ramping a group and have different turn-on thresholds for the different relay channels. Holding the switch down will then make the group ramp, and more loads will come on over time.

    If this is no good, then:
    1. Set a key input to be a bell press controlling group "Scene Cycle"
    2. In a PAC/Touch Screen, create the four Scenes:
    - "All Off Scene" (triggered by another key switch)
    - "Part On Scene 1"
    - "Part On Scene 2"
    - "All On Scene"
    3. Add the following logic code:

    Code:
    once GetLightingState("Scene Cycle") then
    begin
      if SceneIsSet("Part On Scene 2") then
        SetScene("All On Scene") 
      else if SceneIsSet("Part On Scene 1") then
        SetScene("Part On Scene 2")  
      else if SceneIsSet("All Off Scene") then
        SetScene("Part On Scene 1");
    end;
     
    Darren, Nov 14, 2010
    #3
  4. tobex

    tobex

    Joined:
    Nov 3, 2006
    Messages:
    728
    Likes Received:
    0
    Location:
    Sydney, Australia
    Thank you thats really impressive. Im so glad that a touch screen can handle this. Rather impressive.

    I was out of the game for a long time. Looks like I have fun with the new stuff.
     
    Last edited by a moderator: Nov 14, 2010
    tobex, Nov 14, 2010
    #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.