Page 1 of 1

Dosing Code Check

Posted: Mon Feb 15, 2016 9:21 am
by Paul_Velasco
Will this work?

Two dosers:

Doser 1 = Turn on at 9:00AM and dose for 2 minutes. Repeat every 4 hours
Doser 2 = Turn on at 9:15AM and dose for 2 minutes. Repeat every 4 hours

Want to make sure I am not overdosing as this will be Amino Acid and do not want to pollute the tank.

Code: Select all

    
    ///Code to make Vinegar Dosing Work 4 mins
    /// Doser 1
    ///02.15.16 = Changed to dosing Amino Acid every 4 hrs for 2 mins, on top of hours
    ///Start at 9:00AM
        ReefAngel.DosingPumpRepeat(Box1_Port8,540,240,120);
    ///Do not turn on Vinegar if lights are off
    ///02-15-16 = Changed to Dosing AA throughout the day
    ///    if (hour()<=8 || hour()>21) {
    ///      ReefAngel.Relay.Off(Box1_Port8);
    ///    } 
    //Code to make Magnesium Dosing Work
    ///Doser 2
    ///02.15.16 = Changed to dosing Amino Acid every 4 hrs for 2 mins, on 15 of hour
    ///Start at 9:15AM
        ReefAngel.DosingPumpRepeat(Box1_Port4,555,240,120);

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 9:33 am
by lnevo
Looks good. It *should* have the right start time, but you do have the 15 minute offset, the 4 hour repeat and the 2 minute runtime.

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 9:39 am
by Paul_Velasco
What happens after midnight? Does it skip a dose?

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 9:56 am
by lnevo
I think you'll get 4 doses at 9am, 1pm, 5pm, and 9pm and the second doser at 1/4 after those.

Roberto, can you confirm. I believe this line of code stops it from overlapping past midnight to start at your first offset.

signed long t=(elapsedSecsToday(now())-((long)OffsetMinute*60));
Relay.Set(DPRelay,(t%((long)RepeatMinute*60))<RunTime && t>=0);

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 9:57 am
by lnevo
If I'm wrong btw, you'll get a dose at 1am and 5am as well. You can block those out like you did in your previous code to be safe too.

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 10:35 am
by rimai
I think you need the commented section to avoid the morning doses

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 11:31 am
by lnevo
If you want to avoid just midnight you could start at 1am or 5am.

Re: Dosing Code Check

Posted: Mon Feb 15, 2016 11:54 am
by Paul_Velasco
lnevo wrote:If you want to avoid just midnight you could start at 1am or 5am.
DUH!!! Good call lnevo. I am always in my 'little box' and start things when my lights come on.