Help – Apex Virtual Output & ATK Alarm

nickkohrn

Corals for President 2020
View Badges
Joined
Jul 18, 2018
Messages
1,903
Reaction score
5,121
Location
Lima, OH
What state or country do you live in
Ohio
Rating - 0%
0   0   0
I have a virtual output named TOPDOWNVIEW, which turns off all equipment that is responsible for moving water within the display so that I can easily view my corals, using a top-down perspective. Currently, the only code within TOPDOWNVIEW is:

Code:
Set OFF

The equipment that I would like to be turned off when TOPDOWNVIEW is manually turned on, such as my return pump and circulation pumps, contain the following code:

Code:
// ... code
If Output TOPDOWNVIEW = ON Then OFF
// ... code

This works as expected; when TOPDOWNVIEW is manually turned on, all pumps turn off. When TOPDOWNVIEW is manually turned off, all pumps turn on.

The issue that I am having is that my alarm is triggered when I manually turn TOPDOWNVIEW off after being on. When I manually turn TOPDOWNVIEW on, the alarm is not triggered. However, the alarm is triggered as soon as I manually turn TOPDOWNVIEW off. My alarm code follows:

Code:
Set OFF
If Output ALARMATO = ON Then ON
If ATOEMP OPEN Then ON
If ATKHI CLOSED Then ON
If Error RETPMP Then ON
If Error ATK Then ON
If Output TOPDOWNVIEW = ON Then OFF

The alarm that is being triggered is ATKHI CLOSED. It seems that I need code to prevent the ATKHI CLOSED alarm from being triggered for ~15 seconds after TOPDOWNVIEW is manually turned off.

The code for my ALARM output follows:

Code:
Fallback OFF
Set OFF
If ATKLOW OPEN Then ON
If ATKHI CLOSED Then OFF
When On > 005:00 Then OFF
Defer 000:10 Then ON
Defer 000:04 Then OFF
Min Time 060:00 Then OFF

The above code for the ALARM output was created by the ATK Task.

Can you help me understand what code I need, where to add it, and why to add it there?

P.S. I build iOS applications and other software for a career and for a hobby, so if you struggle to understand how to program a controller, don't feel bad about it. That's why forums like this exist. We are all here to help each other and share in this amazing hobby. :)
 
Since there's a delay before water levels return to normal after you turn off TOPDOWNVIEW, the simple thing to do is to move the monitoring of your ATKHI sensor into a virtual output and add a Defer delay to prevent it from triggering an alarm prematurely:

[Alert_ATKHI] -- virtual output
Set OFF
If ATKHI CLOSED Then ON
If Output TOPDOWNVIEW = ON Then OFF
Defer 000:20 Then ON

Then modify your existing alarm programming:

Set OFF
If Output ALARMATO = ON Then ON
If ATOEMP OPEN Then ON
If Output Alert_ATKHI = ON Then ON
If Error RETPMP Then ON
If Error ATK Then ON
If Output TOPDOWNVIEW = ON Then OFF

See my tutorials on Apex Virtual Outputs and Apex Alarms for more ideas using this technique:
 
Since there's a delay before water levels return to normal after you turn off TOPDOWNVIEW, the simple thing to do is to move the monitoring of your ATKHI sensor into a virtual output and add a Defer delay to prevent it from triggering an alarm prematurely:

[Alert_ATKHI] -- virtual output
Set OFF
If ATKHI CLOSED Then ON
If Output TOPDOWNVIEW = ON Then OFF
Defer 000:20 Then ON

Then modify your existing alarm programming:

Set OFF
If Output ALARMATO = ON Then ON
If ATOEMP OPEN Then ON
If Output Alert_ATKHI = ON Then ON
If Error RETPMP Then ON
If Error ATK Then ON
If Output TOPDOWNVIEW = ON Then OFF

See my tutorials on Apex Virtual Outputs and Apex Alarms for more ideas using this technique:
Thank you! I did read through your articles, which is what helped me set up my ALARMATO virtual output. I just didn't think about breaking out the low ATK sensor and monitoring it with another virtual output.

ALARMATO is a virtual output that detects when one of the optical sensors in my ATO reservoir is open. The reason for this is because I have a sensor that detects when the water level in the reservoir is low, but high enough that it's not empty. That sensor is ATOLOW. There is a second sensor, below the aforementioned sensor, which alarms me just before the reservoir is empty. That sensor is ATOEMP. The alarms triggered by the upper sensor aren't critical, but more of a convenience. So, I use ATOLOW to alarm me once, only while I am awake; if I don't get the alarm because it's during sleeping hours then I will get the alarm from the sensor that lets me know the reservoir is just about empty. :)
 
Since there's a delay before water levels return to normal after you turn off TOPDOWNVIEW, the simple thing to do is to move the monitoring of your ATKHI sensor into a virtual output and add a Defer delay to prevent it from triggering an alarm prematurely:

[Alert_ATKHI] -- virtual output
Set OFF
If ATKHI CLOSED Then ON
If Output TOPDOWNVIEW = ON Then OFF
Defer 000:20 Then ON

Then modify your existing alarm programming:

Set OFF
If Output ALARMATO = ON Then ON
If ATOEMP OPEN Then ON
If Output Alert_ATKHI = ON Then ON
If Error RETPMP Then ON
If Error ATK Then ON
If Output TOPDOWNVIEW = ON Then OFF

See my tutorials on Apex Virtual Outputs and Apex Alarms for more ideas using this technique:
This is exactly what I needed. It worked just fine. The only modification I needed to make was to change the Defer statement's value to 000:30.

Thanks, John!
 

IF YOU HAD TO TAKE A REEFING EXAM, WOULD YOU PASS?

  • Yes!

    Votes: 32 45.7%
  • Not yet, but I have one that I want to buy in mind!

    Votes: 9 12.9%
  • No.

    Votes: 26 37.1%
  • Other (please explain).

    Votes: 3 4.3%
Back
Top