I've searched the forums and have seen a lot of great code samples that are close but not exactly what I'm looking to, and am hoping someone out there can help me with the last mile of getting the code to fit.
I have a 265g reef with a 20g saltwater reservoir for water changes. I have a dosing computer that is doing daily small water changes but want to set up the ability on the weekend to mix up a batch of saltwater, press a momentary button and use my two new PMUPs to automatically change out 15-16 gallons or so.
I have installed the PMUPs and have tested their flow rates. The NSW PMUP has more head pressure so it pumps at exactly half the rate of the OSW PMUP. The NSW does a gallon in 1 min. 30 sec. The OSW does a gallon in 45 seconds.
The sequence I'm looking for is:
- press button
- skimmer and ATO turn off (return pumps stay running because my NSW pumps into the display tank to avoid a siphon situation and my OSW pumps from the sump, but I may later add a command to turn off the return)
- NSW PMUP starts pumping (I want to give it a head start since it's the slower of the two. I'll play with the lead time but, for this thread, assume 8 minutes)
- 8 minutes later the OSW PMUP starts
- the NSW PMUP runs a total of 24 minutes (pumping in 16 gallons)
- the OSW PMUP runs a total of 12 minutes (for 16 gallons)
- 5 minute delay to let things settle down
- ATO and Skimmer turn back on.
So I've created a virtual outlet called Hold_AWC and have programmed it to switch ON when a button on my BOB (Swx14_4) is CLOSED with the following code:
Hold_AWC
Set OFF
If Swx14_4 CLOSED Then ON
Defer 024:00 Then OFF
My plan is to use the following code for the ATO and Skimmer:
ATO
Fallback ON
Set ON
If FeedA 030 Then OFF
If Outlet Return_Pump = OFF Then OFF
If Outlet Hold_ATO = ON Then OFF
If Outlet Hold_AWC = ON Then OFF
Defer 005 Then ON
Skimmer
Fallback ON
Set ON
If FeedA 010 Then OFF
If Outlet Hold_ATO = ON Then OFF
If Outlet Hold_AWC = ON Then OFF
Defer 005 Then ON
[Note: On the ATO and Skimmer, the Hold_ATO command line is unrelated to this thread. That just allows me to kill the skimmer and ATO for 2 hours with a separate button (like when I'm siphoning the bottom of the sump or doing anything that messes with the water level). The pertinent line for this thread is the Hold_AWC line. Sorry for the close names.]
To activate the two PMUPs, I plan to use the following:
NSW_PMUP
Fallback OFF
Set OFF
If Outlet Hold_AWC = ON Then On
OSW_PMUP
Fallback OFF
OSC 008:00/012:00/0 Then ON
If Outlet Hold_AWC = OFF Then OFF
I think the way these will work is that, when I press the button and switch Hold_AWC to ON, the NSW_PMUP will immediately kick on and will stay on for the full 24 minutes and then will turn off.
Meanwhile, I think (and hope) that OSW_PMUP will operate as follows: When I haven't pressed the button (ie, most of the time), it will read the OSC statement but then the final line will keep it from turning on so it will rest in OFF. But when I press the button, for the next 24 minutes, the conditional statement in the last line is not true so it has no effect. In its absence, the OSC statement keeps the pump off for 8 minutes and then turns it on for 12 minutes, then back to off for the remaining 4 minutes of the Hold_AWC cycle. Then it goes back to resting in OFF because of the last line of code being true.
I struggle with OSC statements and am far from an expert on Apex code generally so I welcome any and all input.
Thanks,
I have a 265g reef with a 20g saltwater reservoir for water changes. I have a dosing computer that is doing daily small water changes but want to set up the ability on the weekend to mix up a batch of saltwater, press a momentary button and use my two new PMUPs to automatically change out 15-16 gallons or so.
I have installed the PMUPs and have tested their flow rates. The NSW PMUP has more head pressure so it pumps at exactly half the rate of the OSW PMUP. The NSW does a gallon in 1 min. 30 sec. The OSW does a gallon in 45 seconds.
The sequence I'm looking for is:
- press button
- skimmer and ATO turn off (return pumps stay running because my NSW pumps into the display tank to avoid a siphon situation and my OSW pumps from the sump, but I may later add a command to turn off the return)
- NSW PMUP starts pumping (I want to give it a head start since it's the slower of the two. I'll play with the lead time but, for this thread, assume 8 minutes)
- 8 minutes later the OSW PMUP starts
- the NSW PMUP runs a total of 24 minutes (pumping in 16 gallons)
- the OSW PMUP runs a total of 12 minutes (for 16 gallons)
- 5 minute delay to let things settle down
- ATO and Skimmer turn back on.
So I've created a virtual outlet called Hold_AWC and have programmed it to switch ON when a button on my BOB (Swx14_4) is CLOSED with the following code:
Hold_AWC
Set OFF
If Swx14_4 CLOSED Then ON
Defer 024:00 Then OFF
My plan is to use the following code for the ATO and Skimmer:
ATO
Fallback ON
Set ON
If FeedA 030 Then OFF
If Outlet Return_Pump = OFF Then OFF
If Outlet Hold_ATO = ON Then OFF
If Outlet Hold_AWC = ON Then OFF
Defer 005 Then ON
Skimmer
Fallback ON
Set ON
If FeedA 010 Then OFF
If Outlet Hold_ATO = ON Then OFF
If Outlet Hold_AWC = ON Then OFF
Defer 005 Then ON
[Note: On the ATO and Skimmer, the Hold_ATO command line is unrelated to this thread. That just allows me to kill the skimmer and ATO for 2 hours with a separate button (like when I'm siphoning the bottom of the sump or doing anything that messes with the water level). The pertinent line for this thread is the Hold_AWC line. Sorry for the close names.]
To activate the two PMUPs, I plan to use the following:
NSW_PMUP
Fallback OFF
Set OFF
If Outlet Hold_AWC = ON Then On
OSW_PMUP
Fallback OFF
OSC 008:00/012:00/0 Then ON
If Outlet Hold_AWC = OFF Then OFF
I think the way these will work is that, when I press the button and switch Hold_AWC to ON, the NSW_PMUP will immediately kick on and will stay on for the full 24 minutes and then will turn off.
Meanwhile, I think (and hope) that OSW_PMUP will operate as follows: When I haven't pressed the button (ie, most of the time), it will read the OSC statement but then the final line will keep it from turning on so it will rest in OFF. But when I press the button, for the next 24 minutes, the conditional statement in the last line is not true so it has no effect. In its absence, the OSC statement keeps the pump off for 8 minutes and then turns it on for 12 minutes, then back to off for the remaining 4 minutes of the Hold_AWC cycle. Then it goes back to resting in OFF because of the last line of code being true.
I struggle with OSC statements and am far from an expert on Apex code generally so I welcome any and all input.
Thanks,
