• 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 WHEN Statement (1 Viewer)

Users who are viewing this thread

Tenny

Supporting Member
Build Thread Contributor
Joined
Jul 18, 2018
Messages
755
Reaction score
588
Location
League City
So I wanted to share this info for people. I had no idea there was a "WHEN" statement, and it is awesome!! Basically the statement will monitor how long something is "ON" and can turn it off (or the reverse).

I needed this recently because I got a new ATO Pump (PMUP V2) and it states not to run it dry. I've run it semi-dry a few times now after forgetting to fill the ATO reservoir. So I was thinking to myself there should be something like a max on time or something... and after a google search I found the "WHEN" Statement.

Official WHEN Statement Documentation

My ATO statement / Explanation
Code:
Fallback OFF <- So it stays OFF
Set OFF <-- Sets initial statement to OFF
If Sw1 CLOSED Then ON <-- Water level switch
If Sw2 CLOSED Then OFF <-- Water level switch
If Sw3 OPEN Then OFF <-- Water level switch
If pH > 8.40 Then OFF <-- My ATO also doses kalk, so this ensures it doesn't send too much there. 
When On > 001:00 Then OFF <-- ATO can only run for 1 minute before it forces it to turn off.
Defer 005:00 Then ON <-- Waits five minute for a switch's to reach right before it turns on. 
Min Time 060:00 Then OFF <-- Won't run again for 60 minutes after it runs.

My ATO really only takes about 10 seconds or so to flip the switch with the 60 minute min time.


Maybe everyone already knew about this, but I didn't and wanted to share it.
 

gregg

President
Staff member
Administrator
Moderator
Board Member
Supporting Member
Build Thread Contributor
Joined
Jan 28, 2015
Messages
6,798
Reaction score
2,812
Location
Downtown
Why not use “if sw3 is open then off” ? Assuming sw3 is in your ato tank?
 

SCUBAFreaky

Enjoy Life!
Supporting Member
Build Thread Contributor
Joined
Apr 14, 2020
Messages
298
Reaction score
355
Location
Seabrook
im confused ... how is "when" any different than "if"
As far as I can tell, "When" changes the state of your outlet from AUTO to Manual OFF instead of just AUTO OFF. Once in Manual OFF you have to put it back into AUTO or ON for the outlet to turn on again. Using the IF statement would just put the outlet in AUTO OFF thus allowing the outlet to turn on again based on your logic criteria. By going to Manual OFF using the "When" command for something like an ATO being low on water, the pump will not come back on unless the user directly changes the state of the outlet.
 
Last edited:
OP
OP
Tenny

Tenny

Supporting Member
Build Thread Contributor
Joined
Jul 18, 2018
Messages
755
Reaction score
588
Location
League City
Do you have a sensor in your ato tank?
Nope.

In most situations this scenario is this could be solved with another sensor in the ATO.

Although yesterday it actually failed and the sensor wouldn't have tripped. The hose / line came out of the PMUP v2 so it was just spraying water everywhere inside the ATO (and a small amount on the outside). When APEX realized it had been on for a minute and it had not tripped the water level mark in the sump like it should have... it turned it to manual off (and my email code has it to email me). So I got a push notification on my phone saying there was an error and I got an email.
 

steveb

Staff member
Administrator
Moderator
Board Member
Build Thread Contributor
Joined
Jun 24, 2009
Messages
11,953
Reaction score
2,856
Location
Spring
None here either mine a 75g tank in the fish room. I would have to install a 2nd FMM or a BoB(but cabling is an issue) for the fishroom.

@gregg are you using one in yours? Is it large poly tank?
 
Last edited:
Top