How to program a cycle time on Apex

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
All I want to do is program a pump I use to dose to turn on for xxx minutes, off for xxx minutes and have it repeat all day long. Can someone tell me what to type? Sorry I am not good with this stuff and I am hoping someone can help me out with this one!!!
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,216
Location
Oregon
Rating - 0%
0   0   0
Use the OSC command:

OSC MMM:SS/MMM:SS/MMM:SS Then ON

The 3 timers dictate the cycle:
  • leading delay
  • active time
  • trailing delay
For example, to run for 5 minutes every hour:

Fallback OFF
OSC 000:00/005:00/055:00 Then ON

Read my tutorial on Apex TImers for more details and examples:
 
OP
OP
Lousybreed

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
Dear @SuncrestReef i have a question. I also want this pump to turn off if it gets above a certain ph. Would the following work?
Fallback Off
If pH > 8.63 Then OFF
If pH < 8.58 Then ON
OSC 000:00/005:00/055:00 Then ON
 

SuncrestReef

That Apex guy
View Badges
Joined
Jan 18, 2018
Messages
4,214
Reaction score
9,216
Location
Oregon
Rating - 0%
0   0   0
Dear @SuncrestReef i have a question. I also want this pump to turn off if it gets above a certain ph. Would the following work?
Fallback Off
If pH > 8.63 Then OFF
If pH < 8.58 Then ON
OSC 000:00/005:00/055:00 Then ON
Your code won't work because the Apex evaluates each line from top to bottom, and the last line that's True sets the output state. If the case of OSC, it always evaluates True (it's not a conditional command like IF), so regardless of how the If pH lines evaluate, OSC will be the last line that's True and will continue turning the output On and Off on its normal schedule.

You have two options to work around this:

1. Just place a single If pH condition after the OSC to override the OSC schedule when the pH level is too high:

Fallback OFF
OSC 000:00/005:00/055:00 Then ON
If pH > 8.63 Then OFF

- or -

2. If you really want to maintain a range for the pH, use a virtual output to evaluate the lower and upper pH values, then use the status of that virtual output to override the OSC schedule. This would turn off the dosing pump once pH > 8.63, but keep it turned off until the pH finally reduces to below 8.58.

[High_pH] -- virtual output
If pH > 8.63 Then ON
If pH < 8.58 Then OFF

[DosingPump]
Fallback OFF
OSC 000:00/005:00/055:00 Then ON
If Output High_pH = ON Then OFF

If you're not familiar with virtual outputs, see my tutorial here:
 
OP
OP
Lousybreed

Lousybreed

Well-Known Member
View Badges
Joined
Feb 11, 2017
Messages
822
Reaction score
648
Location
Sussex, WI
Rating - 0%
0   0   0
You are truly skilled. You have no ide how much I appreciate you! I am going on vacation tomorrow. THANK YOU for the fast response. Have a good night!!!
 

Algae invading algae: Have you had unwanted algae in your good macroalgae?

  • I regularly have unwanted algae in my macroalgae.

    Votes: 14 31.8%
  • I occasionally have unwanted algae in my macroalgae.

    Votes: 9 20.5%
  • I rarely have unwanted algae in my macroalgae.

    Votes: 4 9.1%
  • I never have unwanted algae in my macroalgae.

    Votes: 5 11.4%
  • I don’t have macroalgae.

    Votes: 11 25.0%
  • Other.

    Votes: 1 2.3%
Back
Top