PDA

View Full Version : Programming Question - Made a Mistake


mhosts
08/13/2012, 02:40 PM
Hey:

Just wondering if someone could chime in on my program for dosing alkalinity/calcium.

I made a small mistake and ended up putting the following code in my program. Would this cause the outlet to be stuck on 24/7? I basically ended up emptying my alkalinity jug in the last day and didn't realize it until I saw white dust showing up on my powerheads.

This was the line of Code

If Time 02:30 to 02:30 Then ON

This is the full program:

Fallback OFF
Set OFF
If Time 01:30 to 01:45 Then ON
If Time 02:30 to 02:30 Then ON
If Time 05:30 to 05:35 Then ON
If Time 10:30 to 10:35 Then ON
If Time 12:30 to 12:40 Then ON
If Time 12:40 to 24:00 Then OFF

Thanks!

aquamanic
08/13/2012, 02:44 PM
I've never tested where start time = end time. I know that if end time is < start time, the program essentially adds 1 day to the end time making it tomorrow. I guess the logic is really < or =.

mhosts
08/13/2012, 02:53 PM
Well I think it's the ladder. Because it definitely dosed about 1/4 of a gallon that I had left in my jug over the last 24 hours.

mids1999
08/13/2012, 03:51 PM
In my experience, a If Time 02:30 to 02:30 Then ON statement would operate like Set ON statement that starts at 02:30 and keeps looping at 02:30 with no end. The additional If Time Then ON statements will be ignored, as the outlet is already ON.

The If Time 12:40 to 24:00 Then OFF -- if it were written in proper format -- would set the outlet OFF during those hours. The statement diverges from proper code at the 24:00. To keep with proper format, you want to change any 24:00 times to 00:00. Also, the statement is redundant, as you already have a Set OFF statement at the beginning of the code and the outlet will only be ON during the time specified in the If Time Then On statements.

RussM
08/13/2012, 03:56 PM
I've tested it. If time with the exact same start and end times is just like Set ON.

kurt_n
08/13/2012, 10:21 PM
Also... just in case you haven't already, you might want to add a last line of code to that alk dosing code to turn off the doser if the pH goes above a certain level.