Buttons for Apex feed mode?

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,266
Location
Minneapolis, MN
Rating - 0%
0   0   0
To do a water change, I have Feed Mode C on my Apex set to turn everything off allowing several gallons of tear to siphon down to the sump. After the water change I use Feed Mode D to ramp up the return pump slowly so I don't get as much splashing while the display fills back up.

I'd like to do this using buttons connected to my breakout box. I have a some momentary buttons on the front of my cabinets. Since Apex doesn't allow feed modes to be triggered by anything else I programmed a virtual outlet as such:

Outlet vFeedC
Set OFF
If Btn1 CLOSED Then ON
Defer 030:00 Then OFF

My return pump then has the following line:

If Output vFeedC = ON Then 0

So far, so good. The problem is how to get it to cancel when I use Feed Mode D (or another button.) The 'Defer...Then OFF' statement works well to 'latch' the virtual outlet on with he momentary button, but there's no way to deactivate it without digging through the outlets and turning the outlet off manually.

What I'd like is for the virtual outlet to remain on until another event triggers it to cancel. is that possible?
 
OP
OP
Sleepydoc

Sleepydoc

Valuable Member
View Badges
Joined
Apr 10, 2017
Messages
1,423
Reaction score
1,266
Location
Minneapolis, MN
Rating - 0%
0   0   0
Ok - I think I figured it out. In case anyone stumbles across it here is the code I used:

Virtual Outlet vFeedC
if Button CLOSED Then ON
If Output vLatch = OFF Then OFF
If Output vDbl_Press = ON Then OFF

Virtual Outlet vLatch
If Button Closed then ON
if Button Open then OFF
Defer 020:00 then off

Virtual Outlet vDbl_Press
Set Off
If Output vLatch = ON then ON
If Button Open then OFF
Min Time 010:00 then ON
Defer 000:05 then ON

Explanation:
  • Note that the vFeedC and vLatch outlets have no 'set' statements, so they will remain in their current state unless a statement actively changes it.
  • The vFeedC outlet is turned on by the button. It will then stay on until either the vLatch outlet turns off or the vDbl_Press outlet turns on.
  • The vLatch outlet turns on when the button is pressed and then turns off when the button has been released for 20 min via the Defer statement.
    • If nothing else happens, these two outlets will function to turn the vFeedC outlet on when the button is pressed, then turn it off 20 min later.
  • The vDbl_Press outlet essentially functions like an 'and' statement - it turns on if vLatch is on and the button is not open. The 'Defer 000:05' statement keeps it from turning on unless the button is pressed for 5 seconds (and keeps it from turning on when I press the button the first time.) I could have added another virtual outlet to eliminate the need for this but this seemed simpler to me.
    • the 'Min Time 010:00' statement keeps it on for 10 minutes so I can set my return pump to ramp up while it's on.
  • Once vDbl_Press is on, vFeedC will then turn off
  • The vLatch outlet will continue to stay on for another 20 minutes but at this point it doesn't really trigger anything

This is a good example of how convoluted yet relatively powerful the apex programming language can be. It has relatively few statements and is limited by them but by leveraging virtual outlets you can actually make it do quite a bit.
 

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: 20 29.0%
  • I occasionally change the food that I feed to the tank.

    Votes: 25 36.2%
  • I rarely change the food that I feed to the tank.

    Votes: 19 27.5%
  • I never change the food that I feed to the tank.

    Votes: 4 5.8%
  • Other.

    Votes: 1 1.4%
Back
Top