Apex Code keeps turning plug to off position

Neptune

Digicop

Community Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 4, 2020
Messages
78
Reaction score
24
Review score
+0 /0 /-0
Location
Rayne, LA
Rating - 0%
0   0   0
After the script runes the first time it turns off the plug instead of leaving it in AUTO, so the script will not run again.

The code reads:

Fallback OFF
Set OFF
If Output ReturnPump = OFF then OFF
When On > 005:00 Then Off
Defer 002:00 Then On
If Sw1 OPEN then ON
If pH < 8.30 then ON
If pH > 8.35 then OFF
If Sw1 CLOSED then OFF
If Sw1 OPEN then ON

Any help would be appreciated.

Ricky
 
AquaCave Logo Banner
www.dinkinsaquaticgardens.com

Zayne

New Member
Review score
+0 /0 /-0
View Badges
Joined
Mar 20, 2020
Messages
16
Reaction score
6
Review score
+0 /0 /-0
Rating - 0%
0   0   0
Whatever it's for is staying on longer that 5 minutes and the When is moving it to off. You may need to increase the timing if it's expexcted to be on longer, or see what hitting 5 minutes if its not.
 

David_CO

Active Member
Review score
+0 /0 /-0
View Badges
Joined
Feb 15, 2022
Messages
181
Reaction score
132
Review score
+0 /0 /-0
Location
Colorado
Rating - 0%
0   0   0
in general you have some funky logic in there. you have the SW1 on statement twice.....i assume you just want the pump off if the switch is closed, if so just include the closed statement.

I dont think you need "set off"


Trying to deduct what you're trying to do here......
you want to turn of a pump on that feeds kalk when your PH is below a certain threshold and turn it off when above.
SW1 is presumably a level sensor in your kalk container so the pump doesnt run when dry
when the pump is on 5 mins you want it to turn off for 2 mins.....I dont believe apex code works this way.

I would use OSC commands and have lines around whether its on or off based on PH and fluid level below that. It might be possible to do some permutation of this and make it work but OSC is going to be alot more straight forward.
 
Last edited:
Neptune

Polyp polynomial: How many heads do you start with when buying zoas?

  • One head is enough to get started.

    Votes: 27 10.6%
  • 2 to 4 heads.

    Votes: 145 57.1%
  • 5 heads or more.

    Votes: 65 25.6%
  • Full colony.

    Votes: 10 3.9%
  • Other.

    Votes: 7 2.8%
WWW.ANIMATEDCORALS.COM
Back
Top