Disable Groups Until .....

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by damok, Jun 10, 2008.

  1. damok

    damok

    Joined:
    Dec 13, 2007
    Messages:
    5
    Likes Received:
    0
    Hi all,


    I have a situation where I need to disable some channels or groups on a relay after a power failure to prevent overloading a backup power supply. I was wondering if there is any way of writing logic to prevent groups turning on until a condition is met. At the moment I can turn groups off upon power failure, however I can't nut out a way to keep them off until the mains power is present. For instance, I would like the logic to prevent switches and touch screens from turning certain groups on / off whilst in ups mode. I can't use an area address as I still require some channels to operate. At the moment any logic I've written goes into a continuous loop and fails to compile. Does anyone know of a way of writing logic with the following idea?


    once (GetLightingState("Mains Power Present") = OFF) then
    begin;
    SetLightingState("Alfresco - 2 x wall lights", OFF); UNTIL MAINS POWER PRESENT
    SetLightingState("Alfresco - 3 x downlights (2)", OFF); UNTIL MAINS POWER PRESENT
    SetLightingState("Alfresco - 3 x downlights (1)", OFF); UNTIL MAINS POWER PRESENT
    end;

    If anyone could please throw me some ideas I'd be very greatfull.

    Regards,
    Damon
     
    damok, Jun 10, 2008
    #1
  2. damok

    Mr Mark

    Joined:
    Jan 27, 2006
    Messages:
    323
    Likes Received:
    5
    Location:
    FNQ
    Hello Damon.

    Try using the logic on the output channels of the relay or dimmer.
    On the logic tab of the relay use "MAINS POWER PRESENT" in one of the logic groups and tick the "And" radio button down the bottom.

    This way you need "MAINS POWER PRESENT" plus "Alfresco 1", "Alfresco 2" and "Alfresco 3" for these channels to come on. When there is no "MAINS POWER PRESENT" these channels won't come on. Note: the other channels will operate as per normal.

    A picture is worth a thousand words, so have a look at the attached...

    Regards,

    Mark
     

    Attached Files:

    Mr Mark, Jun 10, 2008
    #2
  3. damok

    brett_lynn

    Joined:
    Sep 4, 2004
    Messages:
    44
    Likes Received:
    0
    Location:
    Beaconsfield Vic

    Love the 'KISS' theory - always works best

    Just one note to add to the above...
    the group address "mains power present" will need to reside in an input unit, i.e 4 ch bus coupler (5104bcl) etc
    connect this input unit to a VOLTAGE FREE contact from a standard SPST relay (use the N/C contact) which when the mains fails the relay will open circuit, breaking the contact and setting group address "mains power fail" to off...

    Once normal mains resume... the relay will close, making the circuit and setting the G/A "Mains Power Fail" to on...



    Cheers
     
    Last edited by a moderator: Jun 10, 2008
    brett_lynn, Jun 10, 2008
    #3
  4. damok

    damok

    Joined:
    Dec 13, 2007
    Messages:
    5
    Likes Received:
    0
    Thanks for your replies

    Hi All,

    Thankyou for your suggestions. I was trying to see if it was possible to write code in logic rather than using relay logic. As it stands, the suggestions posted is what I already have in place using a GI unit to monitor the mains power. I was trying to replicate the same functionality in logic, to teach myself other ways of programming. If anyone knows of a way of doing this without sending commands every loop cycle I would be pleased to hear from you.

    Regards,
    Damon
     
    damok, Jun 11, 2008
    #4
  5. damok

    NickD Moderator

    Joined:
    Nov 1, 2004
    Messages:
    1,427
    Likes Received:
    64
    Location:
    Adelaide
    Perhaps I'm missing something..

    You say it goes into an endless loop, but also that it fails to compile... I don't think it can do both?

    The above wouldn't compile because you have a semicolon after the first "begin".

    I don't see why something like :


    Code:
    once (GetLightingState("Mains Power Present") = OFF)
      begin
        {turn things off}
      end;
    
    once (GetLightingState("Mains Power Present") = ON)
      begin
        {turn them on again}
      end;
    wouldn't work.

    Nick

    PS : brett_lynn : you stole my avatar!
     
    NickD, Jun 12, 2008
    #5
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.