Page 1 of 1

Combining DelayedOn with StandardHeater

Posted: Thu Jun 21, 2018 11:02 am
by jcjrogersstar
I have my UV's pump and bulb on separate relays. I currently run my UV bulb as a StandardHeater with the parameters hard coded (my real heaters are managed via internal memory). I do this because during the summer, the UV bulb generates enough heat for my late afternoon tank temp to get higher than my normal temperature range. With my current program, my UV bulb turns off for 2-3 hours during the late afternoon/early evening, almost every day.

I want to change my Feeding Mode setup to where I use it for coral feeding instead of fish feeding. During Feeding Mode, I want to shut down my skimmer, UV pump, and UV bulb for maybe 1.25 hours. I don't see an easy way to define the length of Feeding Mode, so my thought was to manage the time-off for these devices by using DelayedOn (the skimmer is already using DelayedOn). Adding DelayedOn to the UV pump is simple enough, but I've already defined my UV bulb as a StandardHeater. I don't know if I can also define it as DelayedOn. I can use if/then statements, something like:

Code: Select all

    if ( ReefAngel.Params.Temp [T2_PROBE ] >= 794 ) ReefAngel.Relay.Off( Port7 );
    if ( ReefAngel.Params.Temp [T2_PROBE ] <= 788 ) ReefAngel.Relay.On( Port7 );
However, I'm thinking that the high temp shut-off would generate a Flag that has to be cleared manually, thereby ignoring the statement to turn back on. If I'm wrong on that, please let me know. These are the options I see:
  • 1. Manipulate the time expended for Feeding Mode.
    2. Use both StandardHeater and DelayedOn for the relay/port that runs my UV bulb.
    3. Use if/then statements for my UV bulb.

I'm just a little nervous because running the UV bulb without water circulating would be a BAD thing. Any help would be greatly appreciated.

Re: Combining DelayedOn with StandardHeater

Posted: Thu Jun 21, 2018 4:34 pm
by rimai
Feeding timer is memory location 214

Re: Combining DelayedOn with StandardHeater

Posted: Fri Jun 22, 2018 7:38 am
by jcjrogersstar
rimai wrote:Feeding timer is memory location 214
Thanks Roberto. Unfortunately, that's above my head. I understand the basic coding and have some InternalMemory statements in my code, but I don't know how to access a memory location or how to manipulate it with code. I don't mind learning as that would be the cleanest way to do, but I would need some help. Either that or I can handle one of the other two ways I listed if it is possible.

Re: Combining DelayedOn with StandardHeater

Posted: Fri Jun 22, 2018 7:45 am
by mav3rick478
You can always make a duplicate of the Initial Setup Code and alter the Feed Time in there and upload to your unit. Then save that code as a copy. That's what I did as I'm still learning the one and out of coding.

Sent from my Pixel XL using Tapatalk

Re: Combining DelayedOn with StandardHeater

Posted: Sat Jun 23, 2018 12:29 pm
by jcjrogersstar
mav3rick478 wrote:You can always make a duplicate of the Initial Setup Code and alter the Feed Time in there and upload to your unit. Then save that code as a copy. That's what I did as I'm still learning the one and out of coding.

Sent from my Pixel XL using Tapatalk
Thanks for responding, but I'm not sure where to find the Initial Setup Code. I have a good understanding of the normal sketch stuff but have only a very basic understanding of the libraries and will need a good bit of hand holding to go that route. I decided to reword my request and post in the "How Do I Code" forum.

Roberto, feel free to close this thread.

Re: Combining DelayedOn with StandardHeater

Posted: Sat Jun 23, 2018 1:37 pm
by mav3rick478
jcjrogersstar wrote:
Thanks for responding, but I'm not sure where to find the Initial Setup Code. I have a good understanding of the normal sketch stuff but have only a very basic understanding of the libraries and will need a good bit of hand holding to go that route. I decided to reword my request and post in the "How Do I Code" forum.

Roberto, feel free to close this thread.
In Arduino go to:

File>Sketchbook>Example Codes>InitialInternalMemory

It's line 57:
Internal memory.FeedingTimer_write(900)

Change the 900 value to whatever you want, it's timed in seconds. I set mine to 600 which equals 10 minutes, and saved it under a different name so that I can always just alter that code and have the standard code untouched.

If you're using the web wizard you should be able to copy and paste the code into the browser and save there too.

Sent from my Pixel XL using Tapatalk

Re: Combining DelayedOn with StandardHeater

Posted: Sat Jun 23, 2018 9:41 pm
by jcjrogersstar
mav3rick478 wrote:
jcjrogersstar wrote:
Thanks for responding, but I'm not sure where to find the Initial Setup Code. I have a good understanding of the normal sketch stuff but have only a very basic understanding of the libraries and will need a good bit of hand holding to go that route. I decided to reword my request and post in the "How Do I Code" forum.

Roberto, feel free to close this thread.
In Arduino go to:

File>Sketchbook>Example Codes>InitialInternalMemory

It's line 57:
Internal memory.FeedingTimer_write(900)

Change the 900 value to whatever you want, it's timed in seconds. I set mine to 600 which equals 10 minutes, and saved it under a different name so that I can always just alter that code and have the standard code untouched.

If you're using the web wizard you should be able to copy and paste the code into the browser and save there too.

Sent from my Pixel XL using Tapatalk
Ok, this is where I'm confused... it doesn't appear to be as simple as copy/pasting that line into my current sketch as "FeedingTimer" isn't defined anywhere. If what you are saying is to copy the whole file to my controller, might that file be obsolete, especially since I'm now running a Star controller?

Re: Combining DelayedOn with StandardHeater

Posted: Sun Jun 24, 2018 9:21 am
by mav3rick478
jcjrogersstar wrote:
mav3rick478 wrote:
jcjrogersstar wrote:
Thanks for responding, but I'm not sure where to find the Initial Setup Code. I have a good understanding of the normal sketch stuff but have only a very basic understanding of the libraries and will need a good bit of hand holding to go that route. I decided to reword my request and post in the "How Do I Code" forum.

Roberto, feel free to close this thread.
In Arduino go to:

File>Sketchbook>Example Codes>InitialInternalMemory

It's line 57:
Internal memory.FeedingTimer_write(900)

Change the 900 value to whatever you want, it's timed in seconds. I set mine to 600 which equals 10 minutes, and saved it under a different name so that I can always just alter that code and have the standard code untouched.

If you're using the web wizard you should be able to copy and paste the code into the browser and save there too.

Sent from my Pixel XL using Tapatalk
Ok, this is where I'm confused... it doesn't appear to be as simple as copy/pasting that line into my current sketch as "FeedingTimer" isn't defined anywhere. If what you are saying is to copy the whole file to my controller, might that file be obsolete, especially since I'm now running a Star controller?
Yes you usually upload the whole file but that's for the RA+. I would think it's the same for the RA* but it might be a different initial code and a different line number but should be labeled the same.

Sent from my Pixel XL using Tapatalk

Re: Combining DelayedOn with StandardHeater

Posted: Sun Jun 24, 2018 11:18 am
by jcjrogersstar
Yes you usually upload the whole file but that's for the RA+. I would think it's the same for the RA* but it might be a different initial code and a different line number but should be labeled the same.
I started with the Plus and then went to the Star. The file date on the InitialInternalMemory file I have is 11/23/2013 so I'm nervous about uploading the whole file without knowing that is the latest file and that it works with the Star. Adding the line to my current sketch would be fine, but I don't think that will work.

Re: Combining DelayedOn with StandardHeater

Posted: Sun Jun 24, 2018 12:16 pm
by rimai
It works either way. You can upload the entire file or you can just copy that line.
If you copy just make sure you paste on setup() section and not loop()

Re: Combining DelayedOn with StandardHeater

Posted: Sun Jun 24, 2018 3:41 pm
by jcjrogersstar
rimai wrote:It works either way. You can upload the entire file or you can just copy that line.
If you copy just make sure you paste on setup() section and not loop()
Cool... thanks!