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.
Your code won't work as written because the Apex evaluates each line from top to bottom, and the last line that's True sets the output state. In the case of checking the skimmer's status, the following line "If ORP < 370 Then ON" would turn on the Ozone even if the skimmer is off, since that line would be the last line that's True.As i apply ozone via my skimmer, if the skimmer is turned off due to a full waste container say, i dont want ozone leaking into my front room. Also i want to manage orp levels.
Thanks
Thanks for that!!! I did try to google apex code priority but i guess my wording was off , you have easily exceeded what i was expecting for an answer too, thanks againYour code won't work as written because the Apex evaluates each line from top to bottom, and the last line that's True sets the output state. In the case of checking the skimmer's status, the following line "If ORP < 370 Then ON" would turn on the Ozone even if the skimmer is off, since that line would be the last line that's True.
You have two options to work around this:
1. Move the Skimmer condition below the ORP lines. This will override the ORP conditions when the skimmer is off. However, once the skimmer turns back on, you'll have to wait until ORP drops below 370 again before ozone will turn back on.
Fallback OFF
If ORP < 370 Then ON
If ORP > 440 Then OFF
If Output Skimmer = OFF Then OFF
- or -
2. If you really want to maintain a range for the ORP, use a virtual output to evaluate the lower and upper ORP values, then use the status of that virtual output to control the Ozone output, plus override it when the skimmer is off. This would turn on the ozone if ORP < 370, turn it off if ORP > 440, turn off ozone when the skimmer is off, but once the skimmer turns back on, it will turn ozone back on even if it hadn't yet dropped below 370 and hasn't yet reached 440.
[Low_ORP] -- virtual output
If ORP < 370 Then ON
If ORP > 440 Then OFF
[Ozone]
Fallback OFF
Set OFF
If Output Low_ORP = ON Then ON
If Output Skimmer = OFF Then OFF
Notice in both of these options, I'm not checking if the skimmer is ON. If you're checking that it's OFF, there's no need to also check if it's ON because the first check will obviously be False. The other lines of code above the Skimmer check will handle turning ozone back ON.
If you're not familiar with virtual outputs, see my tutorial here:
Neptune Apex Programming Tutorials, Part 5: Virtual Outputs
Part 5 of our Apex Programming Tutorials. This one is on Virtual Outputs.www.reef2reef.com
I seem to be unable to add the virtual outlet? I dont see the tab?Your code won't work as written because the Apex evaluates each line from top to bottom, and the last line that's True sets the output state. In the case of checking the skimmer's status, the following line "If ORP < 370 Then ON" would turn on the Ozone even if the skimmer is off, since that line would be the last line that's True.
You have two options to work around this:
1. Move the Skimmer condition below the ORP lines. This will override the ORP conditions when the skimmer is off. However, once the skimmer turns back on, you'll have to wait until ORP drops below 370 again before ozone will turn back on.
Fallback OFF
If ORP < 370 Then ON
If ORP > 440 Then OFF
If Output Skimmer = OFF Then OFF
- or -
2. If you really want to maintain a range for the ORP, use a virtual output to evaluate the lower and upper ORP values, then use the status of that virtual output to control the Ozone output, plus override it when the skimmer is off. This would turn on the ozone if ORP < 370, turn it off if ORP > 440, turn off ozone when the skimmer is off, but once the skimmer turns back on, it will turn ozone back on even if it hadn't yet dropped below 370 and hasn't yet reached 440.
[Low_ORP] -- virtual output
If ORP < 370 Then ON
If ORP > 440 Then OFF
[Ozone]
Fallback OFF
Set OFF
If Output Low_ORP = ON Then ON
If Output Skimmer = OFF Then OFF
Notice in both of these options, I'm not checking if the skimmer is ON. If you're checking that it's OFF, there's no need to also check if it's ON because the first check will obviously be False. The other lines of code above the Skimmer check will handle turning ozone back ON.
If you're not familiar with virtual outputs, see my tutorial here:
Neptune Apex Programming Tutorials, Part 5: Virtual Outputs
Part 5 of our Apex Programming Tutorials. This one is on Virtual Outputs.www.reef2reef.com
You must have an Apex Classic or older model, which requires you to create the virtual outputs from the Classic Dashboard.I seem to be unable to add the virtual outlet? I dont see the tab?