Results 1 to 4 of 4

Thread: wait for event and timeout

  1. #1
    Automated Home Sr Member
    Join Date
    Jul 2004
    Posts
    57

    Default wait for event and timeout

    Hi guys,

    I've got a macro which turns the outside lights on when a car comes down the drive. The macro starts when one inductive loop is trigged and then waits for a second loop to trigger before turning on the rest of the lights. It works well, however... Occasionally a car will trigger the first loop, but then not carry on down the drive meaning the macro waits forever for the second loop to be triggered. I'm trying to find an elegant way of achieving "wait for 2 minutes then reset the macro". I've currently got another macro which is triggered at the same time which waits for a couple of minutes and then enables and disables the macro if it is still running - this has downsides as there are a few scenarios when the original macro might still be running for a valid reason.

    Any better ideas?

    Peter.

  2. #2
    Automated Home Legend chris_j_hunter's Avatar
    Join Date
    Dec 2007
    Location
    North Lancashire
    Posts
    1,713

    Default

    how about picking-up on the fact (?) that the second trigger could, in such cases, be of the first loop, rather than the second ?

  3. #3
    Automated Home Ninja Viv's Avatar
    Join Date
    Dec 2004
    Posts
    284

    Default

    Peter,

    Cortex version 26.4.1 will introduce an optional time-out for the "Wait for event" item in a Macro. If it times out it then proceeds to the next item as if the condition was satisfied. However a new output connection is offered by the Macro which is 'Wait for event timeout'. This may be tested by the Macro using the IF, ELSE, ENDIF statements so it can decide what happens on Time-out or condition satisfied.

    Viv

  4. #4
    Automated Home Sr Member
    Join Date
    Jul 2004
    Posts
    57

    Default

    Thanks Viv, that'll be much better than my lash up!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •