Page 1 of 1

Reading and manipulating internal memory variables

Posted: Mon May 04, 2015 4:23 pm
by joshlawless
I have two 500W heaters plugged into different relay ports. Originally, I thought it might be good to configure one to a wider operational range than the other (to ensure that the time at which they power on and off is staggered, to reduce noticeable dimming of lights). If I code the temperature values directly, that's no problem.

Code: Select all

    ReefAngel.StandardHeater( Port1,770,780 );
    ReefAngel.StandardHeater( Port2,772,778 );
If I want to use the internal memory (and ability to adjust on the fly), I'm not sure how to code this feature. I imagine it would look something like this:

Code: Select all

    ReefAngel.StandardHeater( Port1 );
if ( ReefAngel.Params.Temp[T1_PROBE] < (HeaterTempOn_read() + 2)) { ReefAngel.Relay.On(Port2); };
if ( ReefAngel.Params.Temp[T1_PROBE] > (HeaterTempOff_read() - 2)) { ReefAngel.Relay.Off(Port2); };


Am I in the ballpark?

Thanks!

Re: Reading and manipulating internal memory variables

Posted: Mon May 04, 2015 5:02 pm
by rimai
Yeap. Just make sure to add InternalMemory. in front of the _read functions.

Re: Reading and manipulating internal memory variables

Posted: Mon May 04, 2015 5:03 pm
by joshlawless
Like this?

Code: Select all

    ReefAngel.StandardHeater( Port1 );
if ( ReefAngel.Params.Temp[T1_PROBE] < (InternalMemory.HeaterTempOn_read() + 2)) { ReefAngel.Relay.On(Port2); };
if ( ReefAngel.Params.Temp[T1_PROBE] > (InternalMemory.HeaterTempOff_read() - 2)) { ReefAngel.Relay.Off(Port2); };

Re: Reading and manipulating internal memory variables

Posted: Mon May 04, 2015 5:06 pm
by rimai
That should work.

Re: Reading and manipulating internal memory variables

Posted: Mon May 04, 2015 5:07 pm
by joshlawless
Thanks!