Results 1 to 6 of 6

Thread: Fill water tank only when it completely empty

  1. #1
    New User
    Join Date
    Oct 2016
    Location
    Russia
    Posts
    4

    Question Fill water tank only when it completely empty

    I want really simple task to be programmed in APEX, but in APEX logic it looks not so simple as it sounds (at least for me).
    So, I have tank with water and two sensors in it (SW 13_3 for upper level and SW 13_4 for bottom level) and I have let's say pump (to fill tank) on OUTLET 2_5.
    And what I want just to fill tank by pump only when it completely empty.

    So we have 3 states:
    1 - when all sensors under water (both CLOSED state) -- FULL: OUTLET 2_5 OFF
    2 - when upper sensor clear (OPEN) but bottom sensor still CLOSE -- DECREASES: OUTLET 2_5 OFF
    3 - when both sensors OPEN -- EMPTY: OUTLET 2_5 ON

    IMG_0580.JPG

    The problems is that we have state 4 which by sensors looks like state 2. I mean, when happens state 3, pump is turning on and filling bottom sensor and occurs "state 2/4" and it stops filling but in this situation we want fillup up to SW 13_3. How can I solve the problem? In my point of view the difference between "state 2" and "state 4" in previous values of SW 13_4, but as far as I know it's not possible to check previous value of sensor...

  2. #2
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,463
    It is quite simple:

    Fallback OFF
    If lowsensor OPEN Then ON
    If highsensor CLOSED Then OFF

    The outlet will turn on when the low sensor is OPEN. It will stay on until the high sensor goes CLOSED. It will then stay off until the reservoir is low and the low sensor is OPEN.
    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.

  3. #3
    Frequent Visitor
    Join Date
    Mar 2017
    Location
    Wellington, NZ
    Posts
    114
    I have got something similar to what you want to do, however I have got a number of failsafes in my programming. What Russ has posted will definitely work and as you can see by my code it is the same base. I suspect you have got a Set OFF in the programming which means if the low sensor sees water, it will stop the program.

    I have 4 optical sensors incase there was a failure on the main ones running the system, a really empty optical and an over filled optical (plus physical float valve)

    This is my code:

    If ROEMPT OPEN Then ON (This activates the program if the ROFILL doesn't, or I use more water before it has had time to fill and turns off the pumps to not run dry)
    If ROFILL OPEN Then ON (This is what activates the program)
    If ROFULL CLOSED Then OFF (This is what stops the program)
    If ROEMER CLOSED Then OFF (This is the overfilled sensor that sends alerts (in alert code) and also stops the program)
    If Output ROLeak = ON Then OFF (This is my leak sensors, stops the program and alerts me)
    Min Time 720:00 Then OFF (This means it will only run once in 12 hours)
    Defer 001:00 Then ON (Sensor needs to be active for 1 minute to start)
    Defer 001:00 Then OFF (Sensor needs to be active for 1 minute to stop)

  4. #4
    New User
    Join Date
    Oct 2016
    Location
    Russia
    Posts
    4
    Quote Originally Posted by RussM View Post
    It is quite simple:

    Fallback OFF
    If lowsensor OPEN Then ON
    If highsensor CLOSED Then OFF

    The outlet will turn on when the low sensor is OPEN. It will stay on until the high sensor goes CLOSED. It will then stay off until the reservoir is low and the low sensor is OPEN.
    Wow you mean "Set" action is not mandatory line in code? And without it will keep state until next condition not happens? Cool thx

  5. #5
    New User
    Join Date
    Oct 2016
    Location
    Russia
    Posts
    4
    Quote Originally Posted by DavidNZ View Post
    I suspect you have got a Set OFF in the programming which means if the low sensor sees water, it will stop the program.
    Exactly =)

    Quote Originally Posted by DavidNZ View Post
    I have 4 optical sensors incase there was a failure on the main ones running the system, a really empty optical and an over filled optical (plus physical float valve)

    This is my code:

    If ROEMPT OPEN Then ON (This activates the program if the ROFILL doesn't, or I use more water before it has had time to fill and turns off the pumps to not run dry)
    If ROFILL OPEN Then ON (This is what activates the program)
    If ROFULL CLOSED Then OFF (This is what stops the program)
    If ROEMER CLOSED Then OFF (This is the overfilled sensor that sends alerts (in alert code) and also stops the program)
    If Output ROLeak = ON Then OFF (This is my leak sensors, stops the program and alerts me)
    Min Time 720:00 Then OFF (This means it will only run once in 12 hours)
    Defer 001:00 Then ON (Sensor needs to be active for 1 minute to start)
    Defer 001:00 Then OFF (Sensor needs to be active for 1 minute to stop)
    Thanks for this more advanced logic, I will think about it later.

  6. #6
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,463
    Quote Originally Posted by Ilya View Post
    Wow you mean "Set" action is not mandatory line in code? And without it will keep state until next condition not happens? Cool thx
    Nope. There's a sticky post explaining when and when not to use a Set statement: https://forum.neptunesystems.com/sho...l=1#post114462
    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.

Similar Threads

  1. Fill my RO water tank
    By sadams303 in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 5
    Last Post: 06-17-2020, 14:10
  2. How to manually fill RO tank without risking leak
    By ajs2294 in forum Misc Apex Usage & Programming
    Replies: 4
    Last Post: 04-27-2020, 11:57
  3. Help! ATK to fill RO tank
    By Bjopi in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 6
    Last Post: 01-02-2019, 14:30
  4. ATK in AUTO wont fill the tank
    By Bugger in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 1
    Last Post: 10-11-2017, 14:13
  5. Auto fill AWC reservoir when empty, but pause AWC
    By markstubb in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 10
    Last Post: 06-11-2017, 21:07

Tags for this Thread

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
  •