Just a little help with ordering my program steps.

AcroSteve

Make my Funk a P-Funk
I am currently controlling my CA reactor PH with my AQ using the following commands

If pH > 6.65 Then CO2 ON
If pH < 6.68 Then CO2 OFF

I want to add a set of steps that will override the ones looking at the PH, and only let the CO2 become active between a certain time of day. And during this time, keep the PH between the previous values. Here are the lines based on the time

If Time > 9:00 Then CO2 ON
If Time > 21:00 Then CO2 OFF

What order do I need to place these 4 commands in to achieve my goals on the 1st try? Do I need any additional lines of code?

Thanks.
 
I'm new at this so probably not much help but you have to remember that the 'If time' statements are read before any other statements regardless of where you stick them in the program. For instance it you wrote the program in the same order as above the 'If time' statements would still be executed first. That takes care of the CO2 being on at the specified time range but what about when it's supposed to remain off. I have a feeling the pH statements will then take over so the CO2 will remain on/off depending on the range. This is not what you want as the outcome so you have to do something else. I'm also interested to see if there is a programing solution. If not one solution would be to use a basic light tiimer plugged into the outlet or DC4 depending on which you are using and then use the AC to limit CO2 based on pH when the timer is switched on.

It would be nice if there was a way to make one statement for a particular devise the primary statement and tben all other statements concerning that devise applied only within the range of the primary statement. Maybe there is a a way to do this but I don't see it within the program language that I have experimented with.
 
Just leave off the 'If pH > 6.65 Then CO2 ON' as it is the one that is causing the problem by turning on the CO2 even during the times you don't want it on. So your program becomes:

If Time > 9:00 Then CO2 ON
If Time > 21:00 Then CO2 OFF
If pH < 6.68 Then CO2 OFF
Max Change 010 M Then CO2 OFF

The Max change statement keeps the CO2 from oscillating on and off if the pH is right 6.68.

Curt
 
Back
Top