I'm assuming this is for a calcium reactor. Are you not concerned about the pH reading inside the reactor?
This code should do what you requested in your original post, though I'm not certain it's a good idea because it might dissolve your reactor media too quickly if pH drops too low. With that said, here's how to do it.
I don't know the name of your EB832 CO2 output, so I'm using "EB832_CO2" in my code. Change this name to match your EB832 output.
EB832_CO2
-----------------
Fallback OFF
Set OFF
If Alk < 8.85 Then ON
If Output CO2_Timer = ON Then ON
If Alk > 9.00 Then OFF
CO2_Timer (virtual output)
-----------------
Set OFF
If Output EB832_CO2 = OFF Then ON
Defer 045:00 Then ON
Defer 020:00 Then OFF
Notes:
- I'm assuming your Alk readings are from a Trident. If that's the case, there's no need for the Defer 005:00 timers you had since the Trident values won't fluctuate like an optical sensor or temperature probe. Once the reading is made, it remains static until the next test hours later.
- I'm also assuming you want the CO2 timer to come on, but not if your alk is > 9.00, so I placed the new "If Output CO2_Timer" line of code above the "If Alk > 9.00 Then OFF". If you really want the CO2 timer to run regardless of the Alk reading, then move the new "If Output CO2_Timer" line of code to the bottom.
Hope this helps.
If you're not familiar with virtual outputs, see my tutorial here:
https://www.reef2reef.com/ams/neptune-apex-programming-tutorials-part-5-virtual-outputs.703/