Results 1 to 15 of 15

Thread: ATK with different pump code check

  1. #1
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163

    ATK with different pump code check

    The way I run my friend's Auto Top OFF is through a large kalkwasser reactor using a pump much larger than the PMUP. I would like to switch from using physical float switches to the optical sensors in the ATK and take advantage of the warnings/code used with it.(it has been running too long and so on)

    Will this work?:

    1. Setup LinkA_7_1 (renamed to ATK_7_1) as ATK with "task" like normal
    2. Plug nothing into LinkA_1, but keep it in auto
    3. Setup outlet on EB832 with this code for the pump actually doing the work:

    FallbackOFF
    SetOFF
    OSC004:02/000:08/000:00 Then ON
    IfOutlet ATK_7_1 = OFF Then OFF
    IfpH > 8.5 Then OFF
    IfCSalin < 29.8 Then OFF
    IfATKLow CLOSED Then OFF
    IfATKHig CLOSED Then OFF


    This way the Apex could think the normal LinkA_7_1 is doing the work and still send error codes like normal, but another pump will actually be doing the work.

  2. #2
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,464

    ATK with different pump code check

    That is a circuitous and unnecessarily complex way of doing it. If you’re not actually going to be using the DC24 output of the FMM to directly control anything, simply don’t use it. Instead, just put all of the the programming needed in the actual output which controlled the pump. Then change the DC24 output program to simply be fallback Off & Set Off since you won’t be using it.


    Remove the Set statement. It serves no purpose because OSC has explicit ON and OFF states.
    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 Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Don't bother with the link code. If you want alarms, use virtual outlets in case that port is ever needed for something. Also the standard task is going to nuisance alarm based on the way you have the OSC setup. I would use this as a starting point for the alarm. ATOstuck will let you know the ATO has stopped due to a clog or optical failure. ATOpH will let you know the ATO has stopped due to pH problems.

    ATOstuck
    Set OFF
    If Atk_lo OPEN Then ON
    If pH > 8.5 Then OFF
    Defer 120:00 Then ON

    ATOpH
    Set OFF
    If Atk_lo OPEN Then ON
    If pH < 8.6 Then OFF
    Defer 120:00 Then ON

    Email
    (Existing code)
    If Outlet ATKstuck = ON Then ON
    If Outlet ATOpH = ON Then ON




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

  4. #4
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    Quote Originally Posted by RussM View Post
    That is a circuitous and unnecessarily complex way of doing it.
    If you followed me around for a day you could probably justifiably repeat this phrase 50 times. (Though I am sure you'd quick come up with a short acronym for it. :-)

  5. #5
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    Quote Originally Posted by zombie View Post
    If you want alarms
    Thank you for catching this important part zombie. If I understand correctly I cannot just replicate the line, "If Error ATK_7_1 Then ON" for any outlet? Is the only condition that "Error" will be triggered be what is in your suggested ATOstuck? I thought it was more complex than that and the main reasoning behind my original way of doing things.

    I did realize the osc was going to mess with things.(though I really want to keep it to prevent too much Kalkwasser from being dumped in too quickly) I hadn't yet figured out if I could just modify what was in LinkA or if that still would not work.... (because maybe the "task" that sets up the ATK also generates code for Error I didn't have access to?)

  6. #6
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    The error is triggered solely by the default statement

    When On > 005:00 Then OFF

    When that is true, the error statement is also true. For an OSC based code, the when statement does more harm than good and has to be really long to let the outlet do it's thing. Notifications only using virtual outlets is the way to go for this.

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

  7. #7
    Master Control Freak RussM's Avatar
    Join Date
    Dec 2012
    Location
    California - US Pacific
    Posts
    22,464
    Quote Originally Posted by zombie View Post
    For an OSC based code, the when statement does more harm than good and has to be really long to let the outlet do it's thing.
    This is a rather strange way of putting it. I look at it differently, specifically that using OSC and 'when' in the same program is simply counterproductive and counter-intuitive; it is pointless IMO. 'when' is of value when the output's ON state is determined based on inputs, such as float switch, optical sensors, proves, etc. In those cases, the time can vary. The 'when' statement can then be used provide a hard limit to how long it can run. When using OSC, there is a finite and known maximum ON time, so 'when' is of no value. Simply put, they should not be used in the same program. I suppose there's a fringe case or two that might benefit from both, but I cannot think of one right now.


    LOL - I started to write "Jon,...." but you are both Jons So, this next part is for Jon of the Delawarean type...

    All you need is this in the output which actually controls the pump:

    Fallback OFF
    OSC 004:02/000:08/000:00 Then ON
    If pH > 8.5 Then OFF
    If CSalin < 29.8 Then OFF
    If ATKLow CLOSED Then OFF
    If ATKHig CLOSED Then OFF

    In this program, the ATO ON state is controlled by the OSC if the subsequent statements allow it.

    Don't use the FMM's 7_1 24VDC output at all; it's not needed, plus the code generated by the ATK Task isn't really compatible with using the OSC as you desire. The ATK Task is intended for fast and easy setup of an ATK used for typical ATO purposes, so it's use and it's resultant programming does not apply in this case.

    Then use zombie's two VOs to handle the alarms. 120 minutes of delay before those VOs can turn on though seems a bit long. But zombie may have been thinking of some reason for the 120 minutes that escapes me right now.
    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.

  8. #8
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    I chose 120 as a starting point because it is the shortest value I was able to use personally in OSC based codes that didn't give any nuisance alarms on a canopy top tank with no evaporative cooling. That number can be lowered for an open top tank, and can actually go as high as 12 hours for AIO tanks like biocubes. Granted these tests were all with floats that have a higher hysteresis in fluid level so an hour is probably sufficient.

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

  9. #9
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    Kalkwasser the way I am adding it is an odd case where the "when" and "osc" both can be helpful, though possibly not in the same "outlet". There is no secondary mixing pump, mixing bar, or magnetic stirrer. A Cobalt MJ900 pushes freshwater through the reactor and simultaneously stirs the kalk.(In a Two Little Fishies KW300) If I use a smaller pump the kalk won't stir enough. Larger pump kalk will stir too much. So short burst from the pump are needed to get the right mix of freshwater / kalk (supernatant) into the system and prevent solid kalk from entering burning macro algae with high pH.

    The top off will eventually catch up and this osculate shouldn't be running on and off all day long. If there is there is a small leak in the system it may attempt to run all day long and I need to know about it and it needs to stop trying to add water.(I've used ~7 leak sensors but it is still possible water leaked somewhere not detected)

    Ignore between the XXXs. I misunderstood.
    XXXIf I use the OSC code and virtual outlets as suggested, they would never trigger. In English that would be:
    · If an outlet that oscillates off every 4minutes stays on for 120minutes…
    Instead it may be better to say
    · the low sensor has been requesting more water for 25 minutes straight and is still asking for more. XXX


    So this is what I have come to:

    Outlet with MJ900 pump:
    Fallback OFF
    OSC 004:02/000:08/000:00 Then ON
    If pH > 8.5 Then OFF
    If CSalin < 29.8 Then OFF
    If ATKLow CLOSED Then OFF
    If ATKHig CLOSED Then OFF
    If Outlet ATOfail = ON Then OFF


    Virtual named ATOfail
    Set OFF
    If ATKLow OPEN Then ON
    Defer 025:00 Then ON

    Email
    (Existing code)
    If Outlet ATKfail = ON Then ON
    If pH > 8.5 Then OFF
    If CSalin < 29.8 Then OFF

    - - - Updated - - -

    Side notes:
    pH & conductivity were filler values to be dialed in after system matures and stabilizes a bit. On a side note I have used similar code in the past and you have to be careful to add enough water during a water change so the ATO doesn’t have to run too long. Skimmers can also pull too much out and cause the top off to stop, so I would likely add If Outlet ATOfail = ON Then OFF to the skimmer.
    The tank has massive evaporation. The top off is also added to the system far from the optical sensors, so there is a delay from when water is added to when its impact is seen(water level finally rises in sump).

  10. #10
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by TerraReef View Post
    If I use the OSC code and virtual outlets as suggested, they would never trigger.
    That is the entire point of the virtual outlets. They are based on switch states not the pump. That's the whole reason I suggested using them.

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

  11. #11
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    I understand now and did when you first wrote it. I just got a bit confused and mixed up when trying to understand part of Russ's last post.

    I think the only thing that differs from what you guys stated, and what I have above, is that I added
    If Outlet ATOfail = ON Then OFF (same as your ATOStuck)
    to the outlet controlling the pump, so if adding water isn't filling the tank it won't keep trying.



  12. #12
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    So both "when" and "Error" provide no additional functionality for advanced users. They just reduce the need for a quantity of virtual outlets and help make the code, that the "Task" creates, easier to understand for new users who run the task and look in at the programming later.

    Essentially, we have always been able to do what "When" and "error" let us do, but it required a few more lines code.

  13. #13
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by TerraReef View Post
    So both "when" and "Error" provide no additional functionality for advanced users. They just reduce the need for a quantity of virtual outlets and help make the code, that the "Task" creates, easier to understand for new users who run the task and look in at the programming later.

    Essentially, we have always been able to do what "When" and "error" let us do, but it required a few more lines code.
    When can provide extra functionality, it's just not the right statement for the objective in this case. The When statements sole purpose is to create a latching condition. Any case where you want something to lock on or lock off when a certain condition persists too long you want to use when. If you want something to stop while a condition persists, but reset automatically when the condition is no longer active, you want to use defer. Either method requires virtual outlets because the condition is the switch state and not the outlets state.

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

  14. #14
    Frequent Visitor
    Join Date
    Nov 2013
    Location
    Wilmington, DE
    Posts
    163
    I believe I understand. In order to undo this latching condition the outlet needs to be switched to manual on, or off, and then back to auto?


    At present the virtual outlet named ATOfail would be:
    Set OFF
    If ATKLow OPEN Then ON
    Defer 025:00 Then ON


    Would a working alternative to the virtual outlet be:
    Set OFF
    If ATKLow OPEN Then ON
    Defer 025:00 Then ON
    When On > 025:01 Then ON


    Then the virtual would remain ON even if temporarily the ATKLow CLOSES?


    I could see using the "When" as being wise in this situation. If the large skimmer goes off when ATOfail = ON.... the water in the skimmer will fall and make the water level in the sump rise. With out the latching (or stickiness as I am thinking of it) of "When", the virtual outlet may not function as I want it to.

    Thank you for helping me understand this. Takes me a little while sometimes.

  15. #15
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    If you want it to latch off until you manually intervene then yes, that would work. When the switch is closed for more than 25 minutes, the ATOfail outlet will change to manual ON. You will reset it by changing ATOfail back to AUTO. You would, however, need to change do one of two things though or this won't work.

    1. Change the statement in your pump and email from

    If Outlet ATOfail = ON Then ON

    To

    If Error ATOfail = ON Then ON


    2. Keep the defer from before and add a when statement at the end with a time of at least 1 second. The outlet statements are then unaffected.

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

Similar Threads

  1. Dosing pump Osc code check
    By TerraReef in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 4
    Last Post: 10-04-2019, 17:16
  2. Help! Check my code!
    By jstross94 in forum Misc Apex Usage & Programming
    Replies: 2
    Last Post: 07-28-2019, 18:05
  3. Review My Program AWC pump code check
    By arnoldsq in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 4
    Last Post: 05-04-2019, 11:32
  4. Check my ATK code
    By Dougdstecklein in forum Fluid Monitoring Module (FMM), FMK, ATK, LDK, and FMM Accessories
    Replies: 6
    Last Post: 01-30-2018, 22:22
  5. Can someone check my code?
    By Railcar79 in forum Misc Apex Usage & Programming
    Replies: 29
    Last Post: 03-31-2014, 20:05

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
  •