Dosing Code Check

Do you have a question on how to do something.
Ask in here.
Post Reply
Paul_Velasco
Posts: 127
Joined: Thu Sep 19, 2013 7:46 am
Location: Saint Cloud, FL

Dosing Code Check

Post 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);
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Code Check

Post 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.
Paul_Velasco
Posts: 127
Joined: Thu Sep 19, 2013 7:46 am
Location: Saint Cloud, FL

Re: Dosing Code Check

Post by Paul_Velasco »

What happens after midnight? Does it skip a dose?
Image
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Code Check

Post 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);
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Code Check

Post 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.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: Dosing Code Check

Post by rimai »

I think you need the commented section to avoid the morning doses
Roberto.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: Dosing Code Check

Post by lnevo »

If you want to avoid just midnight you could start at 1am or 5am.
Paul_Velasco
Posts: 127
Joined: Thu Sep 19, 2013 7:46 am
Location: Saint Cloud, FL

Re: Dosing Code Check

Post 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.
Image
Post Reply