This post is an addendum to what is listed in the comprehensive user manual regarding "latch" outlets. While the approach listed there does technically work, there are some issues that users may face without a few extra lines of code.
Problems
1. Upon a restart of the apex, a latch outlet has an indeterminate state since there is no Set OFF statement. As a result, the latch outlet could be set to ON even if the latching condition does not occur
2. Some users may encounter what I call the "sticky latch" bug. This bug causes a latch outlet to turn on when set from off to auto even if the latch condition does not occur. This can sometimes be fixed by updating the firmware, but not in all cases.
Solutions
1. Force the latch to be in the off state for 1 min following a restart or power outage
2. Use a reset VO to reset the latch outlet instead of the approach shown in the CRM. The latch can be reset by turning the reset VO to ON, wait for the latch to turn off, and then set the reset VO back to AUTO.
Example
This example is how to properly create a latch outlet for an ATO pump maximum run timer. The latch is set to turn on (to shut off the pump and keep it off) if the pump runs for more than 10 minutes at a time.
Res_Latch (a virtual outlet)
Set OFF
ATO_Latch (a virtual outlet)
If Outlet ATO_Pump = ON Then ON
If Outlet Res_Latch = ON Then OFF
If Power Apex OFF 001 Then OFF
Defer 010:00 Then ON
ATO_Pump (the EnergyBar outlet for the ATO pump)
(Other coding)
If Outlet ATO_Latch = ON Then OFF
You might be an engineer if...You have no life and can PROVE it mathematically.
Bookmarks