Apex code writing for feed mode

CaptClay

Community Member
View Badges
Joined
Mar 23, 2026
Messages
46
Reaction score
82
Location
Pensacola
Rating - 0%
0   0   0
I wrote this for my powerheads to turn off when the feeder goes of. My question is will apex read both off times? I have written code for other things real computer stuff. Just not sure on apex code base.
Fallback ON
Set ON
If Time 10:29 to 10:35 Then OFF
If Time 15:59 to 16:05 Then OFF
If FeedA 005 Then OFF
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
705
Reaction score
379
Rating - 0%
0   0   0
Yes. It evaluates top down and will execute the last line to execute as true. Your time ranges don’t over lap and there fore only 1 can be true with the feed an overwriting any time of day when active.
 
OP
OP
C

CaptClay

Community Member
View Badges
Joined
Mar 23, 2026
Messages
46
Reaction score
82
Location
Pensacola
Rating - 0%
0   0   0
Yes. It evaluates top down and will execute the last line to execute as true. Your time ranges don’t over lap and there fore only 1 can be true with the feed an overwriting any time of day when active.
The bottom line has higher priority correct? So feedA will over ride everything if active correct?
 

Tangdora

Well-Known Member
View Badges
Joined
Feb 8, 2020
Messages
705
Reaction score
379
Rating - 0%
0   0   0
Yes but in your current case, order really doesn’t matter since you have three independent events and they are all setting the power heads off. Even if you put it first when you turn your feed mode on, they would turn off still. If it ended still within your time ranges. Then they would continue to remain off as at least one time range still evaluate as true and keeps them off. The ordering would become necessary if you had an ON command (not counting the set on) for example it one line read if time between 2-3 then on. Then you would need the feed a to be after otherwise if you tried to activate it between 2-3 nothing would happen as the set on line would over write it.
 
OP
OP
C

CaptClay

Community Member
View Badges
Joined
Mar 23, 2026
Messages
46
Reaction score
82
Location
Pensacola
Rating - 0%
0   0   0
Yes but in your current case, order really doesn’t matter since you have three independent events and they are all setting the power heads off. Even if you put it first when you turn your feed mode on, they would turn off still. If it ended still within your time ranges. Then they would continue to remain off as at least one time range still evaluate as true and keeps them off. The ordering would become necessary if you had an ON command (not counting the set on) for example it one line read if time between 2-3 then on. Then you would need the feed a to be after otherwise if you tried to activate it between 2-3 nothing would happen as the set on line would over write it.
Ok thanks that's what i thought.
 

TOP 10 Trending Threads

WHAT AMOUNT OF LIVE ROCK AND SAND SHOULD BE PRIORITIZED FOR OPTIMAL BIODIVERSITY/FILTRATION?

  • 100% live rock + bagged sand

    Votes: 34 27.6%
  • 100% dry rock + 100% live sand

    Votes: 43 35.0%
  • 50/50 live/dry rock, 50/50 live/bagged sand

    Votes: 27 22.0%
  • 75% live rock, 25% live sand

    Votes: 11 8.9%
  • 25% live rock, 75% live sand

    Votes: 8 6.5%
Back
Top