Please login or register.

Login with username, password and session length

Author Topic: When to Delay & How Long  (Read 6947 times)

spam4us

  • Hero Member
  • *****
  • Helpful Post Rating: 3
  • Posts: 152
When to Delay & How Long
« on: September 26, 2007, 02:03:47 AM »

I read many posts about Delays. Some a couple of years old and some fairly new.  Is there a guideline as to when a delay needs to be used and how long that delay would be. I've read all the "if you're new to X10" posts but there are varying answers. Some say use a 1 second delay; others say a 0 second delay; others say delays are not needed all the time.

     Right now in all of my macros, I put a 1 second delay after each command.
Example:
trigger a1 On
     If L1 on and Flag1 off
     set flag1 on
     delay 1 sec
     set B1 On
     delay 1 sec
     set B2 On
   Are these needed? My macros seem to run too slow.

     Also if I am turning on/off a dummy module, do I need a delay there as well?


thanks
Logged

Puck

  • Advanced Member
  • Hero Member
  • ******
  • Helpful Post Rating: 171
  • Posts: 1799
Re: When to Delay & How Long
« Reply #1 on: September 26, 2007, 09:32:36 AM »

spam4us: In your example, none of the delays are needed.

Outside of their obvious use for applying a pause in the macro, here a couple reasons I experienced for using them:

1) When dimming a module, place at least a 1 second delay after it if there is another command to follow.

2) When turning ON or OFF two or more same House Code modules, I sometimes use a zero second delay between them; here is why...
 
    E.G. Turn B1 ON, Turn B2 ON

    a) Without a delay, the addresses are sent (B1, B2) and then the ON code is sent (B ON)

    b) With the zero delay: B1 ON is sent and then B2 ON is sent (they are separated)

Just from my experiences, I found the zero delay method more reliable and it does not slow down the macro.

Quote
Also if I am turning on/off a dummy module, do I need a delay there as well?

Use at least a zero second delay prior to calling the dummy to ensure it triggers reliably (see reason 2 b above).

Logged

HA Dave

  • Hero Member
  • *****
  • Helpful Post Rating: 175
  • Posts: 7127
Re: When to Delay & How Long
« Reply #2 on: September 26, 2007, 07:16:03 PM »


Just from my experiences, I found the zero delay method more reliable and it does not slow down the macro.


Wow hadn't thought of OR read about A ZERO sec delay before! THAT IS HELPFUL!
Logged
Home Automation is an always changing technology
 

X10.com | About X10 | X10 Security Systems | Cameras| Package Deals
© Copyright 2014-2016 X10.com All rights reserved.