PDA

View Full Version : Ok lets do a code review!


djkms
12/03/2010, 01:13 PM
Hello all. Well the Neptune has been setup a couple of months and I wanted to do a code review with you all. I want to make sure I am getting the most out of my Neptune system and maybe see if there is any programming I can do better or things that need to be changed. Safety and fail safes of the utmost importance!

Here is what I have

Hardware
Neptune Apex
EB8x2
VDM
WXM
Breakout Box w/1 float valve in sump
Standard PH Probe - Display PH
Lab Grade PH Probe - CA Reactor

Intended future purchases
Water sensor (waterbug maybe?)

Outlets

EmailAlm_I5
Set OFF
If Switch1 CLOSED Then ON
If Temp > 82.0 Then ON
If Temp < 75.0 Then ON
If pH > 08.40 Then ON
If pH < 07.80 Then ON
If pH2 > 07.20 Then ON
If pH2 < 06.60 Then ON

LEDLeft
Fallback OFF
Set ON

LEDRight
Fallback OFF
Set ON

LEDCenter
Fallback OFF
Set ON

FugeLight
Fallback OFF
Set ON
If Outlet WDay = ON Then OFF

LiterMeter (used for auto water change)
Fallback OFF
Set OFF
If Switch1 CLOSED Then OFF
If Time 13:00 to 17:00 Then ON

TopOff
Fallback OFF
Set ON
If Switch1 CLOSED Then OFF
If FeedC 000 Then OFF

SkimmerPump
Fallback ON
Set ON
If Switch1 CLOSED Then OFF
If FeedD 030 Then OFF
If FeedA 030 Then OFF

Reactors
Fallback OFF
Set ON
If Switch1 CLOSED Then OFF

Regulator
Fallback OFF
If pH2 > 07.10 Then ON
If pH2 < 06.90 Then OFF
If pH < 07.90 Then OFF

CARio (used for CA Reactor Feed Pump)
Fallback OFF
Set ON
If Switch1 CLOSED Then OFF
If pH < 07.90 Then OFF

CAMag (CA Reactor recirc pump)
Fallback OFF
Set ON

MainPump
Fallback ON
Set ON
If Switch1 CLOSED Then OFF
If FeedA 002 Then OFF
If FeedD 002 Then OFF

Heater
Fallback OFF
If Temp < 78.0 Then ON
If Temp > 79.0 Then OFF
If Switch1 CLOSED Then OFF

Battery (Battery backup for Vortechs)
Fallback ON
Set ON

Vortech_5_1
Fallback Lagoon
Set Lagoon
If Outlet Sunrise = ON Then Tidal
If Outlet Day = ON Then Reef
If Outlet Sunset = ON Then Tidal
If FeedD 000 Then OFF
If FeedB 000 Then OFF
If FeedA 000 Then Feed

Vortech_5_2
Fallback Sync
Set Sync
If Time 08:00 to 10:00 Then ASync
If Time 12:00 to 14:00 Then ASync
If Time 18:00 to 18:10 Then ASync
If Time 18:10 to 21:00 Then ASync
If FeedD 000 Then OFF
If FeedB 000 Then OFF
If FeedA 000 Then Feed

BluLED_6_5
Fallback OFF
Set OFF
If Outlet Day = OFF Then AI-Night
If Outlet Sunrise = ON Then AI-Blue
If Outlet Day = ON Then AI-Blue
If Outlet Sunset = ON Then AI-SunSt

WhtLED_6_6
Fallback OFF
Set OFF
If Outlet WSunrise = ON Then AI-White
If Outlet WDay = ON Then AI-White
If Outlet WDay = ON Then AI-WStor
If Outlet WSunset = ON Then AI-SetW

WDay
If Sun 330/150 Then ON

Day
If Sun 300/240 Then ON

Sunrise
If Sun 240/000 Then ON
If Outlet Day = ON Then OFF

WSunrise
If Sun 270/-030 Then ON
If Outlet WDay = ON Then OFF

WSunset
If Sun 390/210 Then ON
If Outlet WDay = ON Then OFF

Sunset
If Sun 360/300 Then ON
If Outlet Day = ON Then OFF

_______________________________

As im sure you can tell with all my programming most everything is in my sump. If the float closes then it shuts everything in there off so nothing runs dry. I was thinking about running another float in the sump near the top which will let me know if it overflows but I think the only way this will happen is if my return line siphon holes don't add air and break the back siphon. I was also thinking about adding a float to the DT but again it will shut off the pump if the sump gets too low, didn't really see a need there.

I guess my auto top-off could malfunction and I could add a float in the sump to prevent it from overflowing with fresh water. However, I have a Tunze Osmolator and it seems pretty rock solid.

Any tweaks you can see that I can make to my programming? Things I can add to this setup to get more functionality? Maybe a conductivity probe? Water sensors? Anything else?

Thanks for taking the time to look at this!

swearint
12/03/2010, 03:18 PM
I am a little concerned with the TopOff outlet. You have it defaulted to be ON unless Switch1 CLOSED shuts it OFF. The issue is that the Apex switches default to OPEN. So if the float is unplugged accidentally or otherwise fails OPEN, the TopOff outlet will run indefinitely. Assuming you are using one of the common vertical miniature floats, it can be configured so that UP is OPEN.
I would do it as follows:

[TopOff]
Fallback OFF
Set OFF
If Switch1 CLOSED Then ON

An additional precaution would be to use an OSC statement to limit the duration of the topoff by setting up a repeating 'window' during which it is allowed to run.

The other thing you might consider doing is creating a Virtual Outlet for the float switch. This would allow you to see the status via the display or webpage. It also makes the code more readable to use 'If Outlet SumpHigh Then ...' as an example.


Todd

djkms
12/03/2010, 03:38 PM
Thanks for the reply! The float switch is a digital aquatics kit:
http://www.store.digitalaquatics.com/product-info.php?pid157.html
I have the switch hanging so the wires are coming out of the top (hope thats the right way). Would it be better to change the orientation of the float switch and change the value to OPEN then OFF since it defaults to open anyways? btw if I do reverse how the float is oriented it will be submerged at all times, not sure if that matters or not, it did state the valve was fully submersible.

The TopOff outlet is connected to my Tunze Osmolator. I have it defaulted to ON so it can continuously feed water as needed with its sensors. I have the float valve to turn it off encase there is a leak I don't want the Osmolator to continuously feed my tank freshwater.

I will do a virtual outlet for the float switch, thanks for the tip!

Any other suggestions or ideas?

ieatchinese
12/04/2010, 07:42 PM
Can you post what your AI profiles are??

Thanks in advance

djkms
12/05/2010, 12:23 AM
Can you post what your AI profiles are??

Thanks in advance

Sure thing:

AI-WStor (still acclimating corals)
Light maximum intensity 47
Cloudy light intensity 23
Cloud duration (MMM) 3
Cloudy time (%) 16
Probability of lightning (%) 0
Lightning intensity (%) 1

AI-Night
Ramp time (minutes) 1
Start intensity 1
End intensity 1

AI-SetW
Ramp time (minutes) 55
Start intensity 47
End intensity 0

AI-Blue
Ramp time (minutes) 60
Start intensity 1
End intensity 59

AI-SunSt
Ramp time (minutes) 60
Start intensity 59
End intensity 1

AI-White
Ramp time (minutes) 60
Start intensity 0
End intensity 47

swearint
12/05/2010, 09:49 AM
Thanks for the reply! The float switch is a digital aquatics kit:
http://www.store.digitalaquatics.com/product-info.php?pid157.html
I have the switch hanging so the wires are coming out of the top (hope thats the right way). Would it be better to change the orientation of the float switch and change the value to OPEN then OFF since it defaults to open anyways? btw if I do reverse how the float is oriented it will be submerged at all times, not sure if that matters or not, it did state the valve was fully submersible.

See that little clip on the end of the stem? Pop that off, then remove the float and flip it 180 degrees and re-install. That will reverse the operation, but the wires will be on top as indicated.


The TopOff outlet is connected to my Tunze Osmolator. I have it defaulted to ON so it can continuously feed water as needed with its sensors. I have the float valve to turn it off encase there is a leak I don't want the Osmolator to continuously feed my tank freshwater.

Again, my preference would be to keep it OFF, and then have it come ON only during certain times AND if the float allows it.

You might also want to install a low sump switch to give you a warning and shut down certain devices.

Todd