When statement

Users Who Are Viewing This Thread (Total: 1, Members: 0, Guests: 1)

techdef

Active Member
View Badges
Joined
May 28, 2020
Messages
161
Reaction score
140
Rating - 0%
0   0   0
Does When only work with times? Why not as a direct replacement option for If?
I’d like to use When Res_Lo to shut off pumps until I refill and remix salt in my AWC system.
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,226
Location
Oregon
Rating - 0%
0   0   0
When uses a countdown timer once an output turns Off or ON, and if it remains in that state for longer than the timer then the output slider is moved from the AUTO state to either Off or ON, depending on the programming. Once the slider is moved, the programming for that output no longer is processed, so it's up to you to correct the situation and move the slider back to AUTO for the program to resume.

The syntax is:

When [ON/OFF] > MMM:SS Then [ON/OFF]

Once the timer has elapsed, the output is also set into an error state and can send an alarm notification with this programming in your EmailAlm programming:

If Error OutputName Then ON

See this FAQ for more details about When: https://forum.neptunesystems.com/showthread.php?18393-Using-the-%91When%92-statement

Also see my tutorial on Apex Timers for details on When and all the other Apex timer commands: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/
 
OP
OP
T

techdef

Active Member
View Badges
Joined
May 28, 2020
Messages
161
Reaction score
140
Rating - 0%
0   0   0
Is res_lo a float switch?

If so, you can just add the following code to the pump/outlet you want off:

If res_lo closed then off
That’s the current code. I’d very much like When instead of If. The issue is if I refill the SW container with RO the float returns to Closed, but I haven’t mixed in salt yet. I want When so that I have to manually set it back to On
 
OP
OP
T

techdef

Active Member
View Badges
Joined
May 28, 2020
Messages
161
Reaction score
140
Rating - 0%
0   0   0
When uses a countdown timer once an output turns Off or ON, and if it remains in that state for longer than the timer then the output slider is moved from the AUTO state to either Off or ON, depending on the programming. Once the slider is moved, the programming for that output no longer is processed, so it's up to you to correct the situation and move the slider back to AUTO for the program to resume.

The syntax is:

When [ON/OFF] > MMM:SS Then [ON/OFF]

Once the timer has elapsed, the output is also set into an error state and can send an alarm notification with this programming in your EmailAlm programming:

If Error OutputName Then ON

See this FAQ for more details about When: https://forum.neptunesystems.com/showthread.php?18393-Using-the-%91When%92-statement

Also see my tutorial on Apex Timers for details on When and all the other Apex timer commands: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/
Yes, I’ve seen and read all of them, a sincere public service! Would you recommend a separate VO to concert a Switch to something that could trigger a When statement?
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,226
Location
Oregon
Rating - 0%
0   0   0
Yes, I’ve seen and read all of them, a sincere public service! Would you recommend a separate VO to concert a Switch to something that could trigger a When statement?

I don't think a virtual output is necessary. If I understand your original question correctly, you just want the AWC pumps manually turned off if Res_Lo is OPEN until you have a chance to mix some new saltwater, then turn it back to AUTO once ready with a new batch of saltwater. You can use this code on the AWC pumps:

If Res_Lo OPEN the OFF
When Off > 001:00 Then OFF

Once the Res_Lo sensor is OPEN because it doesn't detect any water, it turns off the AWC pumps, and after one full minute of this condition the When timer forces the output slider into the manual OFF position. At this point, you can refill the mixing tank, and even though the Res_Lo switch will report CLOSED, the AWC pumps will not run until you have mixed the salt and then you set the AWC pump output sliders back to AUTO.

I'm not sure if you're using a DOS or other pumps for the AWC. Regardless, you'll want the code above on both the AWC drain pump and the AWC fill pump so both of them are disabled until it's safe to resume the water changes.

I hope that makes sense to you.
 
OP
OP
T

techdef

Active Member
View Badges
Joined
May 28, 2020
Messages
161
Reaction score
140
Rating - 0%
0   0   0
I don't think a virtual output is necessary. If I understand your original question correctly, you just want the AWC pumps manually turned off if Res_Lo is OPEN until you have a chance to mix some new saltwater, then turn it back to AUTO once ready with a new batch of saltwater. You can use this code on the AWC pumps:

If Res_Lo OPEN the OFF
When Off > 001:00 Then OFF

Once the Res_Lo sensor is OPEN because it doesn't detect any water, it turns off the AWC pumps, and after one full minute of this condition the When timer forces the output slider into the manual OFF position. At this point, you can refill the mixing tank, and even though the Res_Lo switch will report CLOSED, the AWC pumps will not run until you have mixed the salt and then you set the AWC pump output sliders back to AUTO.

I'm not sure if you're using a DOS or other pumps for the AWC. Regardless, you'll want the code above on both the AWC drain pump and the AWC fill pump so both of them are disabled until it's safe to resume the water changes.

I hope that makes sense to you.
Indeed it does. Nailed it thank you.
 
OP
OP
T

techdef

Active Member
View Badges
Joined
May 28, 2020
Messages
161
Reaction score
140
Rating - 0%
0   0   0
Also keeping in mind that if your awc pump(s) has any other OFF statements, the WHEN statement will toggle from AUTO to OFF as well.
Ah, a good reminder. Some would be nice if they weren’t that way, but my mistake leaving this off is better than the opposite!

426E7BDF-A93A-4AD6-8471-BB747DAB0EAD.jpeg
 

When to mix up fish meal: When was the last time you tried a different brand of food for your reef?

  • I regularly change the food that I feed to the tank.

    Votes: 44 21.2%
  • I occasionally change the food that I feed to the tank.

    Votes: 72 34.6%
  • I rarely change the food that I feed to the tank.

    Votes: 69 33.2%
  • I never change the food that I feed to the tank.

    Votes: 19 9.1%
  • Other.

    Votes: 4 1.9%

New Posts

Back
Top