PDA

View Full Version : Is this code sound?


RiddleEagle18
09/20/2012, 08:16 PM
This is for a dual float switch system. Lower switch closed means low water. Upper switch open means to much water. The flow is pretty good so I dont want it on for more than 2 mins. I also dont want the pump to turn on for 1 min after the return pump is turned back on and for atleast 3 mins after a power failure and restore.

ATO_PUMP
Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF 001 Then OFF
If Power EB8_4 Off 003 Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 003:00 Then ON
Min Time 010:00 Then OFF

Limit_ATO
Set OFF
If Switch1 CLOSED Then ON
Defer 002:00 Then ON

RiddleEagle18
09/20/2012, 08:33 PM
Plus I want an email if Limit_ATO is on but only during the day. so I made another outlet with this and added it to me email alert.

Lmt_ATO_Aler
Set OFF
If Outlet Limit_ATO = ON Then ON
If Time 21:00 to 09:00 Then OFF

swearint
09/20/2012, 08:34 PM
This is for a dual float switch system. Lower switch closed means low water. Upper switch open means to much water. The flow is pretty good so I dont want it on for more than 2 mins. I also dont want the pump to turn on for 1 min after the return pump is turned back on and for atleast 3 mins after a power failure and restore.

ATO_PUMP
Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF 001 Then OFF
If Power EB8_4 Off 003 Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 003:00 Then ON
Min Time 010:00 Then OFF

Limit_ATO
Set OFF
If Switch1 CLOSED Then ON
Defer 002:00 Then ON

The highlight portion is not valid syntax. But it is not needed anyway. Your Defer will prevent the ATO from turning ON for three minutes after any condition that had turned it OFF is no longer true. Then there is the Power command. That is correct syntax, but the delay will combine with the Defer such that the ATO would not be able to activate for at least six minutes after power is restored. Then on top of that you have the Min Time command that, when turned OFF, will hold it in that state for at least 10 minutes before allowing it to turn back ON. I believe that will supersede everything else since it is the longest duration.

Todd

RiddleEagle18
09/20/2012, 08:40 PM
Thanks todd. I pulled the other delays out. 10 mins should be plenty for everything to stabilize after any of those conditions.

This is for a nano so the ATO scares the crap out of me.


Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF Then OFF
If Power EB8_4 Off Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 003:00 Then ON
Min Time 010:00 Then OFF

RiddleEagle18
09/20/2012, 08:42 PM
One last thing. If switch 1 and 2 get stuck and the limit_ATO kicks in it will stay in that condition until I reset it correct.

RiddleEagle18
09/20/2012, 08:52 PM
I also just realized another issue. I had ATO_Limit on a 2 min defer off of switch 1 and the ATO_PUMP on a 3 min defer based on switch 1. It would have never turned on. So ill change ATO_Limit to

ATO_Limit
Set OFF
If Switch1 CLOSED Then ON
Defer 005:00 Then ON

worm5406
09/20/2012, 09:27 PM
ATO_Limit
Set OFF
If Switch1 CLOSED Then ON
Defer 005:00 Then ON


Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF Then OFF
If Power EB8_4 Off Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 003:00 Then ON
Min Time 010:00 Then OFF

The naming looks incorrect... Limit_ATO and ATO_Limit

These are supposed to match to make it run correct, right?

RiddleEagle18
09/21/2012, 04:47 AM
Ok correct code I think :-)

ATO_Pump
Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF Then OFF
If Power EB8_4 Off 003 Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 001:00 Then ON
Min Time 010:00 Then OFF

Limit_ATO
Set OFF
If Switch1 CLOSED Then ON
Defer 003:00 Then ON


Lmt_ATO_Aler
Set OFF
If Outlet Limit_ATO = ON Then ON
If Time 21:00 to 09:00 Then OFF

Clubbinaz
09/21/2012, 05:14 PM
Min Time 010:00 <~~ you want it on for a minimum of ten minutes?

Clubbinaz
09/21/2012, 05:22 PM
Here's my very much working top off code

TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON

Virtual Switchx5_1 <~~ The main on/off switch , or the bottom one
Fallback OFF
Set OFF
If Switchx5_1 CLOSED Then OFF
If Switchx5_1 OPEN Then ON
If Salt < 34.9 Then OFF

Virtual Switch5_2 <~~ backup high water switch
Fallback OFF
Set OFF
If Switchx5_2 OPEN Then ON

I have two floats as well but only 1 controls the main on/off of the ATO and it runs for 7 seconds at a time for no more than 10 per hour . The second float is a backup shut off.

RiddleEagle18
09/21/2012, 05:26 PM
Min Time 010:00 <~~ you want it on for a minimum of ten minutes?

No that code prevents it from turning back on for 10 mins after any of the OFF commands are fulfilled.

RiddleEagle18
09/21/2012, 05:34 PM
double post.

RiddleEagle18
09/21/2012, 05:37 PM
When you put this code in yours "Min Time 000:07 Then ON" were you trying to prevent the outlet from turning on for 7 seconds after the switch closed? Because if that was your intent then you wanted the DEFER code.

I think you have you MIN and DEFER coding mixed up because the way you have it right now your pump will be prohibited from tuning on for 7 seconds after it was turned off.


Take for example this coding from the user guide for metal halide lighting.


"Min Time [DURATION] Then [ON/OFF]
The “Min Time” statement prevents the outlet from turning ON or OFF again for a certain amount of time that
you specify (MMM:SS). It keeps it in its current state and prevents it from changing state for a certain amount of
time. It doesn‟t stop it from turning ON/OFF now nor does it regulate the amount of time an outlet runs. It just
forces the outlet to stay in its current state.
A common use is with metal halide lights. If you have a brief power failure that kills your lights, you don‟t want
them trying to turn back on immediately. You want them to cool down for 5 or 10 minutes first, to avoid
damaging the bulbs. You can use the Min Time statement for that. Or consider a top-off where you don‟t want
the top-off happening again for a certain amount of time even if the outlet wants to. The Min Time statement is
perfect for that. You could use it as follows at the end of your MH outlet statements:

Fallback ON
Set OFF
If Time 08:00 to 19:00 Then ON
Min Time 010:00 Then OFF


The Min Time statement applies to the entire outlet not individual statements."

Clubbinaz
09/21/2012, 06:01 PM
That part was a suggestion from Neptune Systems. I guess they could have misunderstood, but it appears to be functioning correctly. Don't know. But I will soon!!

swearint
09/21/2012, 07:16 PM
Here's my very much working top off code

TOPOFF OUTLET
Fallback OFF
Set OFF
OSC 000:00/000:10/059:50 Then ON
If Switchx5_1 OPEN Then ON
If Switchx5_1 CLOSED Then OFF
If Switchx5_2 OPEN Then OFF
Min Time 000:07 Then ON

The highlighted code is not doing anything for you. Because the Apex executes top to bottom, later code has higher priority. Since Switchx5_1 will either be ON or OFF, it will supersede any prior code. The Min Time command will hold it ON for at least 7 seconds before allowing it to turn OFF.

One other thing, although you have defined virtual outlets, you don't appear to be referencing them in the TopOff outlet. You need to use the If Outlet .... Command. I would name them something meaningful as well.

Todd

RiddleEagle18
09/22/2012, 08:32 PM
Instead of

Limit_ATO being triigered by switch1 like this.

Set OFF
If Switch1 CLOSED Then ON
Defer 003:00 Then ON


Can I make it like this
Set OFF
If Outlet ATO_Pump on then on
Defer 003:00 then on

The issue I have been running into is that my pump wants to turn on ever 15 mins or so. Well sometimes it wants to turn back on right away but my MIN 010:00 statement prevent thats. Switch1 ends up being open for 3 mins before the pump even has a chance to kick back on which means Limit_ATO kicks on and prevents the pump from turning back on.

I could solve this by lowering my min time statement to 005:00 but I would rather have it not turn on so frequently.

RiddleEagle18
09/23/2012, 08:31 AM
Ok I did some searching and found the answer. This thing is so cool once you start to understand exactly how it works and the coding.


So to restate for anyone with similar issues.

I have a dual float switch in my sump area. Switch1 is low water and switch2 is high water. I want the ATO_Pump OFF anytime the return pump is off or power lost the the EB8 and for 10 mins afterward to allow for the water to stabilize. I also dont want the ATO_Pump to turn on more than 1 every 10 mins. This is a nano so I dont want the pump to run for more than 2 mins max and if it does I dont want it to turn on again until I reset it. I want an email if Limit_ATO or switch2 is activated but not during the night. I accomplished all of this with several virtual outlets.


ATO_Pump
Fallback OFF
Set OFF
If Switch1 CLOSED Then ON
If Switch2 OPEN Then OFF
If Outlet ReturnPump = OFF Then OFF
If Power EB8_4 Off 003 Then OFF
If Outlet Limit_ATO = ON Then OFF
Defer 001:00 Then ON
Min Time 010:00 Then OFF

Limit_ATO
If Outlet ATO_Pump = ON Then ON
Defer 002:00 Then ON
If Outlet Err_Reset = ON Then OFF

Err_Reset
Set OFF

Alt_Lmt_ATO
Set OFF
If Outlet Limit_ATO = ON Then ON
If Time 21:00 to 09:00 Then OFF

Alt_Switch2
Set OFF
If Switch2 OPEN Then ON
If Time 21:00 to 09:00 Then OFF

EmailAlm_l5
Set OFF
If Outlet Alt_Temp = ON Then ON
If Outlet Alt_Lmt_ATO = ON Then ON
If Outlet Alt_Switch2 = ON Then ON



Im starting to really like my purchase!
:spin3::spin3::spin3::spin3::spin3::spin3:

swearint
09/23/2012, 02:18 PM
I would avoid referencing the ATO_Pump outlet within the Limit_ATO outlet. This creates a circular reference, where A depends on B which depends on A. You might get away with it since there are some delays in the code, but in general this can cause issues. Its better the way you had it before, referencing Switch1.

Todd

RiddleEagle18
09/23/2012, 06:51 PM
Referencing Switch1 was creating a problem for me. Thats why I created the Err_Reset. This way it wont loop.

What other issues could it cause that Im missing. Still trying to learn all the intricacies.