Page 1 of 1
Dosing pump code problem
Posted: Fri Jul 11, 2014 3:10 pm
by meadowsad
So I came home today and my dosing pump was stuck on... It should run for 20seconds every 30minutes. This is the code I am using
Code: Select all
if (ReefAngel.Params.PH < 830)
{
ReefAngel.DosingPumpRepeat( DosePump,0,30,20 );
}
Is there something wrong with this code? Currently When I set the relay to auto it just turns on right away. My PH reads 8.59... I have been using this code for a while and hadn't had an issue until today.
Re: Dosing pump code problem
Posted: Fri Jul 11, 2014 3:17 pm
by rimai
Yes, you need to make sure to turn the relay off if you use a condition like that.
Your code should be like this:
Code: Select all
if (ReefAngel.Params.PH < 830)
{
ReefAngel.DosingPumpRepeat( DosePump,0,30,20 );
}
else
{
ReefAngel.Relay.Off(DosePump);
}
Re: Dosing pump code problem
Posted: Fri Jul 11, 2014 3:22 pm
by meadowsad
Thanks for the quick response Roberto, I thought I may need to do that. Since this has been working for months without issue it led me to believe it wasn't needed.
Re: Dosing pump code problem
Posted: Fri Jul 11, 2014 3:27 pm
by rimai
Yeah, you will only have an issue in the event that this order of events happen:
ph=8.29
Dosing pumps kicks in
If in less than 20 seconds ph goes up to 8.3, it will leave the relay on forever, because it never goes back to check the DosingPumpRepeat function again.