Jump to content
Sign in to follow this  
tom39

Apex pump programming

Recommended Posts

If you would, please critique the below program that I am looking to use to program a pump.

 

1. The output is to remain off until triggered by the action of a virtual switch (MAINT_WC).

 

2. Once triggered, the output is to remain off or defer for 60 sec

 

3. After the 60 sec defer period, the output would turn on for 4 min, then remain off.

 

Here is the programming -

 

Fallback OFF

 

Set OFF

 

If Output MAINT_WC = ON Then ON

 

Defer 001:00 Then ON

 

Min Time 005:00 Then OFF

 

Thanks for looking,

 

Tom G

 

Sent from my SM-G930V using Tapatalk

Share this post


Link to post
Share on other sites

Where is this pulling water from?

 

Would you want failsafes like floor sensors or float switches to override if it didn’t go according to plan

 

 

Sent from my iPhone using Tapatalk

Share this post


Link to post
Share on other sites

Where is this pulling water from?

 

Would you want failsafes like floor sensors or float switches to override if it didn’t go according to plan

 

 

Sent from my iPhone using Tapatalk

The pump is pulling water from my sump and sending it down the drain.

I have an ADL and a sump pan but atm I am manually refilling. So at this point there is no chance for a flood.

 

Sent from my SM-G930V using Tapatalk

Share this post


Link to post
Share on other sites

I don't think this part will work with how you described:

 

Defer 001:00 Then ON

Tou are correct, it doesn't work.

I realized that my thought process using a defer statement was flawed. Once i figured that out I started over.

I worked on the programming for a few hours last night and I have made a few adjustments to this and other program statements and also added in a second virtual switch with statements that are mainly used as a timer for other switches.

 

 

 

 

Sent from my SM-G930V using Tapatalk

Share this post


Link to post
Share on other sites

With a bit more tweeking, I finally finished my automatic water change programming.

So now to do a water change the hardest part of the whole thing is carrying the water into the house but soon I will automate the refill end of it and then I will be able to sit on the couch and not have to hardly lift a finger.

 

Anyway, here is the final programming for all of my outlets - 

 

MAINT_WC (1st Virtual Switch)
Fallback OFF
Set OFF

 

MAINT_WC2 (2nd Virtual switch)
Fallback OFF
Set OFF
If Output MAINT_WC = ON Then ON
Defer 005:00 Then ON

Water change pump
Fallback OFF
Set OFF
If Output MAINT_WC = ON Then ON
If Output MAINT_WC2 = ON Then OFF
Defer 001:00 Then ON
Defer 000:10 then OFF

 

Return Pump
Fallback ON
Set ON
If Output MAINT_WC = ON Then OFF
If Output MAINT_WC = OFF Then ON
Defer 000:05 Then OFF
Defer 000:05 Then ON

 

PS Feed
Fallback ON
Set ON
If Output MAINT_WC = ON Then OFF
If Output MAINT_WC = OFF Then ON
Defer 000:15 Then OFF
Defer 000:45 Then ON

ATS Feed
Fallback ON
Set ON
If Output MAINT_WC = ON Then OFF
If Output MAINT_WC = OFF Then ON
Defer 000:10 Then OFF
Defer 000:30 Then ON

Main Heater
Fallback OFF
Set OFF
If D_Tmp < 79.0 Then ON
If D_Tmp > 80.0 Then OFF
If Output MAINT_WC = ON Then OFF 
Defer 001:00 Then ON

 

Secondary Heater
Fallback OFF
Set OFF
If D_Tmp < 77.0 Then ON
If D_Tmp > 78.0 Then OFF
If Output MAINT_WC = ON Then OFF
Defer 001:00 then ON

ATO
Fallback OFF
Set OFF
If ATO_5_ CLOSED Then ON
If ATO_5_ OPEN Then OFF
If Output MAINT_WC = ON Then OFF
Defer 002:00 Then ON
Min Time 010:00 Then OFF

Share this post


Link to post
Share on other sites

A couple of questions/comments on your programming. 

 

  • Why do you have the two virtual outlets?
  • Many of the outlets you have unneeded redundancy (it doesn't add redundancy, it just makes the code hard to read) for example:

Return Pump
Fallback ON
Set ON
If Output MAINT_WC = ON Then OFF
If Output MAINT_WC = OFF Then ON
Defer 000:05 Then OFF
Defer 000:05 Then ON

 

You don't need both of these:

If Output MAINT_WC = ON Then OFF
If Output MAINT_WC = OFF Then ON

 

Because you have the "Set ON" statement.  So whenever the MAIN_WC is OFF, the outlet will be "SET ON".    I am also not sure why you have Two Defer statements:

 

Defer 000:05 Then OFF

Defer 000:05 Then ON

 

When using the "Defer" statement,  Defer 05:00 Then OFF =  Defer the OFF state for 05 minute. (ON would be immediate). You also have the Set On statement so the Outlet would be "On" if any of the statements below it are false. Instead of a second "Defer" you could use the "Min" statement.  ie Min Time 5:00 Then OFF = Minimum Time of 5 minutes in the OFF state. (ON would be immediate).

 

For the heater statements, you don't need the Set "OFF".  Your Main Heater:

Fallback OFF
Set OFF
If D_Tmp < 79.0 Then ON
If D_Tmp > 80.0 Then OFF

 

What will happen when using the Set command with a heater is that this program will not cause the outlet to operate over the desired range of temperature; instead, it will operate around a single temp of ~ 78.9 degrees. If the temp drops to 78.9, the heater outlet will turn ON, and it will shut off as soon as the temp goes up to 79.0. TheIf D_Tmp > 80.0 statement does nothing here, because the Set OFF will be the only true statement as soon as the temp goes up to 79.0. The result will be that your heater gets switched on and off fairly rapidly.  If you want a cleaner code and the temp to stay at 80, then just use this:

If D_Tmp < 79.0 Then ON
If D_Tmp > 80. Then OFF

 

The heater will turn ON until the temp hits 80 and then will turn off, it will stay off until the temp goes to 79 again and will turn On until the temp exceeds 80.

 

I think in your case you may want to look at incorporating the "when"  or "and" statements: for example:

The  'When' will be an force an output to the OFF state if it has been ON for more than a specified duration:
 

When On > 005:00 Then OFF

 

For using the "AND" command, for the outlet you need to turn off  if both virtual outelts are true: ie:

XandY
Set OFF
If  X = ON Then ON
If  Y = OFF Then OFF

Then add

If Outlet XandY = ON Then OFF

 

Hopefully it all makes sense and I understood what you were trying to do in your code.  If you need more info:

for AND:

https://forum.neptunesystems.com/showthread.php?7057-How-to-incorporate-AND-in-your-programming

 

for WHEN:

https://forum.neptunesystems.com/showthread.php?18393-Programming-enhancements-in-Apex-(2016)-AOS-v5-02-and-Apex-Classic-Firmware-4-52

 

For the DEFER and MIN TIME:

https://forum.neptunesystems.com/showthread.php?52-Defer-and-Min-Time-statements

 

For the SET command:

https://forum.neptunesystems.com/showthread.php?14598-New-APEX-Users-Read-This-Thread!

 

And general programming usage:

 

https://forum.neptunesystems.com/forumdisplay.php?33-Misc-Apex-Usage-amp-Programming

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×