Apex Programming Command Reference

OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
This is fantastic information, thanks. Couple of questions. How often are the expressions evaluated. For example if I wanted to put a statement on my DOS for Calcium and I do not want the Calcium to be over 450. I wrote "If Cax3 > 450 Then OFF" but am unsure how often this would get checked. My plan is to have it skip dosing each day when the Calcium is over 450. Will this accomplish that?
All the code is evaluated once per second. The moment your Trident reports Cax3 is 451 or higher, the DOS will stop running. But since the Trident value remains static until the next scheduled test, the DOS won't run for many hours until the Trident reports a lower value.

Are you aware that the Trident can control the DOS automatically, which is the preferred method? See:
 

dwfain

Community Member
View Badges
Joined
Sep 18, 2020
Messages
96
Reaction score
40
Location
Benton
Rating - 0%
0   0   0
All the code is evaluated once per second. The moment your Trident reports Cax3 is 451 or higher, the DOS will stop running. But since the Trident value remains static until the next scheduled test, the DOS won't run for many hours until the Trident reports a lower value.

Are you aware that the Trident can control the DOS automatically, which is the preferred method? See:
Fantastic. So can you use auto and evaluate statements together? For Alk I would use auto but if the pH goes above a certain level I would turn it off.
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
Fantastic. So can you use auto and evaluate statements together? For Alk I would use auto but if the pH goes above a certain level I would turn it off.
You should always leave the DOS output slider set to AUTO on the dashboard, otherwise the Apex will ignore your programming.
Screen Shot 2021-08-25 at 3.20.25 PM.png
When set to AUTO, it will run the normal schedule you have defined, and if using Trident Controlled Dosing, the dosing schedule will be slightly modified based on the Trident test results. You can also place any conditional commands into the Advanced tab to override the normal schedule, such as if pH is too high:
Screen Shot 2021-08-25 at 3.18.33 PM.png
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
I have my lights turn off 1/2 an hour before the sun in my city sets and turn on 1/2 an hour after sunrise in my city. But I have to adjust the lights seasonally. The purpose is to let the natural sun wake up the tank as it sits by the window and i use metal halides and t5s. Can the apex account for this and adjust the times my light turns on and off based on the sunset and sunrise in my city?
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
I have my lights turn off 1/2 an hour before the sun in my city sets and turn on 1/2 an hour after sunrise in my city. But I have to adjust the lights seasonally. The purpose is to let the natural sun wake up the tank as it sits by the window and i use metal halides and t5s. Can the apex account for this and adjust the times my light turns on and off based on the sunset and sunrise in my city?
Yes, the Apex has a built-in Seasonal Table where you can specify the local sunrise and sunset times for the 1st day of each month:

Screen Shot 2021-12-19 at 4.35.58 PM.png

The "If Sun" command automatically calculates the daily shift in sunrise/sunset times based off of this table.

To edit the Seasonal Table for your location, you need to use the Local Dashboard (not Fusion), then click the wrench icon:
Screen Shot 2021-12-19 at 4.39.08 PM.png

Screen Shot 2021-12-19 at 4.40.55 PM.png

Once you have the Seasonal Table set appropriately for your location, use this programming on your lights:

Fallback OFF
Set OFF
If Sun 030/-030 Then ON

The numbers after the If Sun command tell it when to turn On, and Off. The first number is the number of minutes after sunrise to turn On (a negative number means before sunrise), and the second number is the number of minutes after sunset to turn Off (a negative number means before sunset). In my example above, the lights turn on 30 minutes after sunrise, and turn off 30 minutes before sunset.
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
Yes, the Apex has a built-in Seasonal Table where you can specify the local sunrise and sunset times for the 1st day of each month:

Screen Shot 2021-12-19 at 4.35.58 PM.png

The "If Sun" command automatically calculates the daily shift in sunrise/sunset times based off of this table.

To edit the Seasonal Table for your location, you need to use the Local Dashboard (not Fusion), then click the wrench icon:
Screen Shot 2021-12-19 at 4.39.08 PM.png

Screen Shot 2021-12-19 at 4.40.55 PM.png

Once you have the Seasonal Table set appropriately for your location, use this programming on your lights:

Fallback OFF
Set OFF
If Sun 030/-030 Then ON

The numbers after the If Sun command tell it when to turn On, and Off. The first number is the number of minutes after sunrise to turn On (a negative number means before sunrise), and the second number is the number of minutes after sunset to turn Off (a negative number means before sunset). In my example above, the lights turn on 30 minutes after sunrise, and turn off 30 minutes before sunset.
I live really far north and the sun in the summer doesnt set some days until 11:15pm, how would i limit my lights to turn off at say 7pm max in the summer?
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
I live really far north and the sun in the summer doesnt set some days until 11:15pm, how would i limit my lights to turn off at say 7pm max in the summer?
Two simple options:

1. When you edit the Seasonal Table, just never enter a time later than 7:00pm for the sunset time. The Apex just uses the times you enter in that table. It doesn't question you if you lie about the real sunset time. :)

- or -

2. Use an If Time command to override the If Sun time if it's later than 7:00pm:

Fallback OFF
Set OFF
If Sun 030/-030 Then ON
If Time 19:00 to 05:00 Then OFF
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
Two simple options:

1. When you edit the Seasonal Table, just never enter a time later than 7:00pm for the sunset time. The Apex just uses the times you enter in that table. It doesn't question you if you lie about the real sunset time. :)

- or -

2. Use an If Time command to override the If Sun time if it's later than 7:00pm:

Fallback OFF
Set OFF
If Sun 030/-030 Then ON
If Time 19:00 to 05:00 Then OFF
Thank you! Is daylight savings time going to interfere with my purpose of having the sun come up before the lights come on? After writing all the times in, i noticed the linked website i got them from accounts for daylight savings time.

Screenshot_20211219-212746_Samsung Internet.jpg


 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
One more thing, after inputting the times for seasonal table, do i need to delete the old code for my light schedule? Like its going to use the seasonal table to turn my lights on and off?
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
One more thing, after inputting the times for seasonal table, do i need to delete the old code for my light schedule? Like its going to use the seasonal table to turn my lights on and off?
The daylight savings time question will depend on your Apex clock settings. If the Apex is configured to automatically adjust for daylight savings time, then the day the clock changes the lights will be 1 hour different than the day before. In other words, your Apex will control things based on the local time the clock on your wall reads, and if you observe daylight savings time, then there will be a 1 hour jump in your light's schedule.

As for deleting your current schedule, you didn't post your current programming, so I have no idea how it was set up. If you want it to follow the seasonal table using the If Sun command, then that should replace whatever you previously had programmed.
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
The daylight savings time question will depend on your Apex clock settings. If the Apex is configured to automatically adjust for daylight savings time, then the day the clock changes the lights will be 1 hour different than the day before. In other words, your Apex will control things based on the local time the clock on your wall reads, and if you observe daylight savings time, then there will be a 1 hour jump in your light's schedule.

As for deleting your current schedule, you didn't post your current programming, so I have no idea how it was set up. If you want it to follow the seasonal table using the If Sun command, then that should replace whatever you previously had programmed.
So ive got 5 lights to program. I have my t5 lights turn on separately 2 of them first for a 15 mins then the other 2 come on 15 mins later. Then the left halide turns on first an hoir later or so, then the middle halide, then the right halide comes on last. Is it possible to make these come on in succession like i have them and still use the seasonal programming? Heres pics of my setup:

Screenshot_20211219-231443_APEX Fusion.jpg
Screenshot_20211219-231535_APEX Fusion.jpg
Screenshot_20211219-231650_APEX Fusion.jpg
Screenshot_20211219-231719_APEX Fusion.jpg
Screenshot_20211219-231750_APEX Fusion.jpg
Screenshot_20211219-231821_APEX Fusion.jpg
 
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
So ive got 5 lights to program. I have my t5 lights turn on separately 2 of them first for a 15 mins then the other 2 come on 15 mins later. Then the left halide turns on first an hoir later or so, then the middle halide, then the right halide comes on last. Is it possible to make these come on in succession like i have them and still use the seasonal programming? Heres pics of my setup:

Screenshot_20211219-231443_APEX Fusion.jpg
Screenshot_20211219-231535_APEX Fusion.jpg
Screenshot_20211219-231650_APEX Fusion.jpg
Screenshot_20211219-231719_APEX Fusion.jpg
Screenshot_20211219-231750_APEX Fusion.jpg
Screenshot_20211219-231821_APEX Fusion.jpg
As I explained in my first reply to you, the If Sun command includes two timers to allow you to shift the times relative to sunrise and sunset. Just add or subtract the number of minutes for each light . Examples:

If Sun 000/000 Then ON = turn on at sunrise and off at sunset

If Sun 015/030 Then ON = turn on 15 minutes after sunrise and off 30 minutes after sunset

If Sun -030/-030 Then ON = turn on 30 minutes before sunrise and off 30 minutes before sunset. Negative numbers cause it to operate earlier than the event.

Just adjust those timers for each of your lights as needed.
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
As I explained in my first reply to you, the If Sun command includes two timers to allow you to shift the times relative to sunrise and sunset. Just add or subtract the number of minutes for each light . Examples:

If Sun 000/000 Then ON = turn on at sunrise and off at sunset

If Sun 015/030 Then ON = turn on 15 minutes after sunrise and off 30 minutes after sunset

If Sun -030/-030 Then ON = turn on 30 minutes before sunrise and off 30 minutes before sunset. Negative numbers cause it to operate earlier than the event.

Just adjust those timers for each of your lights as needed.
No you explained it perfectly the first time and its working perfectly thank you! It was late and inwas tired sorry about that. My problem now is too much power draw lol. With all t5s and metal halides going its its over 1300 watts. Any tips for that? Ive got my 400 watt halides set to 300 watts for this reason. Id like the middle one at 400 watts but with the t5s on it causes the apex to trip its breaker. Heres a screenshot of the power draw on my 15 amp circuit.
 

Attachments

  • Screenshot_20211220-131847_APEX Fusion.jpg
    Screenshot_20211220-131847_APEX Fusion.jpg
    75.1 KB · Views: 33
OP
OP
SuncrestReef

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
No you explained it perfectly the first time and its working perfectly thank you! It was late and inwas tired sorry about that. My problem now is too much power draw lol. With all t5s and metal halides going its its over 1300 watts. Any tips for that? Ive got my 400 watt halides set to 300 watts for this reason. Id like the middle one at 400 watts but with the t5s on it causes the apex to trip its breaker. Heres a screenshot of the power draw on my 15 amp circuit.
Unfortunately, the only thing I can suggest is to get an additional EnergyBar so you can split the load across multiple EB's. It doesn't necessarily need to be a full EB832; a simple EB4 would be enough.
 

Cory

More than 25 years reefing
View Badges
Joined
Oct 30, 2014
Messages
6,882
Reaction score
3,129
Location
Canada
Rating - 0%
0   0   0
Unfortunately, the only thing I can suggest is to get an additional EnergyBar so you can split the load across multiple EB's. It doesn't necessarily need to be a full EB832; a simple EB4 would be enough.
I was afraid of that lol. Well lets see if the wife is generous this christmas. Thanks a lot for the help! Neptune should pay you for this (or give equipment for you work). Your information is easily understood and far more organized than what they have put together.
 

dwfain

Community Member
View Badges
Joined
Sep 18, 2020
Messages
96
Reaction score
40
Location
Benton
Rating - 0%
0   0   0
This article is a reference guide for all of the Neptune Apex programming commands. All of this information is publicly available, but is scattered amongst several Neptune documents and posts in the Neptune Community Forums. My goal is to consolidate all of this information into a single reference document.

Apex.png


Documentation Conventions
Before presenting the list of commands, here is an overview of the documentation conventions for parameters:

Input, Output, and Profile names are shown in bold italics.

Examples:
If Temp > 80 Then OFF
If Flow1 < 100 Then OFF
If pH > 6.80 Then ON
If Output Return_Pump = OFF Then OFF
If FeedA 000 Then Slow_Mode

Various parameters are listed in square brackets, separated by a slash: [ON/OFF/Profile_Name/%]

Examples:
If Time 08:00 To 10:00 Then [ON/OFF/Profile_Name/%] includes the following possible uses:

If Time 08:00 To 10:00 Then ON (turns the output ON)
If Time 08:00 To 10:00 Then OFF (turns the output OFF)
If Time 08:00 To 10:00 Then Morning_Mode (sets the output to use the Morning_Mode profile)
If Time 08:00 To 10:00 Then 25 (sets the output to 25%)

Note: Profiles can only be used on specific output types. For example, a Pump profile only works on 0-10v variable outputs, DOS profiles only work on DOS outputs, Radion profiles only work on Radion outputs, etc.

Note: Only certain types of outputs support percentages. For details, see this Neptune FAQ: https://forum.neptunesystems.com/showthread.php?20677-Using-percentages-in-programming

Operators are also listed in square brackets, separated by a slash: [>/<]

Examples:

If Input_name [>/<] ### Then [ON/OFF/Profile_Name/%] includes the following possible uses:

If Temp > 80.0 Then OFF
If Temp < 76.0 Then ON

### represents a numeric value, which may or may not include a decimal point.

Times are specified in hours, minutes, and seconds represented by H, M, and S respectively. Some commands use hours & minutes, some use minutes only, and others use minutes & seconds.

Examples:

If Time HH:MM To HH:MM Then [ON/OFF/Profile_Name/%]
OSC MMM:SS/MMM:SS/MMM:SS Then [ON/OFF/Profile_Name/%]
Defer MMM:SS Then [ON/OFF]

Apex Programming Command Reference

Set [ON/OFF/Profile_Name/%]


Set is used to unconditionally set an output state, and is commonly used as the first command in a program to set the default state prior to applying various conditions that would override that initial state.

For more details on the Set command, see: https://forum.neptunesystems.com/sh...d-This-Thread!&p=114462&viewfull=1#post114462

If Time HH:MM To HH:MM Then [ON/OFF/Profile_Name/%]

If Time is used to set an output state between a set of fixed times, inclusive of the start and end time.

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:

image3-4.png


For more details of the If Time command, see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

If DOW [SMTWTFS] Then [ON/OFF/Profile_Name/%]

The DOW command is used to set an output state based on the day of week. Each day is represented by a letter placeholder starting with Sunday and ending with Saturday. If a letter is listed, the command will evaluate True for that day. If a dash is substituted for a day, the command will evaluate False for that day.

Example:
If DOW SMT-TFS Then ON

This will turn the output ON each day of the week except for Wednesday, since Wednesday's placeholder is listed with a dash.

For more details of the DOW command, see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

If Input_Name [>/<] ### Then [ON/OFF/Profile_Name/%]

This command is used to measure the reading of a probe, including temperature, pH, ORP, salinity, dissolved oxygen, flow sensor, PAR sensor, Trident alkalinity, Trident calcium, or Trident magnesium.

If Output Output_Name = [ON/OFF] Then [ON/OFF/Profile_Name/%]

This command is used to react to the current state of an output, whether physical or virtual.

If Switch_Name [OPEN/CLOSED] Then [ON/OFF/Profile_Name/%]

This command is used to react to either an optical sensor, leak sensor, or a switch connected to a Breakout Box port.

If [FeedA/FeedB/FeedC/FeedD] MMM Then [ON/OFF/Profile_Name/%]

This command sets an output state when a Feed Cycle is activated. The MMM delay extends the output state for a number of minutes beyond the set time of the selected Feed Cycle.

For more details on If Feed, see my tutorial on Apex Feed Cycles: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-7-feed-cycles.715/

If Temp [>/<] [RT+/RT-] [###] Then [ON/OFF/PROFILE/%]

This command is used to set an output state based on the regional temperature defined in the Apex seasonal tables.

For more details on regional temperatures, see page 65 of the Apex Comprehensive Reference Guide: https://www.neptunesystems.com/downloads/docs/Comprehensive_Reference_Manual.pdf

If Sun [+/-] [MMM] / [+/-] [MMM] Then [ON/OFF/Profile_Name/%]

This command is used to set an output state based on the sunrise or sunset cycles defined in the Apex seasonal tables. The first timer is relative to sunrise, and the second timer is relative to sunset. A positive number delays the action to after the event, and a negative number proceeds the event.

For more details on If Sun, see page 66 of the Apex Comprehensive Reference Guide: https://www.neptunesystems.com/downloads/docs/Comprehensive_Reference_Manual.pdf

If Moon [+/-] [MMM] / [+/-] [MMM] Then [ON/OFF/Profile_Name/%]

This command is used to set an output state based on the moonrise or moonset cycles defined in the Apex seasonal tables. The first timer is relative to moonrise, and the second timer is relative to moonset. A positive number delays the action to after the event, and a negative number proceeds the event.

For more details on If Moon, see page 67 of the Apex Comprehensive Reference Guide: https://www.neptunesystems.com/downloads/docs/Comprehensive_Reference_Manual.pdf
For an example of If Moon usage, see my tutorial on Apex Lunar Schedule and Lighting Profiles: https://www.reef2reef.com/ams/neptu...sion-lunar-schedule-and-lighting-profiles.717

If Output Output_Name [Amps/Watts] [>/<] ### Then [ON/OFF/Profile_Name/%]

This command is used to react to the Amps or Watts currently consumed by an EB832 output. This does not apply to the older EB4, EB6, EB8, or the DC24 accessory outputs of the EB832.

For more details about the Amps/Watts programming, see my tutorial on Apex Power Monitoring: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-4-power-monitoring.698/

If Power [Power Probe] [ON/OFF] [###] Then [ON/OFF/Profile_Name/%]

This command is used to set an output state based on the detection of a power failure. The [Power Probe] is either the Apex or the name of an attached Energy bar.

For more details on If Power and instructions on how to integrate the Apex with a UPS backup battery, see my tutorial on Apex Power Monitoring: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-4-power-monitoring.698/

1599440886476.png

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

OSC is used to control an output on a repeating schedule. There are 3 timers:
  • Initial delay in minutes and seconds
  • minutes and seconds of actual run time
  • minutes and seconds of trailing delay
Example:
OSC 000:00/005:00/005:00 Then ON

This would turn on the output at midnight for 5 minutes, then turn it off for 5 minutes, and repeat indefinitely:

image3-1.png

For details and examples of the OSC command, see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

Defer MMM:SS Then [ON/OFF]

Defer delays switching an output from ON to OFF, or from OFF to ON. This command applies to the output after all the conditions have been evaluated. Only one Defer ON and one Defer OFF command can be used on an output. When the output changes from ON to OFF, only the Defer OFF timer is applied. When the output changes from OFF to ON, only the Defer ON timer is applied.

Example:

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:

image3-5.png


For details and more examples of Defer, see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

Min Time MMM:SS Then [ON/OFF]

Min Time forces an output to remain ON or OFF for a minimum amount of time regardless of the conditions evaluated in the programming. If the output is ON, only the Min Time Then ON timer is applied. If the output is OFF, only the Min Time Then OFF timer is applied.

For more details and examples of Min Time, see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

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

When is used to switch an output’s tile from AUTO to OFF or ON if a condition is met. This is the only command in the Apex programming language that can physically move an output tile's slider position on the dashboard, and once moved, manual intervention is required to set it back to AUTO before the programming will be resumed.

For more details and examples of When, see https://forum.neptunesystems.com/showthread.php?18393-Using-the-%91When%92-statement
Also see my tutorial on Apex Timers: https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-2-timers.689/

If Error Output_Name Then [ON/OFF]

The If Error command will evaluate True if the When timer described above is exceeded. For details about If Error, see https://forum.neptunesystems.com/showthread.php?18393-Using-the-%91When%92-statement

Fallback [ON/OFF/Profile_Name/%]

Fallback is used to set the output state in an AquaBus module when that module loses communications with the Apex.

For more details on Fallback, see https://forum.neptunesystems.com/showthread.php?8510-All-About-FALLBACK
Great info. Is there a Remark/Comment feature that I can use. I want to Remark out a line without deleting or changing it so I can test something and then easily fall back.
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 48 35.0%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 28 20.4%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 11 8.0%
  • I never have unwanted algae in my macroalgae.

    Votes: 10 7.3%
  • I don’t have macroalgae.

    Votes: 36 26.3%
  • Other.

    Votes: 4 2.9%
Back
Top