Reading and manipulating internal memory variables

Do you have a question on how to do something.
Ask in here.
Post Reply
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Reading and manipulating internal memory variables

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

Re: Reading and manipulating internal memory variables

Post by rimai »

Yeap. Just make sure to add InternalMemory. in front of the _read functions.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Reading and manipulating internal memory variables

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

Re: Reading and manipulating internal memory variables

Post by rimai »

That should work.
Roberto.
User avatar
joshlawless
Posts: 138
Joined: Thu May 23, 2013 2:52 pm

Re: Reading and manipulating internal memory variables

Post by joshlawless »

Thanks!
Post Reply