Page 1 of 1

Re: broken feeding mode

Posted: Mon Oct 14, 2013 12:04 pm
by lnevo
If you set that location to true then reboot it should initialize the memory with the values in the init_memory() function...

But no usually you have to set them up beforehand. Init memory was a method i used when i changed all my locations around or if something gets corrupted and i need a mass reset

Re: broken feeding mode

Posted: Mon Oct 14, 2013 12:04 pm
by lnevo
rossbryant1956 wrote:lee is this why my mem locations are not being updated:

InternalMemory.write(Mem_B_ResetMemory,false);
That line ensures that init_memory runs only once.

Re: broken feeding mode

Posted: Sun Oct 20, 2013 6:25 pm
by rossbryant1956
I had some time today and finally ripped my code apart to find the culprit that was keeping my feeding mode from working. I checked all the hardware with the example code and that all checked out. I then went back to the wizard, wrote something very simple, and tested that feed and water change worked there. Finally I started putting it back together piece by piece until I found the issue.

Evidently when trying to adapt lee's code I have a mistake in these modules:

Code: Select all

       // Turn off DT_Pump if sump overflowing 
       
       static boolean DT_OverFillOverride=true;
       if (!ReefAngel.IO.GetChannel(0)) {
         if (!DT_OverFillOverride) {
         switchAlert.Send("DT_Tank+level+alarm!");
         ReefAngel.Relay.Override(DT_Pump,0);
         DT_OverFillOverride=true;
     } 
     } else {
        DT_OverFillOverride=false;
        ReefAngel.Relay.Override(DT_Pump,2);
     }  
     
        // Turn off GT_Pump if sump overflowing 
       
       static boolean GT_PumpOverFillOverride=true;
       if (!ReefAngel.IO.GetChannel(1)) {
         if (!GT_PumpOverFillOverride) {
         switchAlert.Send("GT_Tank+level+alarm!");
         ReefAngel.Relay.Override(GT_Pump,0);
         GT_PumpOverFillOverride=true;
     } 
     } else {
        GT_PumpOverFillOverride=false;
        ReefAngel.Relay.Override(GT_Pump,2);
     }  
My suspicion is that the two lines "ReefAngel.Relay.Override(PumpName, Number) are overriding the feed mode and water change mode command. Everything else turns off during the feed mode except those two pumps. It's almost like I need to enclose these routines in an if-then or something because those overrides seem to be firing regardless of the state of those float valves. Please help. Thx

Re: broken feeding mode

Posted: Sun Oct 20, 2013 7:52 pm
by lnevo
It's the second one I think make it an else if and make sure it's not in feeding or cw modes.

Re: broken feeding mode

Posted: Sun Oct 20, 2013 7:53 pm
by lnevo
In both sections..

Re: broken feeding mode

Posted: Sun Oct 20, 2013 8:22 pm
by rossbryant1956
do you mean instead of:

} else {

we do

} else if {

that throws the error:

expected '(' before '{"

Would you be so kind as to write me a line or two so I can see what you mean? And Thx

Re: broken feeding mode

Posted: Mon Oct 21, 2013 9:23 am
by rossbryant1956
please help. thx in advance.

Re: broken feeding mode

Posted: Mon Oct 21, 2013 9:46 am
by lnevo
You need to add the conditional..

If what?

Sorry i cant provide any code at the moment, but can you answer what would you like to ensure happens during the feeding and wc mode?

Lee

Re: broken feeding mode

Posted: Mon Oct 21, 2013 11:51 am
by rossbryant1956
thx very much. I will write some pseudo-code asap. Again Thanx

Re: broken feeding mode

Posted: Thu Oct 24, 2013 7:31 pm
by rossbryant1956
Just wanted everyone to know I found and fixed my bug, and I wanted you to meet him (or her!)

{

in the wrong place...just sitting there. As Lee said, there was no conditional being tested, therefore this routine was overriding everything. Anyway RA, thx to all for your help.