Results 1 to 10 of 10

Thread: Is my programming overly complicated?

  1. #1
    Regular Vistor
    Join Date
    Nov 2016
    Location
    Central NOLA
    Posts
    16

    Is my programming overly complicated?

    Trying to make sure I have my programming correct. Please correct, or comment on any part that doesn't look right.


    The low switch is TOLow
    The high switch is TOHigh

    VTopOffLow and VTopOffHigh are the virtual outlets.

    TopOff is the actual outlet on my EB8 that is controlling a 50ml/m dosing pump for top off.


    VTopOffLow:
    If TOLow OPEN Then OFF
    If TOLow CLOSED Then ON

    VTopOffHigh:
    Fallback OFF
    If TOHigh OPEN Then OFF
    If TOHigh CLOSED Then ON

    TopOff:
    Fallback OFF
    If Output VTopOffLow = ON Then ON
    If Output VTopOffLow = OFF Then OFF
    If Output VTopOffHigh = ON Then OFF
    Defer 001:00 Then ON


    I have not added feed functions yet, but will after I get the main function done.

    Thanks,

  2. #2
    Frequent Visitor Todd's Avatar
    Join Date
    Jan 2013
    Location
    Huntsville, AL
    Posts
    583
    You didnt say what type of sensors you are using, float or optical, but either way I would expect the Low and High switch states to be opposite the other. In other words, the low switch will typically be 'wet' and the high would be 'dry'. Its a minor nit, but you dont need FALLBACK with a virtual outlet. You might consider adding a DEFER ... OFF to slightly overfill so that you are not constantly dithering at the low point. You could also make use of the WHEN command as a failsafe. Finally, consider what will happen if you accidentally disconnect a sensor, the default state of an Apex switch is OPEN when nothing is connected.

  3. #3
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    You don't need any virtual outlets for this. Use switch states directly in the code.

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

  4. #4
    Regular Vistor
    Join Date
    Nov 2016
    Location
    Central NOLA
    Posts
    16
    Quote Originally Posted by zombie View Post
    You don't need any virtual outlets for this. Use switch states directly in the code.

    You might be an engineer if...You have no life and can prove it mathematically.
    Would this work then:

    If TOLow OPEN Then OFF
    If TOLow CLOSED Then ON
    If TOHigh CLOSED Then OFF
    If TOHigh OPEN Then ON
    Defer 001:00 Then ON

  5. #5
    Frequent Visitor Todd's Avatar
    Join Date
    Jan 2013
    Location
    Huntsville, AL
    Posts
    583
    TopOff:
    Fallback OFF
    Set OFF
    If TOLow CLOSED Then ON
    If TOHigh CLOSED Then OFF
    Defer 001:00 Then ON
    Defer 001:00 Then OFF

    I used the Set command just because it stands out more as the default condition. The Defer OFF is optional. Again, I like to use it to slightly overfill particularly with a float switch so it more thoroughly biases it OFF.

  6. #6
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    You want this if they are float switches

    Set OFF
    If TOLow CLOSED Then ON
    If TOHigh OPEN Then OFF
    Defer 001:00 Then ON

    Or this if they are optical sensors

    Set OFF
    If TOLow OPEN Then ON
    If TOHigh CLOSED Then OFF
    Defer 001:00 Then ON


    You also want some failsafes at the end of which ever one matches.

    Defer 000:10 Then OFF
    Min Time 060:00 Then OFF
    When On > 005:00 Then OFF

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

  7. #7
    Regular Vistor
    Join Date
    Nov 2016
    Location
    Central NOLA
    Posts
    16
    Quote Originally Posted by Todd View Post
    TopOff:
    Fallback OFF
    Set OFF
    If TOLow CLOSED Then ON
    If TOHigh CLOSED Then OFF
    Defer 001:00 Then ON
    Defer 001:00 Then OFF

    I used the Set command just because it stands out more as the default condition. The Defer OFF is optional. Again, I like to use it to slightly overfill particularly with a float switch so it more thoroughly biases it OFF.
    Quote Originally Posted by zombie View Post
    You want this if they are float switches

    Set OFF
    If TOLow CLOSED Then ON
    If TOHigh OPEN Then OFF
    Defer 001:00 Then ON

    Or this if they are optical sensors

    Set OFF
    If TOLow OPEN Then ON
    If TOHigh CLOSED Then OFF
    Defer 001:00 Then ON


    You also want some failsafes at the end of which ever one matches.

    Defer 000:10 Then OFF
    Min Time 060:00 Then OFF
    When On > 005:00 Then OFF

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

    For the failsafes the defer means it stays on 10 seconds longer than needed?, the min time is it stays off for at least an hour, and the when on means it doesn't stay on longer than 5 minutes?

  8. #8
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Pretty much. The defer then OFF is to filter out waves or spikes that give a false reading much like the defer then on.

    The last statement means if the pump tries to run for longer than 5 minutes, turn off the ATO by setting the slider to manual OFF. It will remain that way until you move it back to AUTO in fusion and you can add this to your email to be notified if/when it happens.

    If Error ATOname Then ON

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

  9. #9
    Frequent Visitor Todd's Avatar
    Join Date
    Jan 2013
    Location
    Huntsville, AL
    Posts
    583
    Are you using actual float switches? Using the DEFER...OFF will overfill slightly. This will submerge the float just a bit and keep it from bouncing on the surface of the water. Again, not absolutely necessary since you are using DEFER...ON, just a little extra touch.

  10. #10
    Frequent Contributor zombie's Avatar
    Join Date
    Dec 2013
    Location
    Denver, CO
    Posts
    13,176
    Quote Originally Posted by Todd View Post
    Are you using actual float switches? Using the DEFER...OFF will overfill slightly. This will submerge the float just a bit and keep it from bouncing on the surface of the water. Again, not absolutely necessary since you are using DEFER...ON, just a little extra touch.
    It is necessary if you use min time then OFF. Otherwise the bouncing will lead to a continuously underfilled reservoir. Unless you're using a seriously overpowered pump, the extra 10 seconds will get the level right where you want it.

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

Similar Threads

  1. Overly sensitive WAV?
    By Radiata in forum WAV Powerheads
    Replies: 4
    Last Post: 05-16-2019, 13:32
  2. Question: Radion programming issue for Advanced programming vs. lighting wizard
    By Afm32607 in forum AquaBus Modules, Probes, and Breakout Boxes
    Replies: 1
    Last Post: 07-08-2017, 18:03
  3. Question: Radion programming issue for Advanced programming vs. lighting wizard
    By Afm32607 in forum Apex Programming for Lighting
    Replies: 1
    Last Post: 07-08-2017, 18:03
  4. Question: Complicated Logical And
    By Harry Muscle in forum Misc Apex Usage & Programming
    Replies: 5
    Last Post: 10-16-2016, 13:47
  5. It seems complicated
    By Ltjesse in forum Apex Programming for Lighting
    Replies: 2
    Last Post: 10-15-2013, 16:30

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
  •