Understanding Timer micro functions

Discussion in 'General Discussion' started by brodricj, Aug 4, 2011.

  1. brodricj

    brodricj

    Joined:
    Mar 27, 2007
    Messages:
    117
    Likes Received:
    0
    Location:
    Perth
    I'm having difficulty understanding timer functions when controlling a group. My application seems simple enough, I have a light in a cupboard that I want to come on for a preset time when I open the cupboard door.

    There is a dry contact switch on the door jamb that closes when the door is shut, and opens when the door opens. The switch is connected to AUXINPUT Channel 2.

    The cupboard light is on Group 2 and has been defined on the appropriate relay channel.

    I've assigned the AUXIN Channel 2 Group to Group 2 and selected the Timer function from the drop-down list. When defining the timer function I've tried just about all the options there but I can't get the light to do what I want.

    How do I trigger a timer to run for 2 minutes when the dry contact switch (door) opens, and stay on for that 2 minutes whether the door remains open or closed? If the door closes and is opened again within that 2 minutes I want it to re-trigger the timer for another 2 minutes. After the 2 minute timer lapses I want the light to stay off whether the door is open or closed. But in all cases when the door goes from closed to open I want it to trigger a 2 minute timer.

    I'm just going loopy trying to sort this one out!
     
    brodricj, Aug 4, 2011
    #1
  2. brodricj

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    The timer functions sound pretty straightforward, but I suspect you're having problems because of the sense of the switch.

    Key timer functions just start a timer, and some other key stage command is normally required to define the state of the group while the timer is running. Normally with a pushbutton, the state is changed to ON when the button is pressed, and the timer is started when the button is released.

    If you have a more recent bus coupler which has the option of configuration with bistable switches, the problem would be trivial - just set to bistable, and assign the open functions to ON and start (or on and retrigger.. same effect).

    If you don't have that choice, my second suggestion would be to change the sense of the switch, so that the switch closes when the cupboard opens. This would allow just pressed to be assigned ON and long press to be either start or retrigger.

    If you're stuck with the switch being closed when the cupboard is shut, and stuck with momentary contact switch functionality in the bus coupler, then when the cupboard is opened, you only have one 'event' available - you can either start a timer or turn on the group, but not both. The 'event' will most likely be 'long release', but if the cupboard is closed for a short time, you might get 'short release', so it's best to configure both of these events with the same command. If you have a spare channel in the bus coupler, you could use one to turn on the group, and assign the second input (with block mapping so the second input controls the same group as the first input) to start a timer. Wire both inputs to the same switch. This should work but I haven't tested it.. I haven't any hardware to test it with here.
     
    Last edited by a moderator: Aug 4, 2011
    Don, Aug 4, 2011
    #2
  3. brodricj

    brodricj

    Joined:
    Mar 27, 2007
    Messages:
    117
    Likes Received:
    0
    Location:
    Perth
    The switch is a magnetic type and I am unable to change the sense, and I guess the AUXIN must be of the older type as I don't see any bistable configuration option on the GUI.

    So far I've been able to get the light to do everything except for either of the two possibilities which make it functional...can't get it to come on when the door opens and go off when the door closes, or to trigger a timer when the door opens and have it turn off after the preset time...who would have thought something seemingly so simple could turn out this tricky!!
     
    brodricj, Aug 5, 2011
    #3
  4. brodricj

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    ok. let's see...

    "come on when the door opens and go off when the door closes"

    jp = idle
    sr = onkey
    lp = offkey
    lr = onkey

    tested and works on my desk.

    "trigger a timer when the door opens and have it turn off after the preset time"

    I tried what I had suggested earlier on a real bus coupler of early vintage and you're right.. it doesn't work (it would if the two channels were in different units).

    Another approach if you do have two channels available and are willing to use logic in the output unit controlling the load:

    input 1:
    jp = idle
    sr = start
    lp = onkey
    lr = start

    input 2:
    jp = offkey
    sr = onkey
    lp = idle
    lr = onkey

    configure the two inputs to control two different groups (blocks tab)
    Configure the relay (or dimmer) channel to respond to the first group with MIN logic applied to include the second group.

    wire the 2 inputs in parallel to the magnetic switch.

    this does work, but is a bit messy.
     
    Don, Aug 5, 2011
    #4
  5. brodricj

    brodricj

    Joined:
    Mar 27, 2007
    Messages:
    117
    Likes Received:
    0
    Location:
    Perth
    Thanks. If I understand #1 correctly, changing the Advanced>>Channel functions as suggested will force the Group function to <custom>? however I don't understand jp...is that meant to be short press under Channel functions tab in Advanced GUI?
    #2 option sounds like a learning curve in logic for me...I have a CTC but haven't explored the logic engine before...I guess I have some reading to do (yes, I do have a spare channel on the AUXIN...I'd really like to get this thing running off a timer, because once it's working properly I can do the auto-on lights for all the other cupboards).

    EDIT: Victory! Of sorts, light comes on when door opens, light goes out when door closes...the following did the trick
    sp = offkey
    sr = onkey
    lp = offkey
    lr = onkey

    Now to go learn the logic engine
     
    Last edited by a moderator: Aug 5, 2011
    brodricj, Aug 5, 2011
    #5
  6. brodricj

    Newman

    Joined:
    Aug 3, 2004
    Messages:
    2,203
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    Don is not suggesting that you learn the logic engine. He is suggesting that you use the built-in logic functions of output units. Suggest that you re-read his post again and take a look at the logic tab in the UI for a dimmer/relay.
     
    Newman, Aug 5, 2011
    #6
  7. brodricj

    Don

    Joined:
    Aug 4, 2004
    Messages:
    429
    Likes Received:
    0
    Location:
    Townsville, Australia
    1) I always call the first key press stage "just pressed' because that is exactly what it is. The just pressed command issues every time teh key is pressed, whether it is held down for a long time or not. Toolkit calls it 'short press', which is a little misleading...

    2) Because of the way the 'short press' command works (see above), your victory works, and there's no reason to change it, but it would also work if the first command was idle.

    3) Newman is right. There's no need to use the 'logic engine' (in the CTC, C-Touch markII, PAC or similar unit) for this solution. Most C-Bus output units natively support a simple logic of sorts (MIN or MAX) to allow combining levels of different groups to control each output terminal.
     
    Don, Aug 6, 2011
    #7
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.