ATO & kalk code check

ToLearn

New member
Virtual outlets were created for three floats, sump low, sump high, and for when the ATO reservoir is empty to email me and stop the pumps from pulling. Two pumps will top off one with kalkwasser at night through a reactor the other just fresh water during the day. XWRONGX is a virtual outlet that triggers when things are really out of whack to keep a lot of different components from coming on.

I wanted to use an osc to give the floats time to react to the additions and so that not too much kalk or fresh water was added at a time.


ATO fresh water pump(aqualifter) on EB8 CH8:

Fallback OFF
Set OFF
OSC 000:04/000:06/000:00 Then ON
If Time 23:30 to 09:30 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF
Min Time 000:04 Then OFF


KW reactor (Minijet soon to be replaced by BRS top off doser) on EB8 CH4:
Note I may move the BRS top off doser to another outlet if I can get away with it.


Fallback OFF
Set OFF
OSC 000:06/000:04/000:00 Then ON
If pH > 08.25 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Time 11:30 to 23:30 Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF
Min Time 000:06 Then OFF
 
Couple comments;

1) The OSC parameters are in MM:SS, so you have them cycling very quickly.

2) Set OFF is redundant when using OSC, since it will always be unambiguous.

3) I find it useful to name my virtual outlets such that they specify a condition, where ON = True and OFF = False. So, I would use Sump_High, Sump_Low, Sump_OK, etc.

4) Min Time is also MM:SS. Min Time 00:04 Then OFF, will hold the outlet in the OFF state for four seconds before allowing it to change to ON. I think this will interfere with the OSC timing (as currently stated).

5) I would recommend using the Defer command within your float virtual outlets, with just enough time to buffer out any noise, rather than Min Time. I use about 10 seconds. You don't want to delay too long, especially if it is a critical condition.

Todd
 
So Min Time isn't really required if you use the osc starting with a time off right?

I don't think I want to add a defer command for testing purposes. All of the virtual outlets that connect to switches use thumbs as icons. On display page four I have the whole thing blank accept for the bottom icon line which has the first two as the two pumps I used for kalk and ATO(both spigets) and the rest are the virtual outlets. Pretty easy to test and see what is going on with thumbs up or down and based on those the spigets open and let water in or not.

Regardless Defer is still redundant if the osc code has a time off first right?

Here is my current fresh water during the day, ATO:

Fallback OFF
OSC 000:26/000:08/000:00 Then ON
If Time 23:30 to 09:30 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF

and my KWDoser for night:
Fallback OFF
OSC 000:28/000:08/000:00 Then ON
If pH > 08.25 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Time 11:30 to 23:30 Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF


Gotta run downstairs and make sure changing it to this didn't just cause a constant on, lol.
 
Last edited:
Oh and I hear you on:
3) I find it useful to name my virtual outlets such that they specify a condition, where ON = True and OFF = False. So, I would use Sump_High, Sump_Low, Sump_OK, etc.

Good call, just need to take some time and redo that and make sure things still operate.


Eventually I want to redo the timing a bit to allow it to do kalk more and fresh water all the time. I will just change the fresh water to be "OSC 002:26/000:08/000:00 Then ON" then if for some reason my pH gets high enough and stays high enough fresh water will be added all the time and no KW. I will be adding a 100g fuge soon, which may effect my pH. Of course I'll be monitoring everything carefully to see how frequent the outlets come one. Well once I can get my Apex updated to the newest firmware that lets me see that information.
 
So Min Time isn't really required if you use the osc starting with a time off right?

...

Regardless Defer is still redundant if the osc code has a time off first right?
Not sure redundant is the right word. It will interfere with your established cycle. If you set up a cycle to be ON/OFF for a specific duration, using Defer or Min Time is going to effectively delay or override that duration. Consider the analogy of a snooze button on an alarm clock. Keep in mind that Defer and Min time apply to the outlet as a whole, not individual conditional statements. If you need to use them only for certain conditions, you will need to use a virtual outlet.

Todd
 
If the statement reads:
OSC 000:28/000:08/000:00 Then ON
and during that first 28 second of off time, one of the other OFF statements becomes true for a second the timer will reset.

If using the defer code for 28 second on the virtual float outlet basically the same thing would happen right? It would have to be 28 seconds of all the conditions to be right in order for any water to be added.

Again if I used the defer code in the actual virtual outlet I will either have to create another virtual outlet for testing(I already have pages of them) or I can't test using the display screen and would have to set my browser to rapidly refresh in order to tell if a float was functioning correctly.

Not arguing at all just want to make sure that what I am saying is correct and that I understand the code I am using and that it will give me the result I am looking for.

It appeared to be functioning last night, but I did not stay with it long or pull on all the floats to fully test.

KW Reactor via BRS ATO doser

Fallback OFF
OSC 000:28/000:08/000:00 Then ON
If Time 11:30 to 23:30 Then OFF
If pH > 08.25 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF


Fresh 0ppm tds RODI via Tom's Aqualifter

Fallback OFF
OSC 000:26/000:06/000:00 Then ON
If Time 23:30 to 09:30 Then OFF
If Outlet BottomSumpFl = OFF Then OFF
If Outlet TopSumpFloat = OFF Then OFF
If Outlet ATOResEmpty = OFF Then OFF
If Outlet XWRONGX = ON Then OFF

BTW, I appreciate the insight and explanations. Still getting used to the Apex programming. More the merrier, help me figure this stuff out.
 
If the statement reads:
OSC 000:28/000:08/000:00 Then ON
and during that first 28 second of off time, one of the other OFF statements becomes true for a second the timer will reset.
No, the timer will not reset. If you have a OSC, it will create a continously repeating cycle. If a later statement sets the state to OFF, even though the OSC had just set it to ON, the outlet will be set to OFF, but the OSC cycle keeps running in the background. What I was referring to earlier about interferring with the cycle was from an end result point of view of how the outlet will behave.

If using the defer code for 28 second on the virtual float outlet basically the same thing would happen right? It would have to be 28 seconds of all the conditions to be right in order for any water to be added.
I don't recommend overly complicating the logic for the float virtual outlet. The float is a sensor that provides information about the tank. Using the Defer with a float switch is a compromise, you want to filter out some of the noise, but not so much that it is no longer an accurate data signal. Put the complex logic in the outlet for the device that responds to the float sensor.

The Defer and Min Time statements are evaluated last, regardless of where they appear in the code. So, after all the conditions have been evaluated, the pending state will determine how the Defer affects the outlet. So if the pending state is OFF and you have Defer 00:28 Then OFF, there will be a 28 second delay before the outlet will actually be set to OFF. That is why I was cautioning against using a Defer/Min Time with an OSC. The point of an OSC is to set up a specific timing cycle. Although internal timing would not change, the end result would. For example:

OSC 0/00:30/00:10 Then ON
Defer 00:20 Then ON

The cycle would normally be ON for 30 seconds and OFF for 10 seconds, but the Defer would cause a delay. The end result would be 10 seconds ON and 10 seconds OFF.

Todd
 
Ah damn. As I am understanding you it doesn't behave the way I expected it to. I thought the oscillate would start once all the conditions were true and if things held true for 28 seconds then it would kick on for the on duration and back again. :-( So the oscillate is always running. I was hoping part of the point of off/on/off was so you could tell it to be off first and then on, but I suppose the only point in it is to have two devices not on at the same time and you never know when it will be on or off just that the duration of off and on will hold the same.

I had asked about the order in which statements were evaluated in the past and didn't remember the answer or I may not have got one. I thought it was top down and had programmed that way. Didn't realize there was a hierarchy of what statements (rules for which are done first and which are done last). Has Neptune released a complete list of commands and the priority each are given? Or has anyone typed this up somewhere? Without this it makes coding even more complex and a lot of testing the system to see how it behaves is required.
 
Yes, in general, the priority is top to bottom, with a few exceptions. The Unofficial Users Guide has a thorough discussion of the commands and the overall programming approach.

The OSC is synchronized from 00:00 as long as the total duration of times is a factor of 1440 (24hrs). For instance OSC 000/10:00/50:00, total duration is 60 minutes. So this will be ON at 00:00, 1:00, 2:00,... and will stay synched. OSC 000/10:00/60:00, total duration is 70 minutes, and not evenly divisible into 1440. This will start out ON at 00:00, 1:10, 2:10, 3:10.....00:10, 2:20, 3:20...and continue to drift each day.

You can "override" the OSC cycle effect on the outlet, but like I said the cycle is maintained. Looking at a portion of your kalk outlet:

OSC 000:28/000:08/000:00 Then ON
If Time 11:30 to 23:30 Then OFF
If pH > 08.25 Then OFF
If Outlet BottomSumpFl = OFF Then OFF

The OSC will be cycling ON/OFF, lets say that it has set the pending state to ON. Next it will evaluate the time, if that statement is false, it is skipped. Next the pH statement is evaluated, if false, it is skipped. Finally, the last statement is evaluated and lets say it is true, then the pending state is set to OFF. Since there are no other statements, the actual state is set to the pending state, or OFF in this example. This process repeats continually, and of coarse the outcome depends on the various conditions as they change.

Todd
 
Back
Top