Help with programming

jstlsn

New member
Currently I have the following commands set up on my AC Jr to dose Calcium and Alkalinity with dosing pumps

If TIME > 00:00 Then ALK ON
If TIME > 00:12 Then ALK OFF

If TIME > 01:00 Then CAL ON
If TIME > 01:12 Then CAL OFF

If TIME > 02:00 Then ALK ON
If TIME > 02:12 Then ALK OFF

If TIME > 03:00 Then CAL ON
If TIME > 03:12 Then CAL OFF

If TIME > 04:00 Then ALK ON
If TIME > 04:12 Then ALK OFF

If TIME > 05:00 Then CAL ON
If TIME > 05:12 Then CAL OFF

If TIME > 06:00 Then ALK ON
If TIME > 06:12 Then ALK OFF

If TIME > 07:00 Then CAL ON
If TIME > 07:12 Then CAL OFF

If TIME > 08:00 Then ALK ON
If TIME > 08:12 Then ALK OFF

If TIME > 09:00 Then CAL ON
If TIME > 09:12 Then CAL OFF

I would like to try and condense this so that I am not using up so many lines of code. How would I do this??? Should I use the OSC command? Any help would be greatly appreciated.

Thanks
Brad
 

dougchambers

New member
Brad,

Try a set of dummy timers with the OSC command. Something like this should work;

Timers (Adjust 'D' if needed depending on your setup)
DY1&-D1 //Dummy Timer
DY2&-D2 //Dummy Timer

If Time > 00:00 Then DY1 ON
If Time > 08:15 Then DY1 OFF
If Time > 01:00 Then DAY2 ON
If Time > 09:15 Then DAY2 OFF

OSC 012/108 ON/OFF Then ALK ON
OSC 012/108 ON/OFF Then CAL ON
If Timer DAY1 = OFF Then ALK OFF
If Timer DAY2 = OFF Then CAL OFF

I'm not positive the ALK and CAL would start right up at 00:00 and 01:00 respectively. Curt may have to answer that one. But once running, the OSC should keep the timers on for 12 minutes and off for 108min (2hrs-12min).

-Doug
 

kenargo

Premium Member
My experience with OSC is that the time starts when "run" is executed on the AC3, when the program is updated using the web or AquaNotes interface or when the program. If the AC is updated or power lost between 12 am and 8:15 ALK and CAL will be in sync (on at the same time).

I think what you want to try is to get down to 1 OSC statement or continue using the timer conditions (if you want dosing to happen opposinte one another). I would have to put some thought on doing this but I am short on time at the moment.
 

dougchambers

New member
<a href=showthread.php?s=&postid=11627682#post11627682 target=_blank>Originally posted</a> by kenargo
My experience with OSC is that the time starts when "run" is executed on the AC3, when the program is updated using the web or AquaNotes interface or when the program. If the AC is updated or power lost between 12 am and 8:15 ALK and CAL will be in sync (on at the same time).

I think what you want to try is to get down to 1 OSC statement or continue using the timer conditions (if you want dosing to happen opposite one another). I would have to put some thought on doing this but I am short on time at the moment.
Good point. I was unsure how the system would start the timing. The power out scenario would pose a problem. In order to keep the two out of sync, there may be a way to stage the code with a max change between the two. I'll have to think about it too...
 

jstlsn

New member
Thanks for your help guys. I got this code from someone on my local marine club forums (WAMAS). Any comments? It looks like it might address the issue of the both dosing at the same time.

You are going to need to setup a dummy timer: DDT (dosing dummy timer).

Then

If Time > 00:00 THEN DDT ON
If Time > 09:00 THEN DDT OFF
OSC 012/048 THEN ALK ON
OSC 012/108 THEN CAL ON
IF Timer DDT = OFF THEN ALK OFF
IF TImer DDT = OFF THEN CAL OFF
IF Timer CAL = ON THEN ALK OFF


Thanks
Brad
 
Top