Need help with programming plz

Users Who Are Viewing This Thread (Total: 0, Members: 0, Guests: 0)

GarrettT

Well-Known Member
View Badges
Joined
Apr 23, 2021
Messages
913
Reaction score
661
Location
Austin, TX
Rating - 0%
0   0   0
I'm looking to program my Apex to do the following.

Turn on at 7:10am to 7:25am
Turn off when float switch is triggered

If the float switch is triggered, how would it turn off if I am asking it to be on at the same time?
 
Your question isn't very clear, but I think this is what you want:

Set OFF
If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF

Two points to clarify:
1. The end time is listed as 7:24 because the If Time values are inclusive. In other words, while the clock still reads 7:24 it will remain on, then once the clock reaches 7:25 it will turn off.
2. You didn't specify what your float reports when "triggered". Is it normally OPEN, or normally CLOSED. Adjust the code for your situation.

See my series of Apex tutorials for details on a variety of topics:
 
Neptune questions are always hard to translate.

So the float switch "Then OFF'' would take precedence over the time period ''Then ON"?

If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF
 
Neptune questions are always hard to translate.

So the float switch "Then OFF'' would take precedence over the time period ''Then ON"?

If Time 07:10 to 07:24 Then ON
If Float CLOSED Then OFF
The Apex evaluates each line of code from top to bottom, and the last line that's True will set the output state. It repeats this process once per second. So if the float reports CLOSED, that last line of the program is True, so it turns the output off even if it's still within the time window from the previous line of code.
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%

New Posts

Back
Top