Delay doesn't appear to be working

Basic / Standard Reef Angel hardware
Post Reply
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Delay doesn't appear to be working

Post by erikweitzel »

I'm a little confused. I use a mac with the wizard to program my reefangel. I have one question and one request:
1. The request is that the wizard would allow each of the relay ports to be named since I have trouble remembering what all I have plugged in to each of my 16 relays.
2. The question is this... I'm running my skimmer on timer mode since I want a 30 minute period when I'm putting in plankton to not run the skimmer. I have added a 15 minute delay, so that after feeding mode when my sump has higher water volume in it, I'd rather not run the skimmer until the sump water level is lower and thus the skimmer won't accumulate wet skimmate from a temporarily high sump water volume. Am I correct in thinking that the delay should give a delay in 15 minutes after restart from feeding mode?
Thanks....
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

Can you post the code?
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

#include <ReefAngel_Features.h>
#include <Globals.h>
#include <RA_Wifi.h>
#include <Wire.h>
#include <OneWire.h>
#include <Time.h>
#include <DS1307RTC.h>
#include <InternalEEPROM.h>
#include <RA_NokiaLCD.h>
#include <RA_ATO.h>
#include <RA_Joystick.h>
#include <LED.h>
#include <RA_TempSensor.h>
#include <Relay.h>
#include <RA_PWM.h>
#include <Timer.h>
#include <Memory.h>
#include <InternalEEPROM.h>
#include <RA_Colors.h>
#include <RA_CustomColors.h>
#include <Salinity.h>
#include <RF.h>
#include <IO.h>
#include <ORP.h>
#include <AI.h>
#include <ReefAngel.h>

////// Place global variable code below here


////// Place global variable code above here


void setup()
{
// This must be the first line
ReefAngel.Init(); //Initialize controller
// Ports toggled in Feeding Mode
ReefAngel.FeedingModePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit;
ReefAngel.FeedingModePortsE[0] = Port3Bit | Port7Bit;
// Ports toggled in Water Change Mode
ReefAngel.WaterChangePorts = Port1Bit | Port2Bit | Port5Bit | Port6Bit;
ReefAngel.WaterChangePortsE[0] = Port7Bit;
// Ports toggled when Lights On / Off menu entry selected
ReefAngel.LightsOnPorts = Port3Bit;
ReefAngel.LightsOnPortsE[0] = Port5Bit;
// Ports turned off when Overheat temperature exceeded
ReefAngel.OverheatShutoffPorts = 0;
ReefAngel.OverheatShutoffPortsE[0] = 0;
// Use T1 probe as temperature and overheat functions
ReefAngel.TempProbe = T1_PROBE;
ReefAngel.OverheatProbe = T1_PROBE;
// Set the Overheat temperature setting
InternalMemory.OverheatTemp_write( 869 );


// Ports that are always on
ReefAngel.Relay.On( Port2 );
ReefAngel.Relay.On( Box1_Port3 );
ReefAngel.Relay.On( Box1_Port7 );

////// Place additional initialization code below here


////// Place additional initialization code above here
}

void loop()
{
ReefAngel.StandardLights( Port1,0,30,0,0 );
ReefAngel.StandardLights( Port3,12,0,19,0 );
ReefAngel.StandardFan( Port4,776,786 );
ReefAngel.WavemakerRandom( Port5,60,100 );
ReefAngel.WavemakerRandom( Port6,60,100 );
ReefAngel.StandardHeater( Port7,751,761 );
ReefAngel.StandardHeater( Port8,746,761 );
ReefAngel.StandardLights( Box1_Port4,9,0,10,16 );
ReefAngel.StandardLights( Box1_Port5,9,0,19,0 );
ReefAngel.StandardLights( Box1_Port6,7,0,8,16 );
ReefAngel.StandardLights( Box1_Port8,14,0,8,0 );
ReefAngel.PWM.SetDaylight( MoonPhase() );
ReefAngel.PWM.SetActinic( MoonPhase() );
////// Place your custom code below here


////// Place your custom code above here

// This should always be the last line
ReefAngel.Portal( "erikweitzel" );
ReefAngel.ShowInterface();
}

void DrawCustomMain()
{
int x,y;
char text[10];
// Parameters
#if defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params,
ReefAngel.PWM.GetDaylightValue(), ReefAngel.PWM.GetActinicValue() );
#else // defined DisplayLEDPWM && ! defined RemoveAllLights
ReefAngel.LCD.DrawMonitor( 15, 14, ReefAngel.Params );
#endif // defined DisplayLEDPWM && ! defined RemoveAllLights
pingSerial();

// Salinity
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,15,54, "SAL:" );
ReefAngel.LCD.DrawText( COLOR_DARKKHAKI,DefaultBGColor,39,54, ReefAngel.Params.Salinity );
pingSerial();

// Main Relay Box
byte TempRelay = ReefAngel.Relay.RelayData;
TempRelay &= ReefAngel.Relay.RelayMaskOff;
TempRelay |= ReefAngel.Relay.RelayMaskOn;
ReefAngel.LCD.DrawOutletBox( 12, 76, TempRelay );
pingSerial();

// Relay Expansion
TempRelay = ReefAngel.Relay.RelayDataE[0];
TempRelay &= ReefAngel.Relay.RelayMaskOffE[0];
TempRelay |= ReefAngel.Relay.RelayMaskOnE[0];
ReefAngel.LCD.DrawOutletBox( 12, 98, TempRelay );
pingSerial();

// Date and Time
ReefAngel.LCD.DrawDate( 6, 122 );
pingSerial();
}

void DrawCustomGraph()
{
}
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

You don't have any port with delay.
Are you sure you picked Delayed Start?
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

I'm pretty sure. Here's a screen shot of my Port 1 on Relay 1. Am I doing something wrong?
Attachments
Relay 1.jpg
Relay 1.jpg (122.25 KiB) Viewed 5577 times
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

That time delay is for halide ballasts as mentioned on the description. It only works on power up.
If you want for feeding/water change mode, you must use the Delayed option.
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

Thanks. I got confused. Appreciate the help.

I guess I can add one to the request list:

1. Able to label ports in the wizard
2. Delay mode create a "rest" period for the port to allow dosing of plankton and prevent skimming during that interval.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

What do you mean as "rest" period?
The port would be delayed x minutes before it turns on. Isn't it a "rest" period?
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

I have programmed dosing pumps to put in about 10mL of plankton at midnight. I would like the skimmer to stop functioning from 0000-0030 so that the plankton gets to circulate prior to being skimmed. Thus the rest period. Since I'm not manually feeding the tank it was never placed in a feeding mode. Makes sense?
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

Oh, that's what I was getting confused.
You don't want the delayed on function at all then.
Why don't you just place the skimmer as time schedule to turn on at 0:30 and turn off at 0:00??
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

I originally did that but I was running into problems after running the feed mode when the water will rise in the sump. When the system restarts after feed mode lapses, the skimmer would not have a delay and then overflow. I kind of need a hybrid of delay mode and timer mode.
rimai
Posts: 12857
Joined: Fri Mar 18, 2011 6:47 pm

Re: Delay doesn't appear to be working

Post by rimai »

Ahhh.
You need a custom code then.
Setup the port as delayed on, then use this custom code too:

Code: Select all

if (hour()==0 and minute()<30) ReefAngel.Relay.Off(Port1);
Roberto.
erikweitzel
Posts: 11
Joined: Thu Sep 06, 2012 5:52 pm

Re: Delay doesn't appear to be working

Post by erikweitzel »

Thanks!
Post Reply