Results 1 to 7 of 7

Thread: I thought I had it. Why is this code not working?

  1. #1
    Frequent Visitor
    Join Date
    Aug 2017
    Location
    US, Central Time
    Posts
    161

    I thought I had it. Why is this code not working?

    Forgot to put the SET OFF command when I originally wrote this code so I ended up overdosing the aquarium for ALK. Finally got the DKH back to where I want it. Today I turned on the doser with the "correct command" added to the code. When it came tine to come on it worked fine. But after three minutes, it still had not turned off. Now, put this in context. I have it dosing 2.2 ml every other hour. That is a 2 minute window using BRS 1.1 ml/minute dosers. It came on at 4:00 pm and was set to go off at 4:02 pm. At 4:03 it had failed to turn off. So I manually turned it off. What's going on?

    I've reset everything by first turning on the outlet, hearing it come on, then moving to auto. Next dose is at 6:00 pm. It is supposed to turn off at 6:02. And I"m using the recommended outlet 4 on the energy bar 832.

    Here is the code. What's going on?

    Fallback OFF
    Set OFF
    If Time 00:00 to 00:02 Then ON
    If Time 02:00 to 02:02 Then ON
    If Time 04:00 to 04:02 Then ON
    If Time 06:00 to 06:02 Then ON
    If Time 08:00 to 08:02 Then ON
    If Time 10:00 to 10:02 Then ON
    If Time 12:00 to 12:02 Then ON
    If Time 14:00 to 14:02 Then ON
    If Time 16:00 to 16:02 Then ON
    If Time 18:00 to 18:02 Then ON
    If Time 20:00 to 20:02 Then ON
    If pH > 8.00 Then OFF
    Current Tank Info: Red Sea Reefer XL 425: Born on August 29, 2017

  2. #2
    Frequent Visitor rkpetersen's Avatar
    Join Date
    Jun 2017
    Location
    Near Seattle
    Posts
    940
    The way you have it programmed, each of those will run for 3 minutes, because each statement is true for a full three minutes. In other words, the timer doesn't shut off when it reaches the second time, it shuts off after the second time has passed. If you want it to only run for 2 minutes, you need statements like 'If Time 16:00 to 16:01 Then ON'.

    However, an easier way to do this is with the OSC command. To get what you want (plus one more dose at 22:00), your doser code would be:

    Fallback OFF
    OSC 000:00/002:00/118:00 Then ON
    If pH > 8.00 Then OFF

  3. #3
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Save yourself the hassle and use OSC

    https://www.reeftronics.net/adpg/dosingcalc.php

    Sent from my SM-G965U using Tapatalk

  4. #4
    Frequent Visitor rkpetersen's Avatar
    Join Date
    Jun 2017
    Location
    Near Seattle
    Posts
    940
    Hah. Posted at the same time as my edit!

  5. #5
    Frequent Visitor
    Join Date
    Aug 2017
    Location
    US, Central Time
    Posts
    161
    Quote Originally Posted by rkpetersen View Post
    The way you have it programmed, each of those will run for 3 minutes, because each statement is true for a full three minutes. In other words, the timer doesn't shut off when it reaches the second time, it shuts off after the second time has passed. If you want it to only run for 2 minutes, you need statements like 'If Time 16:00 to 16:01 Then ON'.

    However, an easier way to do this is with the OSC command. To get what you want (plus one more dose at 22:00), your doser code would be:

    Fallback OFF
    OSC 000:00/002:00/118:00 Then ON
    If pH > 8.00 Then OFF

    Break that into laymen terms for me...

    Is the 000:00 the start time? The 002:00 the run time for each operation? What is the 118:00?

    I tried it this way first. Frankly, it was a bit confusing. So I went longhand to getter understand what I was doing. it seemed easier to tweak it as I dial in my exact dose. Still not exactly sure what my does will be to maintain 9DKH.
    Current Tank Info: Red Sea Reefer XL 425: Born on August 29, 2017

  6. #6
    Frequent Visitor rkpetersen's Avatar
    Join Date
    Jun 2017
    Location
    Near Seattle
    Posts
    940
    First number is the start time offset from midnight, and also the off time 'before' activation.
    Second number is the 'on' time.
    Third number is the off time 'after' activation.
    Sum of the first and third numbers is the interval between one activation and the next.
    Entire sequence resets at midnight IF the total minutes (sum of all three numbers) divides evenly into 1440 (number of minutes in 1 day.)

    The OSC command isn't always intuitive, that's why the calculator zombie linked to is handy.

  7. #7
    Frequent Visitor
    Join Date
    Aug 2017
    Location
    US, Central Time
    Posts
    161
    RK, thanks for that breakdown. Very helpful.
    Current Tank Info: Red Sea Reefer XL 425: Born on August 29, 2017

Similar Threads

  1. Replies: 3
    Last Post: 11-27-2018, 20:33
  2. Has any thought been Given?
    By KRoss in forum APEX Fusion
    Replies: 1
    Last Post: 04-03-2017, 05:20
  3. Thought I finally figured out how to do an If Else command, but.....
    By dudedudedude in forum Misc Apex Usage & Programming
    Replies: 0
    Last Post: 08-11-2016, 10:39
  4. Heater outlet not working the way I thought it would.
    By clittrell in forum Apex Classic/Apex Lite/Apex Jr
    Replies: 3
    Last Post: 02-20-2016, 01:28
  5. ATO - thought had redundancy.. but ran for over 24 hours yesterday non-stop
    By reef55 in forum Apex Programming for Dosing, ATO, and AWC
    Replies: 5
    Last Post: 01-17-2016, 19:33

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
  •