# Calling on the Apex Pros :)



## IvanD (Sep 29, 2013)

Hi Everyone,

I've been using the Apex system for over a year now but I'm starting to get more into the advanced programming stuff now and wanting more from my system.
Right now I've hit a programming hump as I can't seem to get my RODI system to turn on specifically the way I want it and was wondering if someone here knows why my code doesn't work.

The scenario is this:
I have a water solenoid on my RODI system that I can shut off and on from the apex. I have a water bin for saltwater mix and a float valve in this bin. I want the RODI water to run ONLY on Thursday between 6a-6p and stop running when the float valve is closed.

The problem:
The shut off works with the valve but for some reason the second the valve is open it turns back on again with no regard for day or time. So how do I correct my code (can I even correct it with the setup I have) so that it only runs on Thurs. between 6a-6p

The Programming:
Fallback OFF
Set OFF
If DoW SMTW-FS Then OFF
If Time 06:00 to 18:00 Then ON
OSC 000:00/045:00/015:00 Then ON
If Sa_Hal CLOSED Then OFF

Thanks for any help or time on this in advance


----------



## fesso clown (Nov 15, 2011)

Best to repost this in the Neptune Forum. 
http://https://forum.neptunesystems.com/
https://forum.neptunesystems.com/

You will get pro help there


----------



## noy (Nov 19, 2012)

Put the DoW statement as the last one.

Apex executes each line in the order that it occurs and the final state of things in the outlet determines whether the outlets is ON/OFF

Lets say its a Monday - so what is happening is that 

Initially the outlet is set to OFF
then it remains OFF because of the DoW line
BUT if the other lines turn it ON - it will turn the outlet ON - which effectively overrides the DoW line.

But if you have that line last - then regardless of what state thing were in before - the DoW will have the final say in On/Off.


----------



## IvanD (Sep 29, 2013)

Awesome, I will give that a try and confirm it works, thanks so much for the advice and taking the time to explain that. Makes way more sense now that you put it that way, good to know as I start doing more.


----------

