Jump to content

SuncrestReef's Week of Apex Programming


SuncrestReef

Recommended Posts

I'm working on a series of Apex programming tutorials.  Starting this Monday, I'll be posting one tutorial per day on the following topics:

After this series, if there are any specific topics you'd like covered, let me know.

Edited by SuncrestReef
  • Like 9
  • Thanks 5
Link to comment
Share on other sites

Preface

I first learned of the Neptune Apex in January 2018 while I was researching how to set up an aquarium.  I was a complete novice to reefing and aquariums in general.  However, with my 30+ year career in IT systems and my love of all things automation, I realized I could leverage my technical background and the Apex to automate most functions on the aquarium.

When I received my Apex, I quickly discovered it was a bit different than other automation devices I have used.  The included documentation was minimal, Neptune’s online documentation was a bit scattered and disjointed, and the programming language was different than all the widely used standards I was familiar with.  I stumbled my way through the basic setup and learned a lot about advanced programming through trial and error while my tank was still cycling.  Once I discovered the official Neptune Community Forums I found several examples of programming that helped me achieve what I wanted to build.

Over the past year I’ve become much more comfortable and proficient in Apex programming, and I've become a frequent contributor on the Neptune Community Forums and Neptune’s Apex Community Facebook group where I do my best to help answer questions posted by other confused users.  From my observations of these forums the most common problems are with the ATK, timers, feed mode, and alerts.

I decided to write some tutorials which will hopefully fill in the blanks that Neptune’s documentation doesn’t fully spell out.  All of the information I’ll provide is already publicly available, but hopefully the way I’ll present it will explain things more clearly and in a single location.

I’d like to thank Zombie and RussM, two of the most frequent contributors on the Neptune Community Forums.  Most of the things I've learned were due to their replies to others or directly to my questions.

Here are some invaluable resources for Apex programming:

Edited by SuncrestReef
  • Like 5
Link to comment
Share on other sites

This is very kind of you to take the time to write all these out. This is what the PNWMAS is all about. Creating an ocean in your living room and keeping it alive for years to come is a complex task and it takes a community with different skills to come together to support each other. 

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Introduction

Before I get into specific tutorials, I’d like to explain the basics of Apex programming.  An Apex system consists of Modules, Inputs, Outputs, and Profiles:

  • Modules:  The Apex base unit, Energy Bars, and a variety of add-on modules.  Modules are physically connected to the Apex or each other by AquaBus or 1Link cables. Each module is automatically assigned an AquaBus address, from 1 to 49.
  • Inputs:  Temperature probes, pH probes, ORP probes, Conductivity (Salinity) probes, optical water level sensors, leak sensors, flow sensors, PAR sensors, Energy Bar watts and amps, Trident measurement readings.  All Inputs are connected to ports on the Apex or add-on modules.
  • Outputs: 120v (or 240v international) outlets, 24v DC outlets, 0-10v variable outputs, DOS pumps, WAVs, COR pumps, lights, auto feeders, virtual outputs.  Outputs exist on the Apex base unit, Energy Bars, and add-on modules.
  • Profiles: Pump profiles, dose profiles, lighting profiles, WAV profiles, ramp profiles, weather profiles.  Profiles are used to apply pre-defined settings to an Output.

All programming is applied exclusively to Outputs.  The programming can be based on values of Inputs, on the state of Outputs, or can apply settings defined by Profiles.

The Apex evaluates each Output programming once per second, so when a condition changes it should react to that change within 2 seconds.  It reads the list of program statements for each Output from top to bottom, and determines the state of the Output based on the last line of programming that evaluates as True.  For example, if a heater has the following programming, and the water temperature is 77.9 F, here’s how the Apex will decide what to do:

If Tmp < 78.0 Then ON
If Tmp > 78.2 Then OFF
  • The first line evaluates True since the temperature is less than 78.0.
  • The second line evaluates False since the temperature is not greater than 78.2.

In this example, the Apex turns on the heater output because the last line that evaluated as True was the first line.

However, in this next example the water temperature is still 77.9 F, but there is an additional condition to be evaluated:

If Tmp < 78.0 Then ON
If Tmp > 78.2 Then OFF
If Output Maintenance = ON Then OFF

In this example, we have a virtual output named Maintenance that we turned on while performing routine maintenance on the tank.  This could include water changes, cleaning out the sump, making plumbing repairs, or anything where you might not want the heater to come on since it may not be submerged in water.

  • The first line evaluates True since the temperature is less than 78.0.
  • The second line evaluates False since the temperature is not greater than 78.2.
  • The third line evaluates to True because we turned on the Maintenance output.

In this example, the heater is turned off.  The last line in the programming that evaluates as True will decide the state of the output.  The state of an output is not changed until all lines of programming are evaluated.

Once we turn off the Maintenance output, the Apex will turn the heater on because only the first condition is True.  Again, it evaluates the programming once per second.

In general, it’s always best to list the conditions that would turn ON and output first, then one by one list conditions that might turn it off.

You can rename each module, input, output, and profile.  Using meaningful names will make programming and troubleshooting much easier, so I highly recommend renaming each component as the first step before you do any programming.  However, if you decide to rename a component later, any existing programming will be automatically updated to reflect the new name.

For example, I have 3 FMM modules, so I named each one based on its function:

  • FMM_LEAK = leak detectors
  • FMM_FLOW = flow monitors
  • FMM_ ATO = auto top off

This becomes even more useful if you are monitoring multiple aquariums or frag tanks with a single Apex and multiple modules and probes:

  • Tmp200 = temperature probe in your 200 gallon tank
  • TmpFrg = temperature probe in your frag tank
  • TmpMix = temperature probe in your mixing station

(unfortunately Inputs are limited to 6 characters in the name)

Inputs and Outputs can be displayed on the Apex or Fusion dashboard as “tiles”.  Inputs display as a read-only item, meaning you cannot change its value.  It only shows what the sensor or probe is measuring:

Screen Shot 2019-06-02 at 9.06.22 PM.png

Outputs can be manually turned ON or OFF, or can be set to AUTO.  If you manually set an output to ON or OFF, it will remain in that state until you manually change it.  The output programming is only active when the output is set to AUTO, and the state of the output will be displayed above the tile:

Screen Shot 2019-06-02 at 9.06.38 PM.png

This brief introduction only touches on the main points of Apex programming.  For complete details including how to initially set up the Apex, modules, and configuring Fusion, see Neptune’s official documentation:  https://www.neptunesystems.com/support/docs/

Each day this week I will post detailed tutorials on specific Apex programming topics, which I promise will be more entertaining than this dry introductory topic.

Stay tuned.

Edited by SuncrestReef
  • Like 5
Link to comment
Share on other sites

Today's topic --  Timers:  OSC, If Time, DOW, Defer, When, and Min Time

One of the most common tasks in reefing is to turn on and off a device on a specific schedule, whether that’s based on time of day, a repeating cycle of a number of minutes or hours, or on specific days of the week.  The Apex gives you a number of choices on how to program outputs based on timers, each with a specific purpose:

  • OSC:  A repeating On/Off interval, where you specify the number of minutes & seconds to be ON, and the number of minutes and seconds to be OFF
  • If Time:  Turn on or off between specific times on the clock, down to the minute
  • DOW:  Turn on or off based on the day of week
  • Defer: A delay of time in minutes and seconds to wait before turning on or off
  • When:  A failsafe to switch an output from AUTO to OFF if it has been on or off for longer than specified in minutes and seconds.  Requires manual intervention to reactivate the automatic programming.
  • Min Time:  A delay of minutes and seconds before the output is allowed to turn on or off, regardless of the programming conditions

Some of these timers can be combined to achieve unique requirements, such as to turn on a pump every day from noon until 1pm, except for Saturday and Sunday.  Let’s look at examples for each of these timers:

OSC

The OSC (short for Oscillation) command is great for turning things on and off in a repeating cycle.  It uses three separate timers:

OSC MMM:SS/MMM:SS/MMM:SS Then [ON/OFF/Profile]

The timers define Delay before first run / Time to run / Delay until next run

The maximum value you can specify for any one of the timers is 999:99, which equates to 16 hours, 39 minutes, 59 seconds.

Here are a few examples:

OSC 000:00/005:00/005:00 Then ON

This would turn on the output for 5 minutes, then turn it off for 5 minutes, and repeat indefinitely:
Screen Shot 2019-06-03 at 9.52.04 AM.png

OSC 000:00/007:00/002:00 Then ON

This would turn on the output for 7 minutes, then turn it off for 2 minutes, and repeat indefinitely:
Screen Shot 2019-06-03 at 9.54.04 AM.png

OSC 007:00/002:00/000:00 Then ON

This would wait for 7 minutes, then turn on the output for 2 minutes, then turn it off for 0 minutes. It would then repeat the 7 minute off, 2 minute on cycle.

Screen Shot 2019-06-14 at 8.48.15 PM.png

One reason to use the initial delay would be to stagger two different outputs so they don’t run at the exact same time, such as dosing pumps.

The odd thing about the initial delay timer is that it calculates from midnight of January 1, 1996. If your timer values added together are evenly divisible into 1440 (24 hours), then your output will always come on at the same times each day. If they are not divisible into 1440, then each day will be slightly different, and you’d have to do some interesting math to figure out when it would turn on on any given day.

My personal example:

I use the OSC command to activate my Swabbie skimmer neck cleaner every six hours.  The Swabbie has a motor that rotates the cleaning wiper in the skimmer neck very slowly, so it needs to run for about 2 minutes to thoroughly wipe all the crud from the neck.  Here is the programming for my Swabbie output:

Fallback OFF
OSC 000:00/002:00/358:00 Then ON
If Output EB_3_Skimmer = OFF Then OFF

The first line — Fallback OFF — instructs the Apex to turn off this output if the Apex ever gets disconnected from the Energy Bar where the Swabbie is plugged in.  This could also apply if the Apex locks up and becomes unresponsive (which rarely happens).  This just basically means don’t run the program if the Apex unit isn’t in control of the situation.

The OSC  timers in this example are:

  • 000:00 = zero minutes from midnight until the first run
  • 002:00 = two minutes of actual run time
  • 358:00 = 5 hours & 58 minutes to delay until the next run

The third line disables the Swabbie from running if my skimmer is off.  This would prevent it from rotating accidentally if I’m performing maintenance on the skimmer or if it’s off during a feed mode.

Since my timers multiplied by 4 = 1440, my OSC timers trigger the Swabbie at the same times each day:  Midnight, 6am, noon, 6pm.

 

If Time

If Time is used to turn on or turn off an output between a range of time:

If Time HH:MM to HH:MM Then [ON/OFF/Profile]

The If Time command is much simpler than OSC, but it does have a few intricacies to be aware of:

The times can only be specified in hours and minutes (in 24 hour format), so it is not as granular as the OSC command which goes down to minutes and seconds.  A very important thing to know is that the beginning time and ending times are inclusive.  For example:

Set OFF
If Time 10:00 to 10:01 Then ON

will turn on the output at 10:00 and turn it off at 10:02: 
Screen Shot 2019-06-03 at 11.41.20 AM.png
This means that the shortest duration you can run an output using If Time is actually two minutes.  You cannot specify the same value for the start and end times,  so 10:00 to 10:00 is invalid.  If you want to use If Time for a shorter duration, it would need to be combined with the Defer statement:

Set OFF
If Time 10:00 to 10:01 Then ON
Defer 001:00 Then ON

This will cause it to wait until 10:01 to turn on, then turn off at 10:02. effectively giving you a 1 minute timer:
Screen Shot 2019-06-03 at 11.41.03 AM.png

I’ll explain Defer in more detail in the next section.

Another tip for If Time is that you can span midnight with your start and end time.  For example, I run my refugium light on the opposite schedule from my display tank lights:

Set OFF
If Time 18:00 to 08:00 Then ON

Screen Shot 2019-06-03 at 11.45.14 AM.png

 

DOW

The DOW (Day Of Week) command can be used to turn on or off and output based on the day of week.

If DOW SMTWTFS Then [ON/OFF/Profile]

The letters for each day of the week are placeholders, and if you substitute one with a hyphen, then that day will evaluate False and the output will not be triggered for that day.  For example:

Set OFF
If DOW SM-W-FS Then ON

This would turn on the output every day except for Tuesday and Thursday
Screen Shot 2019-06-03 at 11.52.14 AM.png

DOW is particularly useful when combined with the If Time command.  Let’s say you want to run a circulation pump once per day for an hour every day except on Saturday when you are doing maintenance:

Set OFF
If Time 12:00 to 12:59 Then ON
If DOW ------S Then OFF

Remember from my introduction section that the last line of programming that evaluates True will dictate what the output does.  In this example, the If Time command is true from 12:00 to 12:59, but the DOW command will evaluate True only on Saturday since that’s the only placeholder not replaced with a hyphen.

 

Defer

Defer is used to delay taking action on an output for a period of time.

Defer MMM:SS Then [ON/OFF]

This command is different than other ON/OFF commands because it’s actually delaying the outlet from changing from off to on, or from on to off, for the specified amount of time.  In the above example using If Time where we need the output to turn on for less than 2 minutes, but If Time can’t do that, so the Defer delay was used to prevent the output from turning on until the 1 minute delay elapsed.

Defer is particularly useful when basing an output on the reading of a probe or sensor.  For example, if you have a float switch in your sump to trigger your ATO pump when the water is low, but the water surface has small ripples that can cause the float switch to go up and down with the water movement, it could trigger your ATO pump on and off rapidly for no valuable reason.  To prevent this, the Defer command can be used to wait for the float switch to provide a consistent reading for a period of time, ensuring that the water really is low enough to justify turning on the ATO pump:

Set OFF
If Float1 Open Then ON
Defer 000:10 Then ON

In this example, the float switch needs to continuously report Open for 10 seconds before the pump will actually be turned on.  Once the float switch first reports Open, the Defer countdown timer begins.  If after 3 seconds the float switch reports Closed, then the timer is reset to 10 seconds.

A good analogy for Defer is the shot clock in NBA basketball.  (sorry to those non-basketball fans reading this).  Once your team has the ball, you have 24 seconds to make a shot.  If the ball doesn’t touch the rim, the ball is turned over to your opponent.  But if you do make a shot that hits the rim but doesn’t go in, the shot clock is reset and you have another 24 seconds to try again.  The Defer is just a countdown timer that once it expires, the output can then change state.

To take our float switch example one step further, I’ll add another Defer to handle the situation when the ATO pump is adding water and the float switch finally reports Closed due to the rising water level.  Since there are still ripples on the water surface, it might toggle between Open and Closed several times before it finally settles in on Closed.

Set OFF
If Float1 Open Then ON
Defer 000:10 Then ON
Defer 000:10 Then OFF

Defer statements can be placed anywhere in the list of programming lines because they apply to the output itself and are not part of what evaluates as True or False.  Another way to represent this is:

Set OFF
If Float1 Open Then ON
— — — — — — — — — — —
Defer 000:10 Then ON
Defer 000:10 Then OFF

(don’t put the dashes into your program….this is just a visualization)

The program is above the dashed line, and the last line to evaluate as True dictates how to set the output state.  The Defer statements are then controlling how long to wait before setting the output state.

 

When

The When command is very unique in Apex programming.  It is used to switch an output’s tile from AUTO to OFF if a condition is met.  It is most commonly used for ATO pump programming, since a failed optical switch or float switch could allow the ATO pump to continue flooding your sump with fresh water, harming your tank inhabitants and flooding your home; or perhaps the ATO reservoir is empty and the pump continues to run dry.  Once triggered, the output is forced into manual OFF mode and the programming will no longer operate until you manually move the slider back to the AUTO position.

Using our ATO pump example from above, here we add the When command.  This assumes that our ATO pump should never need to run for more that 3 minutes straight under normal evaporation conditions.

Set OFF
If Float1 Open Then ON
Defer 000:10 Then ON
Defer 000:10 Then OFF
When ON > 003:00 Then OFF

Like the Defer commands, When may be placed anywhere in the list of programming lines.  I tend to place Defer and When commands at the end for ease of reading and troubleshooting.

 

Min Time

The Min Time command is similar to Defer, but with a distinct difference:

  • Defer - will delay an outlet from changing its state for a specified period of time
  • Min Time - will ensure an outlet stays in its current state for a minimum period of time

In other words, the output must remain in the specified state for the specified period of time, regardless of the conditions listed in the output programming.

Again, the most common example of Min Time is for the ATO pump.  Rather than having it turn on and off every few minutes as dictated by the float switch for the slightest amount of evaporation, you can force it to run less frequently even though that means it needs to pump water a bit longer.

Set OFF
If Float1 Open Then ON
Defer 000:10 Then ON
Defer 000:10 Then OFF
When ON > 003:00 Then OFF
Min Time 060:00 Then OFF

This tells the output to remain Off for at least 60 minutes.  Once that timer expires, the specified programming commands will operate again as normal.

Hopefully this tutorial has been helpful.  Stay tuned for tomorrow's topic -- ATK programming and troubleshooting -- which builds on what I covered today.

 

Edited by SuncrestReef
  • Like 4
Link to comment
Share on other sites

I'll flag this thread to come back to when I need some programming. But I'm sure I could pimp out my programming a bit more on existing items! For my swabbie, I just copied your homework and never looked back! Keep it coming!


Sent from my iPhone using Tapatalk

  • Like 1
Link to comment
Share on other sites

Tuesday's topic -- ATK Programming and Troubleshooting

The ATK (Automatic Top-off Kit) is Neptune’s integrated ATO solution for Apex environments.  It is sold as a bundled package of components that can be plugged in and quickly programmed through a task wizard in Fusion.  However, as I participate in Neptune’s Community Forums and the Neptune Facebook group, I have seen many people reporting problems, frustrations, complaints, and general confusion over the ATK setup or operation.  Other than the lack of Trident availability, it seems to be the 2nd most complained-about product Neptune makes.

I have personally had no problems with my ATK over the past year, though it did take some time to figure it out and discover some tricks to make it more reliable and to customize how I use it.  I hope this tutorial will give you a jump start to skip over the initial problems most people experience.

Here is what’s included with the ATK:
Screen Shot 2019-06-03 at 8.14.06 PM.png

The basic operation of the ATK is to tell the PMUP (Practical Multi-purpose Utility Pump…only Neptune would create an acronym that spelled backwards describes the actual device) when to turn on or turn off based on the water level optical sensor.  As a failsafe, a 2nd optical sensor is mounted just above the first one in case the first one fails.  A float valve acts as another failsafe in case both optical sensors fail, and lastly there is a built-in timer that acts as a final failsafe to turn off the pump if it runs too long.

While Neptune’s documentation walks you through the ATK setup, they don’t really provide a lot of information about the resulting programming created by the Fusion ATK Setup task.  This tutorial will explain each line of code, how to troubleshoot the ATK, and how to modify and enhance the programming for additional features.

Before running the ATK setup, I highly recommend renaming your FMM module and each of the optical sensors (and any other sensors you might add to the remaining two ports on the FMM) so when you run the setup task, the names of modules and sensors presented to you for selection are obvious.

After running the Fusion ATK setup task, the output connected to the PMUP contains this programming:
(the names of your optical switches may not match my example)

Fallback OFF
Set OFF
If ATK_LO OPEN Then ON
If ATK_HI CLOSED Then OFF
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 060:00 Then OFF

Let’s walk through each line:

  • Fallback OFF  — instructs the Apex to turn off this output if the Apex ever gets disconnected from the FMM.  This could also apply if the Apex locks up and becomes unresponsive (which rarely happens).  This just basically means don’t run the program if the Apex unit isn’t in control of the situation.
  • Set OFF  — This sets up the output’s register to default to OFF if no other conditions are met
  • If ATK_LO OPEN Then ON  — ATK_LO is the lower optical sensor plugged into port 1 of the FMM.  This is the primary sensor that should do all the work under normal circumstances.  If the water is lower than this sensor, it will report OPEN so the pump should be turned On.  If the water level is even with the center of the sensor, or if the sensor is completely submerged, it will report CLOSED so this line of code would evaluate as False.
  • If ATK_HI CLOSED Then OFF  — ATK_HI is the upper optical sensor plugged into port 2 of the FMM.  Like the ATK_LO sensor, if will report OPEN if it’s above the water level, and CLOSED if it’s level or submerged in water.  This would turn off the pump if the lower sensor failed to do its job.
  • When On > 005:00 Then OFF  — As described in yesterday’s tutorial, the When command is a failsafe that will move the ATK PMUP outlet sider from AUTO to OFF on the dashboard.  This will prevent the ATK from running again until you manually move the slider back to AUTO.  This typically represents an error condition you should investigate to determine why the pump ran for too long.  This will be discussed in the next section.
  • Defer 000:10 Then ON  — Also described in yesterday’s tutorial, the Defer command causes a delay before turning on the pump until the water level has been detected as continuously low for at least 10 seconds before turning on the pump.  This avoids rapid on/off fluctuations caused by water ripples triggering the optical sensors.
  • Defer 000:04 Then OFF  — Same as above, but wait for 4 seconds once the water level has filled sufficiently before turning off the pump.
  • Min Time 060:00 Then OFF  —  Also described in yesterday’s tutorial, the Min Time command forces the ATK to wait at least 60 minutes before allowing the pump to turn on again.

Here’s an illustration of the ATK when the water level is normal:
Screen Shot 2019-06-03 at 8.39.22 PM.png

As water evaporates, the lower sensor reports OPEN and triggers the pump to turn on.  Once the water level returns to normal, the lower sensor will report CLOSED and the pump should turn off:
Screen Shot 2019-06-03 at 8.39.37 PM.png

If the lower sensor fails for some reason and the water continues to fill up, the upper sensor will report CLOSED.  This should cause the pump to turn off:
Screen Shot 2019-06-04 at 9.27.16 AM.png

If both the lower sensor and the upper sensor both fail, the float valve will pinch the tubing to stop the water flow:
Screen Shot 2019-06-04 at 9.27.28 AM.png

While this should prevent a flood in your house, it will not turn off the pump since this is a simple mechanical valve and does not communicate with the Apex.  In this situation, the pump will continue to run until the When timer expires, then the pump is turned off and the ATK tile itself is changed from AUTO to OFF:
Screen Shot 2019-06-03 at 8.30.27 PM.png

You should also receive an alert from Fusion for this error condition.

 

Troubleshooting

If your ATK isn’t working as expected, here are some basic troubleshooting tips:

  1. Make sure the PMUP output tile is set to AUTO on your dashboard.  It's amazing how many people forget this one basic principle of Apex operation!
    Screen Shot 2019-06-03 at 8.30.06 PM.png
  2. Manually move the PMUP slider to the ON position to confirm the PMUP powers on and pumps water. If it doesn't move any water, verify the 24v power adapter is firmly plugged in to the FMM and that it has power. Also confirm the PMUP is fully submerged in the ATO reservoir, and that the tubing is not kinked or blocked. Remember to move the slider back to the AUTO position before continuing to the next steps.

  3. For testing purposes, delete the Min Time 060:00 Then OFF, or change it to 000:01. This will allow you to perform testing immediately without waiting an hour in between tests. After testing, remember to add that line back to the programming since it’s there as a safeguard.
     
  4. There’s a delay in updates displayed on the Fusion dashboard screen. To see near immediate changes in switch and outlet states, use the http://apex.local interface rather than Fusion.
     
  5. Ensure your optical sensor plugs are firmly seated in the FMM sockets. You really need to push them hard until they “click” into place.
     
  6. Ensure your FMM module is correctly identifying the optical sensors. Go into the FMM module settings, click Configure, then confirm outlets 1 and 2 are both detected as Optical Sensors:
    Screen Shot 2019-06-04 at 12.14.57 AM.png
  7. Wipe off your optical sensors if they are dirty.
     
  8. When you’re testing, dip the lower sensor in the water and verify that the tile on your dashboard changes from Open to Closed:
    Screen Shot 2019-06-03 at 8.29.50 PM.png
    If it doesn’t, then either the sensor is defective, not fully plugged in, in the wrong port, or not configured as an optical sensor. Do the same test with the upper sensor.
     
  9. If you submerge the lower sensor, but the upper sensor on the dashboard changes state, then your wires are in the wrong ports of the FMM. I’ve heard a couple people say the “1” and “2” labels were mixed up during manufacturing.
     
  10. Remember that the Defer statements cause a delay before turning the pump on (for 10 seconds) or (off for 4 seconds).  For testing purposes, you can lower the Defer timers, or delete them.  Just remember to set them back to the normal values after testing is completed.
     
  11. Enable logging on the PMUP output.  This allows you to review its operation later, or to remotely check in on its activity.
    Screen Shot 2019-06-04 at 9.15.31 AM.png

Neptune also has a troubleshooting section on their web site:  https://www.neptunesystems.com/getstarted/atk-help/

Customizing your ATK programming

The standard programming created by the Fusion ATK Setup task is fine for most people, but there are a lot of extra features you can add by customizing your programming.  I have made the following changes to my ATK programming:

  • Added an additional optical sensor named FW_LOW inside my 75 gallon RO/DI storage tank to turn off the ATK if the water level is too low
  • Added a virtual outlet named Maintenance to disable the ATK while I’m conducting maintenance.  I’ll cover virtual outlets in Thursday’s tutorial.
  • Lowered the When command timer from 5 minutes down to 3 minutes.  In my sump, the ATK should never need to run for more than about 1-2 minutes, so 3 would be abnormal.
  • Lowered the Min Time command timer from 60 minutes down to 30 minutes.

Here is my customized ATK_PMUP output code:

Fallback OFF
Set OFF
If ATK_LO OPEN Then ON
If ATK_HI CLOSED Then OFF
If FW_LOW OPEN Then OFF
If Output Maintenance = ON Then OFF
When On > 003:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 030:00 Then OFF

That's all for today.  Check in tomorrow for a tutorial on Power Monitoring!

 

Edited by SuncrestReef
  • Like 2
Link to comment
Share on other sites

This is hilarious...

The basic operation of the ATK is to tell the PMUP (Practical Multi-purpose Utility Pump…only Neptune would create an acronym that spelled backwards describes the actual device)

Question:  Can you set the value for defer to "zero" for testing purposes or do you need to have a minimum value (one second) or delete the line altogether?  This stuff is great BTW.

 

  • Like 1
  • Haha 1
Link to comment
Share on other sites

3 minutes ago, albertareef said:

This is hilarious...

The basic operation of the ATK is to tell the PMUP (Practical Multi-purpose Utility Pump…only Neptune would create an acronym that spelled backwards describes the actual device)

Question:  Can you set the value for defer to "zero" for testing purposes or do you need to have a minimum value (one second) or delete the line altogether?  This stuff is great BTW.

 

Great question.  I just tried setting Defer to 000:00 and got this error:

FAB63DA5-1F9F-43D2-B65C-2115BEA797A8.jpeg

  • Thanks 1
Link to comment
Share on other sites

Wednesday's topic -- Power Monitoring

This tutorial will cover several aspects of power monitoring in an Apex environment:

  • EB832 output power reporting*
  • EB832 output power usage alarms*
  • EB832 output power values in programming*
  • Apex power monitoring with UPS backup battery power

*Note: These topics do not apply to older Apex units or older Energy Bars.  Only the Apex 2016, Apex-EL, and EB832 are covered in this tutorial because the older versions don’t support these features.

With the introduction of the EB832 Energy Bar, Neptune included new features allowing you to get granular power consumption details on a per-outlet basis.  Older Energy Bars only provided statistics on the overall power consumption for the entire unit.

Power Reporting

When you click the EB832 tile on your dashboard it will cycle through different views showing individual outlet status, power consumption in amps and watts, and the approximate daily cost of energy consumed.

Screen Shot 2019-06-05 at 9.58.39 AM.png  Screen Shot 2019-06-05 at 10.55.29 AM.png   Screen Shot 2019-06-05 at 10.57.49 AM.png  

In order to calculate the energy costs, you need to enter your electricity rate from your utility bill:

  1. Click the Power Log icon in Fusion
    Screen Shot 2019-06-05 at 10.10.18 AM.png
  2. Click the down arrow at the upper right
    Screen Shot 2019-06-05 at 10.12.06 AM.png
  3. Enter your energy cost in kWh from your utility bill.  Mine is $0.0757 per kWH (shown as 7.57 cents on the bill, but enter it as dollars in Fusion)
    Screen Shot 2019-06-05 at 10.12.34 AM.png
  4. Save the settings

Now Fusion can report your estimated daily and monthly energy costs in the Power Log:
Screen Shot 2019-06-05 at 10.16.22 AM.png

The log can also show individual outlet usage in the graph if you click the Compare dropdown at the upper right:
Screen Shot 2019-06-05 at 10.19.35 AM.png

 

Power Usage Alarms

Most Apex alerts are configured as lines of programming under the Email_Alarm output.  With the new features of the EB832, Neptune provides a new collection of Inputs for each outlet on the EB832 which can be configured to send alerts when outside a specified range of values without any need for programming.  Fusion makes this easy to configure by clicking the Power Usage Alarms in the list of Tasks:
Screen Shot 2019-06-05 at 10.27.12 AM.png

Just follow the steps in the task wizard:
Screen Shot 2019-06-05 at 10.30.03 AM.png

Screen Shot 2019-06-05 at 10.30.13 AM.png

Screen Shot 2019-06-05 at 10.30.23 AM.png

Screen Shot 2019-06-05 at 10.30.33 AM.png

Once configured, if you ever need to modify the alarm settings or remove the alarm, go into the list of Inputs in Fusion.  Any input with alarms configured will show a checkmark in the Alarms column:
Screen Shot 2019-06-05 at 10.31.52 AM.png

Click the input to get to its configuration settings where you can change the specified limits:
Screen Shot 2019-06-05 at 10.37.18 AM.png

If you want to remove the alarm, click the Alarm dropdown and select Never:
Screen Shot 2019-06-05 at 10.37.46 AM.png

 

Output power values in programming

There may be situations where you want the Apex to take an action based on the amount of power a device is consuming.  The 120v outlets on the EB832 can be referenced in programming to read the watts or amps value:

If Output output_name [Amps/Watts] [</>] Then [ON/OFF]

As an example, I have a small cheap powerhead in my sump to create flow where my 2-part dosing tubes feed into the water.  Occasionally this powerhead seizes up, causing my 2-part to precipitate.  When it seizes, it draws more amps than normal, so I added a line of code to turn off the powerhead, and Defer commands to allow if to power back on 10 seconds later.  This sometimes breaks it loose and it starts spinning again:

Fallback OFF
Set ON
If Output EB_7_SMPFLO Amps > 5.0 Then OFF
Defer 000:10 Then OFF
Defer 000:10 Then ON

 

Apex power monitoring with UPS backup battery power

(I know I have posted these instructions a while back in another thread, but it will be good to have it here as a more permanent reference.)

The Apex can configured for power monitoring so it can selectively turn off specific outlets during a power outage, preserving the battery power to keep powerheads or air stones running longer.  The Apex can also send an alert when the power is out as long as your Internet router is on battery power as well.

Before getting into the programming steps, there are some prerequisites needed for power monitoring to work:

  1. Purchase this Apex 12V auxiliary power adapter: https://www.bulkreefsupply.com/12v-power-supply-neptune-systems.html
  2. Plug your Apex Energy Bar into your UPS (Uninterruptible Power Supply) battery backup.
  3. Plug the new 12V power adapter into a regular wall power outlet and connect it to the Apex auxiliary power port.
    1468963464_ScreenShot2018-11-18at1_23_19PM.png.6d8571c3dd8f8c551b03ab3b242c3e9b.png
  4. In Apex Fusion, click the Apex menu, then click Misc near the bottom of the menu
  5. Under the Power section, set Monitor to Enabled, then save the settings to your Apex.
    584740368_ScreenShot2018-11-18at1_24_51PM.thumb.png.884baac06e0abd8a8d950f8d7e410187.png

Once these steps are done, you can configure various outlets on your Energy Bar to react when your house power goes out.  Here are some examples:

Turn off return pump:

Fallback ON
Set ON
If Power Apex Off 000 Then OFF

Turn off heater:

Fallback OFF
If Tmp < 78.0 Then ON
If Tmp > 78.0 Then OFF
If Power Apex Off 000 Then OFF

Turn on air pump:

Fallback OFF
Set OFF
If Power Apex Off 000 Then ON

In general, you should only run the bare minimum devices on battery power.  Heaters, lights, and anything with powerful motors (like return pumps or skimmers) will drain the battery quickly, so they should be turned off.

If you want the Apex to send you alerts when the power is out, you will also need your Internet router connected to a battery backup.  In your Apex alert programming, add this as the final condition so it doesn't get overridden by any other alert conditions:

If Power Apex Off 000 Then ON

Since some devices may not be controlled by your Apex and just plugged into normal power strips, you should think through which items you want to run on battery power and which ones are safe to be off during a power outage.  Here is how I have my power cords connected:

Screen Shot 2019-05-25 at 11.04.59 AM.png

That's it for power monitoring!

Stay tuned for tomorrow's tutorial on Virtual Outputs.

Edited by SuncrestReef
  • Like 2
Link to comment
Share on other sites

My Apex tutorial series is being picked up by Reef2Reef!  They are going to publish each topic as articles spread over several weeks.  All of you here at PNWMAS get to binge read all the topics this week, while the R2R audience will just have to wait. 🤓

 

  • Like 1
Link to comment
Share on other sites

SuncrestReef,

Thank you very much for all the work you put into helping others out.  I don't have very much time each day to play with my apex and having such a comprehensive tutorial is great.  I was wondering why Neptune does not put out something like this.  Once again you amaze me with how detailed you are with everything.  Even I can follow you.. :enthralled:

  • Thanks 1
Link to comment
Share on other sites

15 hours ago, SuncrestReef said:

My Apex tutorial series is being picked up by Reef2Reef!  They are going to publish each topic as articles spread over several weeks.  All of you here at PNWMAS get to binge read all the topics this week, while the R2R audience will just have to wait. 🤓

 

Very cool news!  It is great info that is well organized and clearly presented so I could see why they might want to pick that up.  We are just lucky to get to host it and have first shot at reading it.  I sill like that it will be all together on our site which will, i think, make it easier to track and for people to see all the related information and questions in context.  Great work!

  • Thanks 1
Link to comment
Share on other sites

I really appreciate your work putting this together.  I think from my point of view that much of it was baffling for me when I first installed it and now I am about ready to move my main tank as I remodel my living room.  That means moving the Apex to the temporary tank that will be in the garage,.... cleaning up the existing tank while the living room is being worked on and then moving it all a second time back to the original location.  One of the things in this new move that I will add is a "pot filler"  (like the one that is going above my oven) set just above the tank to transport water from my RODI set up.  It will save me a lot of time moving buckets :)  

Great work on the tutorial!

  • Thanks 1
Link to comment
Share on other sites

Thursday's topic -- Virtual Outputs

So far in this series we have focused a lot on programming outputs that turn on or turn off devices plugged into Energy Bars.  These outputs are physical, tangible electrical outlets that have power cords plugged in.  Virtual outputs are imaginary outputs that we can use to create more complex programming than would normally be available given the Apex programming limitations.  Virtual outputs can be used for a variety of reasons:

  • Providing a master On/Off switch to easily turn off a number of devices with a single click.
  • Providing enhanced control of alarm programming.
  • Determining if one condition AND another condition are true, then applying the result of that comparison in an IF command on a physical output programming.
  • Automating Feed modes
  • Customizing lighting schedules

This is not an exhaustive list, as you can be creative with the use of virtual outputs.

Creating a virtual output

Virtual outputs are created from the Outputs screen:

  1. Click the Advanced (gear icon) at the top of the Fusion dashboard to expand the list of icons
    Screen Shot 2019-06-06 at 2.22.00 PM.png
     
  2. Click the Outputs icon
    Screen Shot 2019-06-06 at 2.22.14 PM.png
     
  3. Click the Add/Delete (gear icon) at the upper right, then click Add a virtual output
    Screen Shot 2019-06-06 at 2.23.08 PM.png
     
  4. Enter a descriptive name for the new output.  You are limited to 12 characters, and the name must be unique within your list of outputs, inputs, and module names.
    Screen Shot 2019-06-06 at 2.23.37 PM.png
     
  5. Once the new output has been created, Fusion will indicate that a new tile is available.  Click the padlock icon to access the Unused Tiles screen.
    Screen Shot 2019-06-06 at 2.25.41 PM.png
     
  6. Scroll right to left to get to the newly added output, then drag it to your dashboard, then click the padlock icon again to close the Unused Tiles screen.
    Screen Shot 2019-06-06 at 2.26.14 PM.png
     
  7. Click the gear icon above the new output to configure it.
    Screen Shot 2019-06-06 at 2.27.44 PM.png
     
  8. I always recommend enabling the Log checkbox so you’ll have a record of any time the output was turned on or off.  
    Screen Shot 2019-06-06 at 2.25.02 PM.png
    New virtual outputs always default to a single line of code:  Set OFF

What you do with the output from here is totally up to you.  I’ll provide a few examples of how I use them:

 

Maintenance master On/Off switch

When I conduct major maintenance in my sump, such as cleaning my return pump or emptying and cleaning out the sump, I normally turn off a number of devices:

  • Return pump
  • Skimmer
  • Heaters (x2)
  • Refugium pump
  • ATO
  • Dosing pumps (x2)
  • Auto water change pumps (x2)
  • Sump powerhead
  • UV sterilizer

Rather than clicking 12 separate output tiles on my dashboard, I just click my Maintenance output, and have programming on all the other devices to turn them off for me:

Return Pump:

Fallback ON
Set 100
If LkCrpt CLOSED Then OFF
If LkSump CLOSED Then OFF
If SMP_Lo OPEN Then OFF
If Output Maintenance = ON Then OFF
If FeedA 000 Then 1
If FeedB 000 Then 1

Heaters:

Fallback OFF
If Tmp < 78.0 Then ON
If Tmp > 78.0 Then OFF
If Output Maintenance = ON Then OFF
Defer 001:00 Then ON
Defer 000:15 Then OFF

and so on with the other devices.  Just that single line of If Output Maintenance = ON Then OFF is all that’s needed.  Remember to place that line below any line of code that may turn the device on because the code is processed from top to bottom, as covered in our Introduction tutorial.

Since the Maintenance virtual output doesn’t actually run any program (other than its default Set OFF command), the only way to activate Maintenance mode is to manually move the slider to the ON position:
Screen Shot 2019-06-06 at 3.00.25 PM.png

When you complete your maintenance, move the slider to the OFF position:
Screen Shot 2019-06-06 at 3.00.37 PM.png

Since this output doesn’t have any programming, I prefer to always leave it in the manual OFF position rather than AUTO, even though in this particular example it doesn’t make a difference.  My reasoning is that it’s easier to see at a glance when the slider is in the OFF position than seeing it in the AUTO position and then needing to look more closely above the slider to see if it says “On” or “Off” in a smaller font.

This master On/Off switch is by far the simplest usage for virtual outputs.  Next, let’s look at some examples that involve a bit more programming.

 

Providing enhanced control of alarm programming

Virtual outputs provide a way to trigger alerts for certain conditions beyond the simple “If this then ON” commands in the Email Alarm output.  My favorite example is a warning if my ATO hasn’t run recently.  Under normal circumstances my ATO runs every 30 minutes due to evaporation, or perhaps every 60 or 90 minutes if I happened to add a little excess water to my sump.  But it should NEVER wait over 2 hours to run, so if it does I’d like to know.  I use a virtual output named Alert_ATO to keep track of this for me:

Set OFF
If ATK_LO OPEN Then ON
Defer 120:00 Then ON

Then in my Email_Alarm output, I added this line:

If Output Alert_ATO = ON Then ON

If you recall from the ATK Troubleshooting tutorial, the lower optical sensor in my sump is named ATK_LO, and when it reports OPEN then the ATK_PMUP output is turned on to refill the sump.  This Alert_ATO virtual output is instructed to turn ON when ATK_LO is OPEN, but the Defer 120:00 forces the virtual output to wait for 2 hours before finally changing state to ON, as discussed in the Timers tutorial.  If during that 2 hour timer the sump is refilled and ATK_LO changes to CLOSED, then the Defer timer is reset.  But if the pump doesn’t run and the 2 hour timer finally reaches zero, the Alert_ATO virtual output finally changes state to ON, and the Email_Alarm is then triggered.  Pretty slick!

Once the Email_Alert output is on, it will send text and email messages once per hour until the situation is corrected or the output is manually turned off.  For critical alarms this is fine, but sometimes the alarms are not really critical and maybe you don’t want to get up at 2am for something trivial.  In those situations, a virtual output can be used to trigger the alarm, but then turn itself off so the alarm doesn’t repeat every hour.

(wow, I just got an alarm about my 2-part container being low…perfect timing to describe an example of a non-critical alarm that doesn’t need to nag me every hour)
IMG_6476.jpg

Here’s how to program a one-time alert using a virtual output named Alert_2Part:

Set OFF
If ALK_LO OPEN Then ON
If CAL_LO OPEN Then ON
If Time 23:00 To 07:00 Then OFF
Defer 001:00 Then ON
When On > 010:00 Then OFF

This single virtual output is checking both my alkalinity container and calcium container.  If either one is low, the output is triggered. 
Screen Shot 2019-06-06 at 3.39.14 PM.png

This is an example of an OR comparison.  In the next example I’ll show an AND comparison.

Recalling from our Timers tutorial, the Defer timer is used to prevent false alarms due to ripples on the liquid surface inadvertently triggering the optical sensor (in my case, if I accidentally bump the container when it’s nearly low, but not quite at the sensor yet).  Once the liquid is below the sensor for at least 1 continuous minute, the output finally changes state to ON, unless it's between 11pm - 7am when I'm sleeping.  In my Email_Alarm output, I added this line:

If Output Alert_2Part = ON Then ON

This triggers the actual email and text message.  However, instead of getting a repeated alert every hour, the When command on the virtual output turns the output OFF after 10 minutes, which cancels the Email_Alert.  Remember the When command is a failsafe that moves the output tile slider to the manual OFF position, so it will no longer run the program until you move it back to AUTO:

Screen Shot 2019-06-06 at 3.33.20 PM.png

Once I finish typing up this tutorial, I’ll go refill my 2-part containers and then set the Alert_2Part virtual output back to AUTO.

 

AND comparisons

Sometimes you might want an output to turn on only if two or more conditions are true.  This is considered an AND comparison.  Here’s an example where I use a virtual output to determine if my Radion lights should simulate moon lighting, but only if the moon is visible, and only if my normal lighting schedule is off:

Set OFF
If Moon 000/000 Then ON
If Time 07:00 to 21:00 Then OFF

The Apex’s built in lunar schedule knows when the moon is above the horizon.  Since moonrise varies day to day, sometimes it’s visible at night, but sometimes it’s during the day.  In this example, the output register is set to ON if the moon is visible, but it’s turned OFF if the time is between 7am - 9pm.  This is effectively saying “if the moon is up, AND the time is between 9pm to 7am, then turn ON”.

On my Radion outputs, I just add a line to switch to the moon lighting:

If Output vMoon = ON Then Moonlight

I will cover this topic in more detail on Sunday with our Lunar Schedule and Lighting Profiles tutorial.

Virtual outputs are really useful!  Hopefully this will get you started with creating some convenient automation for your setup.

Tomorrow I’ll go over Alarms in more detail.  Stay tuned.

 

Edited by SuncrestReef
  • Like 1
Link to comment
Share on other sites

Friday's topic -- Alarms

The Apex provides a useful — though limited — way to notify you when something is wrong with your system.  A variety of built in alarms as well as a programmable alarm output can be configured to selectively draw your attention to problems.  There are several sources of alarms:

  • Inputs — Probes, switches, and power meters can all be configured to alarm based on state or measured value.
  • EmailAlm output — Custom programming can be used to alarm based on typical output commands
  • When command — The When countdown timer generates an error condition alarm and sets the output slider to the OFF position.
  • Module errors — Certain Apex modules have built in safeguards that generate alarms when a problem is encountered.

Note:  If you have an older Apex with the Display module, it provides audible alarms through a small speaker.  These alarm outputs named SndAlm_I6 and SndWrn_I7 serve no purpose if you don’t have the display module, even though they are still listed as outputs on every Apex unit, including current models.

When the Apex has an active alarm condition, it can send a notification via email, SMS text message, or directly to the Fusion App on a smartphone or tablet.  In addition, all alarms are added to the Apex Alarm Log that can be reviewed later:

Screen Shot 2019-06-07 at 3.31.14 PM.png

 

Setting up alarm notifications:

  1. In Fusion, click the down arrow next to your username at the upper right, then click Settings
    Screen Shot 2019-06-07 at 1.30.49 PM.png
     
  2. Click Notifications on the left
    Screen Shot 2019-06-07 at 2.58.44 PM.png
     
  3. To add a recipient, click the plus sign icon at the upper right
  4. Select the method of notification.  If you want SMS text messages, choose your wireless carrier from the list.
    Screen Shot 2019-06-07 at 3.04.47 PM.png
     
  5. Enter the email address or phone number
  6. After adding a new entry, you will receive a verification code at that address or phone number.
    Screen Shot 2019-06-07 at 3.39.12 PM.png

    Note:  If you are adding someone else and don't have access to their email or phone, you can click Cancel on this screen.  Later when they can tell you the verification code, you can go back to the list of recipients and enter the verification code.  Just click the gear icon next to their address and click Verify:
    Screen Shot 2019-06-07 at 3.40.40 PM.png

You can have multiple destinations for alarms.  I send them to both email and my iPhone for redundancy.  I also add my tank sitter to the list before I’m going out of town, and then remove her from the list when I return.

 

Configuring alarms

There are a few different ways to configure alarms.  The simplest method for probes or certain Inputs is to use the built-in alarm feature on its configuration page.  This is available for:

  • Temperature probes
  • Conductivity (salinity) probes
  • pH probes
  • ORP probes
  • Flow sensors
  • EB832 ammeter and watt meter inputs
  • PAR sensor
  • Trident measurements

You can either us the Basic alarm settings, where it will trigger an alarm if above or below your specified values:

Screen Shot 2019-06-07 at 3.49.00 PM.png

or use Advanced alarm settings which gives you more flexibility:

Screen Shot 2019-06-07 at 3.49.53 PM.png

Any Inputs with alarms configured will display a checkmark under the Alarm column in the list of Inputs:

Screen Shot 2019-06-07 at 3.50.37 PM.png

 

Alarm Programming

For items that don’t have built in alarm settings on the configuration page, you must add lines of program code to the EmailAlm output.  The command used for this is typically a simple If command.  Any line of code that evaluates as True will trigger the alarm.  Here are some examples:

Float switch:

If FW_HI CLOSED Then ON

Virtual output:

If Output Alert_2Part = ON Then ON

When command error:

If Error ATK_PMUP Then ON

Module error:

If Error Trident_16_3 Then ON

 

The EmailAlm output itself behaves exactly like any other outlet and follows the same logic that I’ve covered in earlier tutorial topics.  The commands are processed from top to bottom, and the last line that evaluates to True sets the state of the output.  If anything sets it to On, then the alarm will be triggered and notifications will be sent.  Once that condition is no longer True, and if no other command turns the outlet On, then the output is turned Off and the alarm is cleared.  A notification is also sent when the alarm turns Off.

With this in mind, you should always start your program with an initial Set OFF command, and then follow it with lines that could potentially turn it On.

One of the major limitations with alarm programming is that only the last line that turns the output On is the line of text you’ll receive in the notification.  In other words, if there are 3 different lines of code that all evaluate True and turn the output On, only the last one will be displayed in your notification email or text message.  For this reason it’s recommended to sequence your alarm programming so the least important things are at the top, and the most critical things are at the end.  For example, if your EmailAlm output program is checking for high temperature and also checking if the skimmer cup float switch is on:

Set OFF
If Temp > 99 Then ON
If SkimmerFull = CLOSED Then ON

and if both of these conditions are true, the only notification you will get is about the skimmer.  If you got that message while you’re at a movie theater, you probably wouldn’t rush right home and instead you'd stay to see the movie credits and any blooper scenes.  But you wouldn’t realize that the water temperature is killing everything in your tank.

It would be better to change the sequence to:

Set OFF
If SkimmerFull = CLOSED Then ON
If Temp > 99 Then ON

Now when you receive the alarm about the Temp > 99, you’ll run out of the theater and head right home.  After dumping frozen water bottles into your tank, you’ll also eventually notice that your skimmer is also full even though you didn't get a notification about it.

Just think through your priorities when sequencing your alarm programming.

Once you have your EmailAlm output programmed, but sure to leave its tile on the dashboard in the AUTO position.  If you ever slide it to OFF, you will not receive any alarms you programmed,  If you slide it to ON, it will just send you a notification right away regardless of your programming.  It’s best to just always leave it set to AUTO.

 

Nuisance  Notifications

Once an alarm is triggered, the email and text notifications will be sent to you every hour until the alarm condition is cleared.  For trivial things, such as the skimmer cup full example above, this can be very annoying.  The best way to avoid excess notifications is to use a virtual output with its own programming including a timer, and then use that virtual output’s state in your alarm programming.  This was discussed in my previous tutorial on virtual outputs, but I’ll present it again here.

When my 2-part dosing containers are low, the optical sensors inside will report OPEN.  I use a virtual output to monitor this condition to turn the virtual output On, then use a When timer of 10 minutes to turn the virtual output to manual OFF.  It also ignores the optical sensor at night when I’m sleeping with an If Time command:

Set OFF
If ALK_LO OPEN Then ON
If CAL_LO OPEN Then ON
If Time 23:00 To 07:00 Then OFF
Defer 001:00 Then ON
When On > 010:00 Then OFF

Then in my alarm programming, I just check the status of the virtual output:

If Output Alert_2Part = ON Then ON

Now I don’t need to worry about low 2-part waking me up at 3am, and during the day if it’s low it will only send me one notification instead of nagging every hour.

I use several virtual outputs exclusively for alarm programming.  Here’s my current EmailAlm output programming:

Set OFF
If Output Alert_2Part = ON Then ON
If Output Alert_FW_HI = ON Then ON
If Output Alert_FW_LO = ON Then ON
If Output Alert_SkmFul = ON Then ON
If Output Alert_FUG_Hi = ON Then ON
If Error Trident_16_3 Then ON
If Error ATK_PMUP Then ON
If Output vATO_Off = ON Then ON
If Output Alert_SmpFlo = ON Then ON
If Output vSmp_Hi = ON Then ON
If Output vSMP_Lo = ON Then ON
If Output Alert_Power = ON Then ON
If Output Alert_Leak = ON Then ON

Again, I want to emphasize the importance of placing the least important alarm conditions at the top of the list, and the most critical towards the bottom.

Be sure to configure your alarms.  It’s one of the most important reasons for using a controller.  The sooner you know there’s a problem, the sooner you can work on fixing it.

Stay tuned for our next tutorial on Feed Cycles.

Edited by SuncrestReef
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Reef2Reef published the first installment of my tutorials today, and they'll publish one topic each Friday for the next 8 weeks.

If you want to boost my ego, you can view it and rate the article!  🤓

https://www.reef2reef.com/ams/apex-neptune-programming-tutorials-part-1.685/

Only 2 more topics to go, and you don't have to wait 8 weeks to see them here!

  • Like 1
Link to comment
Share on other sites

Today's topic -- Feed Cycles

The Apex has four Feed Cycle buttons which can be used for a variety of reasons, not just feeding.  When you click a Feed button, it activates a timer and a special programming element that you can reference in your program code to turn off or turn on various outputs:
Screen Shot 2019-06-08 at 1.15.25 PM.png

The Feed Cycles are named FeedA, FeedB, FeedC, and FeedD.  You can configure the timers for each in the Misc Setup page:

  1. Click the Advanced (gear icon) at the top of the Fusion dashboard to expand the list of icons
    264181635_ScreenShot2019-06-06at2_22_00PM.png.760ba794dfd815337f9a6633f0ece599.png
     
  2. Click the Misc (wrench icon) to display the Misc Setup page
    Screen Shot 2019-06-08 at 5.12.43 PM.png
     
  3. Enter the time each Feed Cycle should remain active, between 60 - 65535 seconds (1 minute to 18 hours 12 minutes)
    Screen Shot 2019-06-08 at 4.30.37 PM.png

How you use the Feed Cycles is up to you.  Here’s how I use mine:

  • FeedA — Feeding fish.  Turns off powerheads, skimmer, and sets return pump to 1% for 5 minutes.
  • FeedB — Feeding corals.  Turns off powerheads, skimmer, and sets return pump to 1% for 10 minutes.
  • FeedC — Photography.  Turns off powerheads, skimmer, sets return pump to 1%, sets lights to whiter spectrum for 15 minutes.
  • FeedD — Feeding fish with Auto Feeder.  Turns off powerheads, skimmer, and sets return pump to 1% for 5 minutes, and activates feeder for one rotation.

This is accomplished by adding the following line to each output you’d like off during the Feed Cycle:

If [FEED CYCLE] [DELAY] Then [ON/OFF/PROFILE]

For example, the powerheads are turned off with this code:

If FeedA 000 Then OFF
If FeedB 000 Then OFF
If FeedC 000 Then OFF
If FeedD 000 Then OFF

For the skimmer, I need it to wait for the sump water level to return to normal after the return pump has been off.  This is achieved by using the delay timer:

If FeedA 005 Then OFF
If FeedB 005 Then OFF
If FeedC 005 Then OFF
If FeedD 005 Then OFF

This forces the skimmer to wait an additional 5 minutes after the Feed Cycle has completed.  By that time, the return pump has brought the sump water level back down to normal so the skimmer doesn’t overflow.

Feed Cycles must be activated manually by clicking on the buttons in Fusion.  They cannot be activated programmatically.  If you want your Neptune AFS auto feeder to run with no manual intervention, then you can configure the AFS by clicking the gear icon above the AFS tile on your dashboard:

Screen Shot 2019-06-08 at 1.17.51 PM.png

After saving these settings, you can see the underlying code for the AFS by changing its Control Type to Advanced:

Screen Shot 2019-06-08 at 4.48.07 PM.png

However, while this automates the AFS, it does not give you control over your powerheads, pumps, or skimmer.  The best way to incorporate an automated feeder and mimic the Feed Cycle buttons is to use a virtual output to control everything.  Here’s an example:

Virtual Output vFeed:

Set OFF
If Time 08:00 to 08:02 Then ON
If Time 17:00 to 17:02 Then ON
Defer 005:00 Then OFF

AFS Output Configuration:

Fallback OFF
Set OFF
If Output vFeed = ON Then ON
Defer 001:00 Then ON

Return Pump Configuration:

Fallback ON
Set ON
If Output vFeed = ON Then OFF

Skimmer Configuration:

Fallback OFF
Set ON
If Output vFeed = ON Then OFF
Defer 005:00 Then ON

Now when the vFeed output is set to AUTO, it will turn on at 8am and 5pm for 2 minutes each.  This will cause the return pump and skimmer to turn off immediately.  The AFS feeder will wait 1 minute (due to the Defer timer) and then make a single rotation.  After 5 minutes the vFeed output turns off due to its Defer timer, so the powerheads and return pump come back on after giving the food time to settle in the tank.  The skimmer waits an additional 5 minutes due to its Defer timer, allowing the sump water level to return to normal before turning on.  Just like the manual Feed Cycle buttons, but all unattended!

That’s all for Feed Cycles.  In our final tutorial tomorrow I’ll cover Lunar Schedules and Lighting Profiles.

  • Like 2
  • Thanks 1
Link to comment
Share on other sites

Wow these posts are great! It's so thoughtful of you to do this, I plan on getting one soon so your posts will be extremely helpful. I got some good news at work yesterday so it looks like I'll be bringing home more $$ and the first thing that came to mind was now I can buy an Apex [emoji23]

Sent from my BLU R1 HD using Tapatalk

  • Like 2
Link to comment
Share on other sites

1 hour ago, TaylorW said:

Wow these posts are great! It's so thoughtful of you to do this, I plan on getting one soon so your posts will be extremely helpful. I got some good news at work yesterday so it looks like I'll be bringing home more $$ and the first thing that came to mind was now I can buy an Apex emoji23.png

Sent from my BLU R1 HD using Tapatalk
 

Wow, congrats!!  Always glad to help.

Link to comment
Share on other sites

Sunday’s topic -  Lunar Schedule and Lighting Profiles

For the last installment in my Apex tutorial series, I wanted to cover something that’s not mentioned very often.  The Apex has built-in schedules for lunar cycles.  Since many types of coral in the wild are known to spawn during the full moon, it can be fun to simulate moon lighting on your tank that follows the 29.5 day cycle of the moon.

(funny side story: My wife wanted to see coral spawning when we went to Australia.  She researched it and planned our trip to coincide with the full moon in November 2012.  We had a hard time finding any hotel vacancies and there were no rental cars available anywhere.  We just thought Cairns, Australia was really popular at that time of year.  What we didn’t know until we arrived was that she got the date wrong, and we actually booked our vacation during the new moon, not the full moon.  And this wasn’t any ordinary new moon…It was during a total solar eclipse, and Cairns was directly in the path of totality!  So while we didn’t see any coral spawning, we did see a solar eclipse!)

To get started, the Apex lunar schedule needs to be configured to correspond with the date of the new moon each month.  You can only access the lunar schedule from the local Apex console rather than Fusion:

  1. Browse to http://apex.local
  2. Click the Apex menu at the top, then click Misc
    Screen Shot 2019-06-09 at 9.38.37 AM.png
     
  3. Click the Season icon at the top
    Screen Shot 2019-06-09 at 9.18.14 AM.png
     
  4. Select Day of New Moon from the Setup dropdown
    Screen Shot 2019-06-09 at 9.19.06 AM.png
     
  5. For each month, enter the day of the new moon.  You can easily find this information online:   https://www.timeanddate.com/moon/phases/usa/portland-or
    Screen Shot 2019-06-09 at 9.19.20 AM.png
  6. Save the table to your Apex
  7. You can now exit the Apex.Local console and return to your Fusion dashboard

To use the lunar schedule in your programming, the If Moon command is used:

If Moon [+/-] [DELAY] / [+/-] [DELAY] Then [ON/OFF/PROFILE]

The two [Delay] parameters specify how many minutes to wait after (or how much earlier) the moon rises, or sets.  Here are some examples:

If Moon 000/000 Then ON    - Turn on at moonrise, and off at moonset
If Moon 030/000 Then ON    - Turn on 30 minutes after moonrise, and off at moonset
If Moon 000/-060 Then ON   - Turn on at moonrise, and off 60 minutes before moonset by using a negative number

Depending on what kind of lights you have, you can either configure them for dim cool white light to simulate the moon, or install dedicated moon lights in addition to your primary lights.  I have Radion XR30 Pro’s which can be tuned for different spectrums and intensities.  However, I can’t just set them to switch to moonlight mode any time the If Moon command is ON, because that would cause dim moon lighting in the middle of the day whenever the moon is visible during the day.  Instead, I use a virtual output named vMoon that combines the If Moon command with an If Time command:

Set OFF
If Moon 000/000 Then ON
If Time 07:00 to 21:00 Then OFF

This allows moon lighting to run any time the moon is visible, except during my normal lighting schedule from 7am to 9pm.

Lighting Profiles

The next step is to create a lighting profile.  A profile is a collection of settings for certain types of devices such as dosing pumps, powerheads, lights, and others.  Apex supports custom lighting profiles for Radions and Vega/Hydra LED lights.  If you don’t have one of these supported lights, you can skip this Profile section and pick up at the Controlling your lights section below.

Creating a lighting profile

  1. Click the Advanced (gear icon)
    Screen Shot 2019-06-06 at 2.22.00 PM.png
     
  2. Click the Profiles (folder icon)
    Screen Shot 2019-06-09 at 10.26.58 AM.png
     
  3. Click any profile from the list that is not yet defined.  Apex has 32 profiles named PF01 - PF32.  You cannot create or delete them, but you can rename them and assign settings to them
  4. Give the profile a descriptive name, and set the type of lights
  5. Fill in the intensities for each color spectrum.  I’ve found these values work really well on my Radions to look like moonlight:
  6. Screen Shot 2019-06-09 at 10.01.03 AM.png
     
  7. Save the profile

Controlling your lights

If you have Radions or Vega/Hydras, you can add a single line of programming that will switch them to moon lighting when the vMoon virtual output is On.  This is done in the Advanced tab under the Radion’s configuration page:

  1. Click the gear icon above your light’s output
    Screen Shot 2019-06-09 at 10.43.30 AM.png
     
  2. Click the Advanced (gear icon) at the top right
    Screen Shot 2019-06-09 at 10.08.07 AM.png
     
  3. Click the Advanced tab
    Screen Shot 2019-06-09 at 10.07.38 AM.png
     
  4. Add this line of code:
    If Output vMoon = ON Then Moonlight
  5. Save the settings, and repeat on each of your light outputs.

If you don’t have Radions or Vega/Hydra LED lights, you can install any dedicated light for moon lighting connected to an outlet on your Energy Bar, and control that output with this code:

Set OFF
If Output vMoon = ON Then ON

Once you set the vMoon output to AUTO, it will control when to turn on or turn off the moon lighting.  Just remember, the time will vary each day, and some nights you will not see any moon lights on because the moon is not actually visible in the sky.

Other lighting profiles

If you noticed in my Radion screenshot above, I have additional profiles listed in the Advanced coding.  I created virtual outputs to quickly switch my lights to all blues or all whites for viewing or photography, and just added those virtual outputs to my dashboard so I can change my lights with a single click:

Screen Shot 2019-06-09 at 10.16.10 AM.png

 

This tutorial leveraged tips from the previous Timers and Virtual Outputs tutorials, so be sure to brush up on those topics if you haven’t already.

OK, now just sit back and watch for your corals to spawn when your moon lights are on!

This concludes my Apex programming series.  I hope this was useful and helps you better understand the powerful system you have at your disposal to control your aquarium gear.  If you have any questions, or have a request for an additional tutorial topic, let me know.

Happy reefing!

Edited by SuncrestReef
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...