lost in the ATK code

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
hello I am reading this great Neptune manual and I got ,I got lost
Fallback OFF
Set OFF
1 If ATK_LO OPEN Then ON
2 If ATK_HI CLOSED Then OFF
3 When On > 005:00 Then OFF
4 Defer 000:10 Then ON
5 Defer 000:04 Then OFF
6 Min Time 060:00 Then OFF

so, here is how I see it

water level is below sensor number "1" so the sensor is open line 1 TURE
going to line 2, line 2 is FALSE,
going to line 3 . because line 1 is TRUE , sensor is open, the 3 is TRUE and it will start counting 5 minutes, and it will close the outlet after 5 minutes
going to line 4 , it will count 10 seconds for Open sensor "1" if it is open for 10 second, it will finally TURN ON the outlet

and I am lost now, is the code starting from 1 gain , the 5 minutes is counting down
or line 6 is taken? if line sic is taken, then when ?

from the code I understand it ( wrong)
line 4 waited 10 second, and turned ON the outled
then it waited 4 second to turn it OFF again ? and waited 60 minute? noooo

I dont see how what is happening between line 4 and 5
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
I did, and i don't get the second deeper

That's why i and asking for a clarification
I red it many times
, I know what you are saying the the manual, forget your example. I just don't get how apex I read the code here

It goes to first defer and wants 10 seconds, ok still open let's turn the outlet on
And what is happening next ?
Checking the status again ? Why

Or going to second defer , coz if it goes, it will count 4 seconds and stop the outlet.
 

MarshallB

Active Member
View Badges
Joined
Dec 29, 2019
Messages
438
Reaction score
595
Rating - 0%
0   0   0
hello I am reading this great Neptune manual and I got ,I got lost
Fallback OFF
Set OFF
1 If ATK_LO OPEN Then ON
2 If ATK_HI CLOSED Then OFF
3 When On > 005:00 Then OFF
4 Defer 000:10 Then ON
5 Defer 000:04 Then OFF
6 Min Time 060:00 Then OFF

so, here is how I see it

water level is below sensor number "1" so the sensor is open line 1 TURE
going to line 2, line 2 is FALSE,
going to line 3 . because line 1 is TRUE , sensor is open, the 3 is TRUE and it will start counting 5 minutes, and it will close the outlet after 5 minutes
going to line 4 , it will count 10 seconds for Open sensor "1" if it is open for 10 second, it will finally TURN ON the outlet

and I am lost now, is the code starting from 1 gain , the 5 minutes is counting down
or line 6 is taken? if line sic is taken, then when ?

from the code I understand it ( wrong)
line 4 waited 10 second, and turned ON the outled
then it waited 4 second to turn it OFF again ? and waited 60 minute? noooo

I dont see how what is happening between line 4 and 5
4. Wait 10 seconds to make sure its still OK to turn on.
5. Wait 4 seconds to make sure its time to turn off.
Min time, if the ATO runs more than 60 minutes then shut it off

These lines make sure the sensors are actually reporting their state and it isn't just quick blips. Final line is an ultimate fail safe.

Also, i prefer to swap 1 and 2.
1. if ATK_LO CLOSED then OFF
2. if ATK_HI OPEN then ON

basically any time ATK_LO switches to open the ATK kicks in until 1. ATK_LO turns to closed. 2. ON > 5 Minutes or finally ATK_HI switches to closed.
 
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
4. Wait 10 seconds to make sure its still OK to turn on.
5. Wait 4 seconds to make sure its time to turn off.
Min time, if the ATO runs more than 60 minutes then shut it off

These lines make sure the sensors are actually reporting their state and it isn't just quick blips. Final line is an ultimate fail safe.

Also, i prefer to swap 1 and 2.
1. if ATK_LO CLOSED then OFF
2. if ATK_HI OPEN then ON

basically any time ATK_LO switches to open the ATK kicks in until 1. ATK_LO turns to closed. 2. ON > 5 Minutes or finally ATK_HI switches to closed.
Sorry
I still don't get ii understand what the code is doing i am just trying to figure how apex interpret the code

Line 4. Waits 10 seconds if it is still OK then what? Gooes to line 5? To wait 4 second an turn off?

How does it know that 4 is for open condition and 5 for closed
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
OK, I'll try to break it down for you. Bear with me, this is lengthy as it covers all the possible conditions:

The Apex processes the program once every second. On each pass, it evaluates all of the "Set" and "If" conditions. All of the "When", "Defer", and "Min Time" commands are only applied after the above conditions are evaluated.

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


For example, let's look at what it does when the water level is currently normal, and the PMUP is not running:

image4-2.png


The lines of code in light gray color are not conditions that determine the desired output state.

Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- False
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 060:00 Then OFF


Now, let's say the water drops below the lower sensor for the first time:

image4-3.png

Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but has to wait for the Defer to complete its countdown
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON <-- Starts counting down before allowing it to turn On
Defer 000:04 Then OFF
Min Time 060:00 Then OFF


If the water level happens to go back up and touch the ATK_LO sensor before the Defer timer expires, then the timer resets and we're back to the normal condition shown at the top of this post.

But if the water level remains below the ATK_LO sensor until the full 10 second Defer timer has reached zero, then the output turns On and the PMUP starts the flow of water. At this point, the When timer begins its 5 minute countdown while the PMUP is running. This timer is just acting as a failsafe in case the water level doesn't return to normal within 5 minutes. You should adjust this value based on the size of your tank, your normal amount of evaporation, and the time you'd consider normal to refill your tank. You only ever want this timer to be exceeded if something malfunctions, because it moves the output's dashboard slider from AUTO to OFF.


Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF <-- 5 minute safety countdown timer begins
Defer 000:10 Then ON <-- Countdown completed, output finally turns On

Defer 000:04 Then OFF
Min Time 060:00 Then OFF


Once the water fills back up to the ATK_LO sensor, the pump turns Off again:

image4-2.png


Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- False
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF

Min Time 060:00 Then OFF <-- 60 minute countdown begins. The output cannot turn on again until expired, regardless of the water level.

The Min Time delay is designed to prevent the PMUP from running every minute or two. Instead, it waits 1 hour in between refill attempts. You can adjust this lower if you choose. I prefer 30 minutes on mine.

Let's say the water level drops again, but the Min Time 60 minute timer has not yet reached zero:

Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but isn't allowed until the Min Time timer expires
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF

Min Time 060:00 Then OFF <-- Timer still active, so the output cannot turn on

Once the Min Time reaches zero, the output turns On and the cycle starts all over again from the top:

image4-3.png

Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but has to wait for the Defer to complete its countdown
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON <-- Starts counting down before allowing it to turn On
Defer 000:04 Then OFF
Min Time 060:00 Then OFF



I hope this clarifies it for you.
 
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
OK, I'll try to break it down for you. Bear with me, this is lengthy as it covers all the possible conditions:

The Apex processes the program once every second. On each pass, it evaluates all of the "Set" and "If" conditions. All of the "When", "Defer", and "Min Time" commands are only applied after the above conditions are evaluated.

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


For example, let's look at what it does when the water level is currently normal, and the PMUP is not running:

image4-2.png


The lines of code in light gray color are not conditions that determine the desired output state.

Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- False
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 060:00 Then OFF


Now, let's say the water drops below the lower sensor for the first time:

image4-3.png

Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but has to wait for the Defer to complete its countdown
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON <-- Starts counting down before allowing it to turn On
Defer 000:04 Then OFF
Min Time 060:00 Then OFF


If the water level happens to go back up and touch the ATK_LO sensor before the Defer timer expires, then the timer resets and we're back to the normal condition shown at the top of this post.

But if the water level remains below the ATK_LO sensor until the full 10 second Defer timer has reached zero, then the output turns On and the PMUP starts the flow of water. At this point, the When timer begins its 5 minute countdown while the PMUP is running. This timer is just acting as a failsafe in case the water level doesn't return to normal within 5 minutes. You should adjust this value based on the size of your tank, your normal amount of evaporation, and the time you'd consider normal to refill your tank. You only ever want this timer to be exceeded if something malfunctions, because it moves the output's dashboard slider from AUTO to OFF.


Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF <-- 5 minute safety countdown timer begins
Defer 000:10 Then ON <-- Countdown completed, output finally turns On

Defer 000:04 Then OFF
Min Time 060:00 Then OFF


Once the water fills back up to the ATK_LO sensor, the pump turns Off again:

image4-2.png


Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- False
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF

Min Time 060:00 Then OFF <-- 60 minute countdown begins. The output cannot turn on again until expired, regardless of the water level.

The Min Time delay is designed to prevent the PMUP from running every minute or two. Instead, it waits 1 hour in between refill attempts. You can adjust this lower if you choose. I prefer 30 minutes on mine.

Let's say the water level drops again, but the Min Time 60 minute timer has not yet reached zero:

Fallback OFF
Set OFF -- True <-- the last line that's True, so the output is Off
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but isn't allowed until the Min Time timer expires
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF

Min Time 060:00 Then OFF <-- Timer still active, so the output cannot turn on

Once the Min Time reaches zero, the output turns On and the cycle starts all over again from the top:

image4-3.png

Fallback OFF
Set OFF -- True
If ATK_LO OPEN Then ON -- True <-- the last line that's True, so the output wants to turn On, but has to wait for the Defer to complete its countdown
If ATK_HI CLOSED Then OFF -- False
When On > 005:00 Then OFF
Defer 000:10 Then ON <-- Starts counting down before allowing it to turn On
Defer 000:04 Then OFF
Min Time 060:00 Then OFF



I hope this clarifies it for you.
Hi

I really appreciate that, its is perfect.
Just 1 question, ,
When the second defer 4 seconds takes action ?
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
Hi

I really appreciate that, its is perfect.
Just 1 question, ,
When the second defer 4 seconds takes action ?
Sorry, I should have listed the Defer 004:00 Then OFF statement in my writeup.

When the output is currently On, but a condition is finally met to turn it Off, then the Defer OFF timer begins its countdown. The output will remain in the On state until the Defer OFF timer reaches zero, then it will finally turn Off.

Each output program is allowed at most one Defer ON, and one Defer OFF statement. Defer only begins its countdown when an output tries to transition from Off to ON, or On to OFF, and the corresponding Defer timer is applied.

In the case of the ATK programming, the default is to wait for 10 seconds of water level stability before turning On the pump, and 4 seconds of water level stability before turning Off:

Defer 000:10 Then ON
Defer 000:04 Then OFF
 
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
Sorry, I should have listed the Defer 004:00 Then OFF statement in my writeup.

When the output is currently On, but a condition is finally met to turn it Off, then the Defer OFF timer begins its countdown. The output will remain in the On state until the Defer OFF timer reaches zero, then it will finally turn Off.

Each output program is allowed at most one Defer ON, and one Defer OFF statement. Defer only begins its countdown when an output tries to transition from Off to ON, or On to OFF, and the corresponding Defer timer is applied.

In the case of the ATK programming, the default is to wait for 10 seconds of water level stability before turning On the pump, and 4 seconds of water level stability before turning Off:

Defer 000:10 Then ON
Defer 000:04 Then OFF
Ohh perfect,
You really put some efforts and went the extra mile .
I do appreciate it a lot
I wish I could nominate you for the best answer contest:)
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,217
Location
Oregon
Rating - 0%
0   0   0
Ohh perfect,
You really put some efforts and went the extra mile .
I do appreciate it a lot
I wish I could nominate you for the best answer contest:)
Glad to help.

I know you've read my ATK tutorial, but in case you haven't seen the others in my collection, here's a link to all my Apex tutorials:

 
OP
OP
A

aerialdronemaster

Active Member
View Badges
Joined
Apr 12, 2020
Messages
266
Reaction score
79
Rating - 0%
0   0   0
Glad to help.

I know you've read my ATK tutorial, but in case you haven't seen the others in my collection, here's a link to all my Apex tutorials:

I will read it all.
I really want to understand it as much as i van it is very interesting, I love the apex , it is amazing tool, honestly it is one of the reasons why I upgraded my tank, haha,

Those extra toys , monitoring , it is really amazing .
When I started my reef tank journey, a year ago, i was amazed how advanced it is.
I remember my fresh water tank that I had hmm 25 years ago, comparing that tank to today's technology, ufff
 

Reefing threads: Do you wear gear from reef brands?

  • I wear reef gear everywhere.

    Votes: 16 18.8%
  • I wear reef gear primarily at fish events and my LFS.

    Votes: 3 3.5%
  • I wear reef gear primarily for water changes and tank maintenance.

    Votes: 0 0.0%
  • I wear reef gear primarily to relax where I live.

    Votes: 13 15.3%
  • I don’t wear gear from reef brands.

    Votes: 45 52.9%
  • Other.

    Votes: 8 9.4%
Back
Top