Question about DEFER\DELAY

apjohnson

New member
First, thanks to everyone out here on this forum that answers question and reviews code for people. I've learned so much from reading the threads in this forum and reading Allen's guide. THANK YOU!!

Now my question. I have a basement sump and when power goes off, my sump gets an extra 3" or 4" of water draining out of the plumbing and out of my display tank. It's enough to cause my skimmer to overflow if I don't turn it off. I have to make sure that my skimmer code accommodates for power off and return pump off conditions. My question is about the DEFER command and how I need to change my code to make it work correctly.

My skimmer code currently looks like this:
Fallback ON
Set ON
If Power EB8_DnStr Off 003 Then ON
If Outlet Tarpon = OFF Then OFF

I would like to have a 3 minute delay in start after a power outage or after the return pump has been turned of (OUTLET Tarpon). So my If Power statement takes care of the power outage condition, but I don't have anything to handle the return pump condition. I saw a similar thread where DEFER was used, but I'm just wondering if I need to take my Set ON out in order to use it. If a SET ON is processed, then don't the following statements need to be conditions in which you want the skimmer to be off? So if I change the code to:

Fallback ON
Set ON
If Power EB8_DnStr Off 003 Then ON
If Outlet Tarpon = OFF Then OFF
Defer 003:00 Then ON

Does the Defer statement correctly delay the skimmer from starting up after the Tarpon outlet goes back to ON? Or do I need to take the Set ON out and allow the commands themselves to turn ON the outlet? Or do I need to put a command in like 'If Outlet Tarpon = ON Then ON' so that the Defer command can properly pair up?

Or is there some way that I should be using the DELAY command on this?

I appreciate your insight into this.

--AJ
 
Yes, you can use the Defer to cause a startup delay. No, the Defer command will not cause a change of state on it own, it requires another command. Also, keep in mind that Defer applies to the whole outlet, not individual statements. So if you also use the If Power... wit a delay, then it will be additive.

Seems your If Power state is backwards though, don't you want to keep the skimmer OFF? You may also want to change Fallback to OFF if it is more critical to keep the skimmer from overflowing when there is a loss of communication.

[Skimmer]
Fallback OFF
Set ON
If Power EB8_DnStr OFF 000 Then OFF
If Outlet Tarpon = OFF Then OFF
Defer 003:00 Then ON

The above will set the state of the skimmer outlet to OFF whenever EB8_DnStr is without power or Outlet Tarpon is OFF. Then, when it attempts to change to ON, the Defer will delay it by three minutes.

Todd
 
I replaced my programming with the programming you put on your post and it works wonderfully. Thanks for your help!

--AJ
 
Back
Top