Using Logic to switch Relay On/Off multiple Times

Discussion in 'C-Touch/HomeGate/SchedulePlus/PICED Software' started by Troy Russell, Apr 13, 2011.

  1. Troy Russell

    Troy Russell

    Joined:
    Jan 13, 2011
    Messages:
    6
    Likes Received:
    0
    Location:
    Gold Coast
    Hi Guys,

    I have a pool lights that scroll's their colour when turned On/Off/On.
    I am having a mental blank and couldn't find anything already on the forum (Or my search words are incorrect)

    I know I need to do it in logic but don't know where to start.

    The scenario is as follows:

    "ON" Button Press on the Touch Screen-
    1. Turn on Relay Channel 11 for 1 second
    2. Turn off Relay Channel 11 for 1 second
    3. Turn on Relay Channel 11 for 1 second
    4. Turn off Relay Channel 11 for 1 second
    5. Turn on Relay Channel 11 until button pressed to turn off
    (During this sequence the on state of the button is solid and not flashing in time with the relay on/off)

    ""OFF" Button Press on the Touch Screen-
    1. Turn off Relay Channel 11
     
    Troy Russell, Apr 13, 2011
    #1
  2. Troy Russell

    Troy Russell

    Joined:
    Jan 13, 2011
    Messages:
    6
    Likes Received:
    0
    Location:
    Gold Coast
    Does this look OK

    I have just thought this might work.

    Change the "Pool 1" which refers to the relay to a dummy called "Pool 1 Button"

    Then in logic do the following:

    once GetLightingState("Pool 1 Button")= ON then
    begin
    SetLightingState("Pool 1", ON);
    Delay("0:00:01");
    SetLightingState("Pool 1", OFF);
    Delay("0:00:01");
    SetLightingState("Pool 1", ON);
    Delay("0:00:01");
    SetLightingState("Pool 1", OFF);
    Delay("0:00:01");
    SetLightingState("Pool 1", ON);
    end;
    once GetLightingState("Pool 1 Button")= OFF then
    begin
    SetLightingState("Pool 1", OFF);
    end;


    Does this look correct or have I gone about it wrong
     
    Troy Russell, Apr 13, 2011
    #2
  3. Troy Russell

    Darren Senior Member

    Joined:
    Jul 29, 2004
    Messages:
    2,361
    Likes Received:
    0
    Location:
    Adelaide, South Australia
    That looks right.
     
    Darren, Apr 14, 2011
    #3
  4. Troy Russell

    Troy Russell

    Joined:
    Jan 13, 2011
    Messages:
    6
    Likes Received:
    0
    Location:
    Gold Coast
    Thanks Darren
     
    Troy Russell, Apr 14, 2011
    #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.