Results 1 to 12 of 12

Thread: Program outlet for ATO Reservior

  1. #1
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Virginia, USA
    Posts
    56

    Program outlet for ATO Reservior

    I am a new Apex user and struggle with programming so I thought that I would post a request for help with programming.
    I am looking to program an outlet to power-up for a period of time but only on certain days of the week. The outlet will power a 1/4" valve that will open to refill an ATO reservoir. As a backup, in case the float valve sticks, I wanted to add in some programming that states that when sensor X is activated (open/closed) to turn the outlet off.

    I am looking for it to do something like this:

    Sunday at 5pm on for 45min
    off M,T,W
    Thursday at 5pm, on for 45min
    off F,S
    Plus something for the backup sensor

    Thank you in advance for your help and assistance,
    Tom

  2. #2
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Cincinnati, ohio
    Posts
    709
    Look at the IF TIME and DOW commands. Remember order matters in how the code is executed

  3. #3
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by tom39 View Post
    I am a new Apex user and struggle with programming so I thought that I would post a request for help with programming.
    I am looking to program an outlet to power-up for a period of time but only on certain days of the week. The outlet will power a 1/4" valve that will open to refill an ATO reservoir. As a backup, in case the float valve sticks, I wanted to add in some programming that states that when sensor X is activated (open/closed) to turn the outlet off.

    I am looking for it to do something like this:

    Sunday at 5pm on for 45min
    off M,T,W
    Thursday at 5pm, on for 45min
    off F,S
    Plus something for the backup sensor

    Thank you in advance for your help and assistance,
    Tom
    Fallback OFF
    Set OFF
    If Time 17:00 to 17:44 Then ON
    If DOW -MTW-- Then OFF
    If Switchname CLOSED Then OFF
    Defer 000:10 Then OFF
    Min Time 045:00 Then OFF

    You might be an engineer if...You have no life and can prove it mathematically.

  4. #4
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Virginia, USA
    Posts
    56
    Ok, let me know what you think and if this would work.

    I want the switch to be off unless it is a Sunday or Thursday between 5pm and 5:45pm.
    I also don't want the outlet to turn on if the sensor is open, indicating that the reservoir is full.
    Additionally I want the sensor to shut off the outlet if the sensor opens during the time allotted.
    However, if an open sensor is triggered, I want it to wait 1 min before turning off the outlet to allow for water movement or variables during the filling process.

    Anyway, here is what I came up with:

    Fallback Off
    Set Off
    If Time 17:00 to 17:45 Then ON
    If DoW S---T-- then ON
    If Sw1 Open Then OFF
    Defer 001:00 Then OFF

  5. #5
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by tom39 View Post
    Ok, let me know what you think and if this would work.

    I want the switch to be off unless it is a Sunday or Thursday between 5pm and 5:45pm.
    I also don't want the outlet to turn on if the sensor is open, indicating that the reservoir is full.
    Additionally I want the sensor to shut off the outlet if the sensor opens during the time allotted.
    However, if an open sensor is triggered, I want it to wait 1 min before turning off the outlet to allow for water movement or variables during the filling process.

    Anyway, here is what I came up with:

    Fallback Off
    Set Off
    If Time 17:00 to 17:45 Then ON
    If DoW S---T-- then ON
    If Sw1 Open Then OFF
    Defer 001:00 Then OFF
    I would do this instead.

    Fallback Off
    Set Off
    If Time 17:00 to 17:43 Then ON
    If DoW -MTW-FS then OFF
    If Sw1 Open Then OFF
    Defer 001:00 Then OFF
    Min Time 045:00 Then OFF

    With these two changes it actually runs for exactly 45 minutes if the switch never opens and the min time line makes sure that if the switch opens at any point during the 45 minute cycle it doesn't try to turn on again until the next allowed day.

    You might be an engineer if...You have no life and can prove it mathematically.

  6. #6
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Virginia, USA
    Posts
    56
    Quote Originally Posted by zombie View Post
    Fallback OFF
    Set OFF
    If Time 17:00 to 17:44 Then ON
    If DOW -MTW-- Then OFF
    If Switchname CLOSED Then OFF
    Defer 000:10 Then OFF
    Min Time 045:00 Then OFF

    You might be an engineer if...You have no life and can prove it mathematically.
    Looks like we posted about the same time and thank you for your help. To help me understand how this will work, I have a few questions.

    So I am looking at your program and I notice that you use the DoW that I don't want and have it set to be off. Is there a reason why you would choose that instead of using the days you want it to be on?
    my next question would be: What is the last statement? I am not understanding that line of code.

    Again, thank you for your help with this.
    Tom

  7. #7
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Virginia, USA
    Posts
    56
    Quote Originally Posted by zombie View Post
    I would do this instead.

    Fallback Off
    Set Off
    If Time 17:00 to 17:43 Then ON
    If DoW S---T-- then ON
    If Sw1 Open Then OFF
    Defer 001:00 Then OFF
    Min Time 045:00 Then OFF

    With these two changes it actually runs for exactly 45 minutes if the switch never opens and the min time line makes sure that if the switch opens at any point during the 45 minute cycle it doesn't try to turn on again until the next allowed day.

    You might be an engineer if...You have no life and can prove it mathematically.
    You type a lot faster than me and answer my questions before I can figure out what I want to ask. Too Funny!

    Anyway, what you are saying makes total sense. Tank you very much for your help.

    Tom

  8. #8
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by tom39 View Post
    Looks like we posted about the same time and thank you for your help. To help me understand how this will work, I have a few questions.

    So I am looking at your program and I notice that you use the DoW that I don't want and have it set to be off. Is there a reason why you would choose that instead of using the days you want it to be on?
    my next question would be: What is the last statement? I am not understanding that line of code.

    Again, thank you for your help with this.
    Tom

    Because that's how you do AND logic with the apex. If Condition 1 is on then ON, then if Condition two's opposite is off then OFF translates to If Condition 1 and condition 2 are both together simultaneously then turn on. My last post in #5 I had missed an error using your code as the starting point and it is corrected above. If DOW -MTW-FS Then OFF is the correct statement.

    You might be an engineer if...You have no life and can prove it mathematically.

  9. #9
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,463
    The If Time statement should be If Time 17:00 to 17:44 Then ON to get a 45-minute run
    Please do not send me PMs with technical questions or requesting assistance - use the forums for Apex help. PM me ONLY if the matter is of a private or personal nature. Thanks.

  10. #10
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by RussM View Post
    The If Time statement should be If Time 17:00 to 17:44 Then ON to get a 45-minute run
    Not with a 1 min defer then off. Should be 43 for that.

    You might be an engineer if...You have no life and can prove it mathematically.

  11. #11
    Frequent Visitor Todd's Avatar
    Join Date
    Jan 2013
    Location
    Huntsville, AL
    Posts
    583
    Quote Originally Posted by tom39 View Post
    Is there a reason why you would choose that instead of using the days you want it to be on?
    my next question would be: What is the last statement? I am not understanding that line of code.
    Tom
    To elaborate a bit on what zombie said: the Apex executes commands top to bottom, and the last TRUE command prevails. So if you are trying to use two commands that you want to both be TRUE (Boolean AND), the last one will override the previous. So, you have to do the opposite. Set one condition and 'filter' the results using the opposite of the second condition.

    The Min Time command is a form of lock-out. Min Time 045:00 Then OFF means that when the state of the outlet becomes OFF, ignore all attempts to turn it back ON for at least 45 minutes. Personally, I find it helpful to mentally ignore the 'Then'.

  12. #12
    Frequent Visitor
    Join Date
    Jan 2016
    Location
    Virginia, USA
    Posts
    56
    Thank you all for your help. I finally got around to adding the 12v valve and programming the outlet. I haven’t had time to install the pressure switch yet as I am still on the fence if I want to use it or an optic eye instead or maybe use both, so I removed that line of programming until I do.
    Anyway, it appears to work great and once again thank you for your time and assistance.

    Tom



    Sent from my iPad using Tapatalk

Similar Threads

  1. RO reservior with selenoid and two float switches
    By Trido in forum Misc Aquarium Automation Discussions
    Replies: 3
    Last Post: 01-03-2017, 21:13
  2. what set should i use to program tunze ato outlet?
    By seasurf in forum EnergyBars 832 / 632 / 8 / 6 / 4
    Replies: 1
    Last Post: 09-13-2015, 18:56
  3. Help! New ato program for Avast Marine Works ato
    By michaelklayland in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 5
    Last Post: 07-13-2015, 15:24
  4. Possible to program Vortech virtual outlet to default outlet?
    By iCraigerz in forum Apex Programming for Vortech, Tunze, & Other Controllable Pumps
    Replies: 6
    Last Post: 03-01-2014, 02:19
  5. Ato what outlet should I use .
    By charliethetuna in forum EnergyBars 832 / 632 / 8 / 6 / 4
    Replies: 6
    Last Post: 09-16-2013, 12:13

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •