Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Thank you for the reply. I have the skimmer to turn off when Feed mode A is engaged. Will the code you posted affect that?This won't work.
You are misunderstanding how the Apex code is processed. It does not execute commands one after the other in sequence like other typical computer programming languages. Instead, the Apex evaluates each condition from top to bottom once per second, and the last line that evaluates True will set the output On or Off.
The Set command is absolute, so when you say Set ON or Set OFF, that's unconditional. Only the If commands are conditional. So for example, your code will completely ignore everything above line 5 (Set OFF) because everything above it will be overruled by Set OFF. If you want to maintain a range between two values, then don't use any Set command at all.
Additionally, the Fallback command has nothing to do with normal programming. Fallback is only used to instruct the output how to behave if the Apex is ever disconnected (either unplugged, rebooting, or locked up) from the module that controls this output, telling it to be ON or OFF by default until the Apex is back in control of the output's behavior.
Lastly, the Defer, Min Time, and When commands are only processed after all the conditions have been evaluated. They are global options for the output.
Based on what you described, this should be what you want:
Fallback OFF
If pH < 8.27 Then ON
If pH > 8.32 Then OFF
If Output Vectra = OFF Then OFF
Please read my series of Apex Tutorials to get up to speed on the programming:
Articles by SuncrestReef
www.reef2reef.com