• Welcome back Guest!

    MARSH is a private reefing group. Comments and suggestions are encouraged, but please keep them positive and constructive. Negative threads, posts, or attacks will be removed from view and reviewed by the staff. Continually disruptive, argumentative, or flagrant rule breakers may be suspended or banned.

Apex code question (1 Viewer)

Users who are viewing this thread

TriggerFan

Guest
Joined
Apr 14, 2019
Messages
584
Reaction score
401
Location
Cypress
So, I was playing tonight making sure that the return pumps, powerheads, ato, skimmer turn off when using FeedA
Thanks to SteveB / Gregg I added the following under each of these equipment's advanced tab:

If FeedA 000 Then OFF
Defer 020:00 Then ON

My question is: If I use "If FeedA 020 Then OFF" wouldn't it achieve the same?
Why the need of using Defer?
 
OP
OP
TriggerFan

TriggerFan

Guest
Joined
Apr 14, 2019
Messages
584
Reaction score
401
Location
Cypress
Steve:

I tried this and it worked exactly the same as if I set up defer, hence my original question if this "method" is also correct.

Return Pumps - If FeedA 020 Then OFF
PowerHeads - If FeedA 021 Then OFF
Skimmer - If FeedA 025 Then OFF
ATO - If FeedA 030 Then OFF
 

steveb

Staff member
Administrator
Moderator
Board Member
Build Thread Contributor
Joined
Jun 24, 2009
Messages
11,953
Reaction score
2,856
Location
Spring
Steve:

I tried this and it worked exactly the same as if I set up defer, hence my original question if this "method" is also correct.

Return Pumps - If FeedA 020 Then OFF
PowerHeads - If FeedA 021 Then OFF
Skimmer - If FeedA 025 Then OFF
ATO - If FeedA 030 Then OFF


No. "If FeedA ### Then On/Off" only works if FeedA is true/active.

What if you lose power? When power returns your sump is full of water. Without defer on your skimmer it will start at the same time as your return pump (filling and possibly overflowing the skimmer cup).
 
OP
OP
TriggerFan

TriggerFan

Guest
Joined
Apr 14, 2019
Messages
584
Reaction score
401
Location
Cypress
Ahhh now I got..... So defer will work for both feed and no power, hence it is best/safer to use If FeedA 000 and just add the delay in the defer instead?
Or is it best to use to achieve :

If FeedA 020 Then OFF
Defer 005 Then On
 

steveb

Staff member
Administrator
Moderator
Board Member
Build Thread Contributor
Joined
Jun 24, 2009
Messages
11,953
Reaction score
2,856
Location
Spring
Ahhh now I got..... So defer will work for both feed and no power, hence it is best/safer to use If FeedA 000 instead?

You can use them both.

Use FeedA for feeding and have it do whatever you want on/off for some period of time.

Use defer to prevent the skimmer from starting when power is restored.

Here is my skimmer program. Not using Feed modes at the moment.

Fallback ON
Set ON
If Output ReturnPump = OFF Then OFF
Defer 010:00 Then ON
 

steveb

Staff member
Administrator
Moderator
Board Member
Build Thread Contributor
Joined
Jun 24, 2009
Messages
11,953
Reaction score
2,856
Location
Spring
Sorry I just clued in to what your asking. When FeedA is active you want your return pump and skimmer to be off. for feedA 000 means only be off while feedA is active. You will want to put some number in for the skimmer say 010 to allow an additional 10 minutes after feedA expires to allow the return pump time to bring the water level down.
 
OP
OP
TriggerFan

TriggerFan

Guest
Joined
Apr 14, 2019
Messages
584
Reaction score
401
Location
Cypress
Yup, you got it. I ended up with this for the skimmer. Need to test it later:

Fallback OFF
Set OFF
If Time 22:00 to 08:00 Then ON
If Power Apex Off 001 Then OFF
Defer 010:00 Then ON
If FeedA 020 Then OFF
Defer 020:00 Then ON
If Output Return_L_5_1 = OFF Then OFF
If Output Return_R_5_2 = OFF Then OFF
Defer 010:00 Then ON
 

steveb

Staff member
Administrator
Moderator
Board Member
Build Thread Contributor
Joined
Jun 24, 2009
Messages
11,953
Reaction score
2,856
Location
Spring
Sorry I just clued in to what your asking. When FeedA is active you want your return pump and skimmer to be off. for feedA 000 means only be off while feedA is active. You will want to put some number in for the skimmer say 010 to allow an additional 10 minutes after feedA expires to allow the return pump time to bring the water level down.
Yup, you got it. I ended up with this for the skimmer. Need to test it later:

Fallback OFF
Set OFF
If Time 22:00 to 08:00 Then ON
If Power Apex Off 001 Then OFF
Defer 010:00 Then ON
If FeedA 020 Then OFF
Defer 020:00 Then ON
If Output Return_L_5_1 = OFF Then OFF
If Output Return_R_5_2 = OFF Then OFF
Defer 010:00 Then ON

Its allowing two defer statement? I didn't think that was possible without it being assigned to virtual outlet.
 
OP
OP
TriggerFan

TriggerFan

Guest
Joined
Apr 14, 2019
Messages
584
Reaction score
401
Location
Cypress
Actually three defer statements.. There are three IF statements and one defer for each one of them.
 
Top