Push button for feed mode.

Ignore this line. Seems to be working now. With the code only one return pump is working right in "alloff"? Got the same code on both.
 
I figured out one of my problems, I wasn't holding the momentary switch in long enough! Now it's working like it should!
I do have one question, Should Sw2 be highlighted in white? Would this mean the switch is bad or not reading?

I changed the coding some.

"Alloff" (virtual) is for an emergency off of pumps and skimmer

Set ON
If Sw1 CLOSED Then OFF
If Sw1 OPEN Then ON
If Sw6 CLOSED Then OFF
If Sw6 OPEN Then ON

"Feedmode" (virtual) for feeding

Set OFF
If Sw3 CLOSED Then ON
Defer 010:00 Then OFF

My return pumps outlet

Fallback ON
Set ON
If Sw1 CLOSED Then OFF
If Sw1 OPEN Then ON
If Sw6 CLOSED Then OFF
If Sw6 OPEN Then ON
If Sw3 CLOSED Then OFF
Defer 010:00 Then ON

Skimmer outlet

Fallback ON
Set ON
If Sw1 CLOSED Then OFF
If Sw1 OPEN Then ON
If Sw6 CLOSED Then OFF
If Sw6 OPEN Then ON
If Sw3 CLOSED Then OFF
Defer 012:00 Then ON

With the code only one return pump is working right in "alloff"? Got the same code on both.
Couple of things you can do to simplify :

"Alloff" (virtual) is for an emergency off of pumps and skimmer

Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF

-------------------------------------------------------------------------
How the outlets and program work ..
Think of "Alloff" (virtual output) as a memory register that the code runs through sequentially every second in a continuous loop.
So,
1. Set ON <-- this sets the value of the register to ON
2. If Sw1 CLOSED Then OFF <-- if true (i.e. Sw1 is CLOSED), this overwrites the value of the register to OFF
3. If Sw6 CLOSED Then OFF <-- this again, if true (i.e. Sw6 is CLOSED), overwrites the value of the register to OFF

So, in essence, the Alloff virtual output will be ON by default (Sw1 AND Sw6 are OPEN), and if EITHER Sw1 OR Sw6 are closed (or both), Alloff will have a value of OFF.

A good practice exercise is to try to make AllOff behave like an AND condition i.e. both Sw1 AND Sw6 have to be closed for AllOff to have a value of OFF.

To understand your design/intent, can you tell me what you are using Sw1, Sw3 & Sw6 for ?
 
So, got the feed mode working. :) Got the all off working on Sw6. :) Now to troubleshoot the toggle switch.
Issue is here -
Set ON
If Sw1 CLOSED Then OFF
If Sw1 OPEN Then ON
If Sw6 CLOSED Then OFF
If Sw6 OPEN Then ON

In this logic, if SW1 is CLOSED but SW6 is OPEN, the virtual output will be ON. In effect, SW6 overrides Sw1 always so, sw1 will not appear to do anything.
The solution is to simplify to :
Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF
Then if either SW1 or SW6 are closed, the virtual output will be set to OFF.
 
Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF

I'll try that. Does it not need a "ON"?

Is this what you mean on the last line for the momentary switch #3 (last line)

Fallback ON
Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF
If Sw3 CLOSED Then OFF
Defer 010:00 Then ON
 
Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF

I'll try that. Does it not need a "ON"?
No. The Set ON in the first line defaults it to ON.
The subsequent lines will only change the state to OFF if the condition is true, in effect if either Sw1 OR Sw6 are closed.

If you want the behavior as an AND condition i.e. turn the state to OFF if both Sw1 AND Sw6 are closed, the following code would be used :

SET OFF
If Sw1 OPEN Then ON
If Sw6 OPEN Then ON

Also, this is one of the most confusing aspects of neptune programming. Once you get your arms around this, you will be able to do some amazing things ..
The trick actually, is to think linearly i.e. one line at a time sequentially (the neptune apex programming is actually quite dumb ;-) ).
 
Last edited:
I don't need Sw6. So if I delete it, can I use this code?

Fallback ON
Set ON
If SW1 CLOSED Then OFF
If SW1 OPEN Then ON
If Sw3 CLOSED Then OFF
Defer 010:00 Then ON

Or would the last line mess up my code?
 
I may be thinking about this wrong. Do I need to put all the virtual switches in each of the outlets I'm trying to control?
 
Is this what you mean on the last line for the momentary switch #3 (last line)

Fallback ON
Set ON
If Sw1 CLOSED Then OFF
If Sw6 CLOSED Then OFF
If Sw3 CLOSED Then OFF
Defer 010:00 Then ON
Unsure what you are trying to do with Switch #3, specifically the DEFER statement .. are you trying to make the OFF state "sticky" for 10 min ?

Defer 1:00 Then ON
Translated: Defer the ON state for 1 minute. (OFF would be immediate).

Min Time 5:00 Then OFF
Translated: Minimum Time of 5 minutes in the OFF state. (ON would be immediate)

There's more information on both of these statements in the Reference Manual.
 
I may be thinking about this wrong. Do I need to put all the virtual switches in each of the outlets I'm trying to control?
I wasn't able to understand what you were doing with SW1, SW3 & SW6 - can you explain what you want each of the switches to do ? Also, am assuming SW1 & 6 are toggle, SW2/3/4/5 are momentary push-button (I suspect you have the same switchbox I have).
 
OK I see. So The defer adds time before it comes back on, even on Sw1.

Thanks for your help. I'm going to re-read some stuff. Then try again.
I can tell you from experience, it is well worth the effort you are putting in to get the hang of this ..
 
Yes Sw1, and Sw6 are toggles. @-5 are momentary push switches.
I am trying to do an all cut off in case of leak in tank. (Toggle switch)
then adding a button on the front of my tank to put it in feed mode. (push button momentary switch)
 
I am trying to do an all cut off in case of leak in tank. (Toggle switch)
This should be simple (Toggle switch) -
In each of your outlets (pump, skimmer etc.), just add the following line at the end (to ensure it isnt overridden by subsequent programming lines)
....
If Sw6 CLOSED Then OFF

This should turn off the outlet (pump, skimmer etc.) if Sw6 is closed.

------------------------------------------------------------------------------------------

For FeedMode using a momentary switch, the original code I posted will work (uses a virtual outlet that allows you to create the behavior of a "sticky" pushbutton).

If you want to use a toggle switch (say Sw1) for FeedMode, then you can simplify and don't need the virtual outlet. So, in your pump, skimmer etc., just add :
...
If Sw1 CLOSED Then OFF
...

This will turn off the outlet (pump, skimmer etc.) if Sw1 is CLOSED.
 
The way I have set mine up (and there are many folks who have done much more sophesticated stuff) ..
- Emergency stop toggle switch (just like yours .. turns off pumps, skimmers etc.)
- FeedMode push button that stops the pumps/skimmer and sets the Ecotech MP40s to a feed profile for 3 mins as well as triggers the Neptune AFS
- 3 times a day automated feed (Neptune AFS)
- Lighting is controlled ramp up / down based on sunrise/sunset. Also, moon. Am using the Ecotech Radions but controlling it in the Neptune Apex (vs Mobius)
- In-tank circulation pumps have different profiles during the morning/afternoon/night (EcoTech MP40s) .. have not figured out tidal schedule yet.

The more advanced stuff is around adding "failsafes" using water level sensors, probes etc.
Eg. heater is plugged into an outlet so there is a double level of safety (built in thermostat within the heater as well as the Neptune Apex temp controlled outlet). The Neptune Apex temp controlled outlet also gives me a finer control of temp of the tank (+/- 0.1 degrees) vs. the heater thermostat is only +/- 1 degree.

Just ideas of what all you can do ..
 
Gotcha. I will see how much I can learn. I found a couple of videos on YouTube that were helpful too.

I bought my first breakout box on eBay and the connecting cable was way too short. So I ended up buying one off Adaptive Reef. It worked out great under my tank. I want to order another IO port so I can use the short one in my fish room. The question is will the second one work on the same system, and the Sw1 on it control the same pumps?
 
Back
Top