tom39 May 21, 2018 May 21, 2018 If you would, please critique the below program that I am looking to use to program a pump. 1. The output is to remain off until triggered by the action of a virtual switch (MAINT_WC). 2. Once triggered, the output is to remain off or defer for 60 sec 3. After the 60 sec defer period, the output would turn on for 4 min, then remain off. Here is the programming - Fallback OFF Set OFF If Output MAINT_WC = ON Then ON Defer 001:00 Then ON Min Time 005:00 Then OFF Thanks for looking, Tom G Sent from my SM-G930V using Tapatalk
AquaHaus May 22, 2018 May 22, 2018 Where is this pulling water from? Would you want failsafes like floor sensors or float switches to override if it didn’t go according to plan Sent from my iPhone using Tapatalk
scott711 May 22, 2018 May 22, 2018 I don't think this part will work with how you described: Defer 001:00 Then ON
tom39 May 22, 2018 Author May 22, 2018 Where is this pulling water from? Would you want failsafes like floor sensors or float switches to override if it didn’t go according to plan Sent from my iPhone using Tapatalk The pump is pulling water from my sump and sending it down the drain. I have an ADL and a sump pan but atm I am manually refilling. So at this point there is no chance for a flood. Sent from my SM-G930V using Tapatalk
tom39 May 22, 2018 Author May 22, 2018 I don't think this part will work with how you described: Defer 001:00 Then ON Tou are correct, it doesn't work. I realized that my thought process using a defer statement was flawed. Once i figured that out I started over. I worked on the programming for a few hours last night and I have made a few adjustments to this and other program statements and also added in a second virtual switch with statements that are mainly used as a timer for other switches. Sent from my SM-G930V using Tapatalk
tom39 May 28, 2018 Author May 28, 2018 With a bit more tweeking, I finally finished my automatic water change programming. So now to do a water change the hardest part of the whole thing is carrying the water into the house but soon I will automate the refill end of it and then I will be able to sit on the couch and not have to hardly lift a finger. Anyway, here is the final programming for all of my outlets - MAINT_WC (1st Virtual Switch)Fallback OFFSet OFF MAINT_WC2 (2nd Virtual switch)Fallback OFFSet OFFIf Output MAINT_WC = ON Then ONDefer 005:00 Then ON Water change pumpFallback OFFSet OFFIf Output MAINT_WC = ON Then ONIf Output MAINT_WC2 = ON Then OFFDefer 001:00 Then ONDefer 000:10 then OFF Return PumpFallback ONSet ONIf Output MAINT_WC = ON Then OFFIf Output MAINT_WC = OFF Then ONDefer 000:05 Then OFFDefer 000:05 Then ON PS FeedFallback ONSet ONIf Output MAINT_WC = ON Then OFFIf Output MAINT_WC = OFF Then ONDefer 000:15 Then OFFDefer 000:45 Then ON ATS FeedFallback ONSet ONIf Output MAINT_WC = ON Then OFFIf Output MAINT_WC = OFF Then ONDefer 000:10 Then OFFDefer 000:30 Then ON Main HeaterFallback OFFSet OFFIf D_Tmp < 79.0 Then ONIf D_Tmp > 80.0 Then OFFIf Output MAINT_WC = ON Then OFF Defer 001:00 Then ON Secondary HeaterFallback OFFSet OFFIf D_Tmp < 77.0 Then ONIf D_Tmp > 78.0 Then OFFIf Output MAINT_WC = ON Then OFFDefer 001:00 then ON ATOFallback OFFSet OFFIf ATO_5_ CLOSED Then ONIf ATO_5_ OPEN Then OFFIf Output MAINT_WC = ON Then OFFDefer 002:00 Then ONMin Time 010:00 Then OFF
scott711 May 29, 2018 May 29, 2018 A couple of questions/comments on your programming. Why do you have the two virtual outlets? Many of the outlets you have unneeded redundancy (it doesn't add redundancy, it just makes the code hard to read) for example: Return PumpFallback ONSet ONIf Output MAINT_WC = ON Then OFFIf Output MAINT_WC = OFF Then ONDefer 000:05 Then OFFDefer 000:05 Then ON You don't need both of these: If Output MAINT_WC = ON Then OFFIf Output MAINT_WC = OFF Then ON Because you have the "Set ON" statement. So whenever the MAIN_WC is OFF, the outlet will be "SET ON". I am also not sure why you have Two Defer statements: Defer 000:05 Then OFF Defer 000:05 Then ON When using the "Defer" statement, Defer 05:00 Then OFF = Defer the OFF state for 05 minute. (ON would be immediate). You also have the Set On statement so the Outlet would be "On" if any of the statements below it are false. Instead of a second "Defer" you could use the "Min" statement. ie Min Time 5:00 Then OFF = Minimum Time of 5 minutes in the OFF state. (ON would be immediate). For the heater statements, you don't need the Set "OFF". Your Main Heater: Fallback OFFSet OFFIf D_Tmp < 79.0 Then ONIf D_Tmp > 80.0 Then OFF What will happen when using the Set command with a heater is that this program will not cause the outlet to operate over the desired range of temperature; instead, it will operate around a single temp of ~ 78.9 degrees. If the temp drops to 78.9, the heater outlet will turn ON, and it will shut off as soon as the temp goes up to 79.0. TheIf D_Tmp > 80.0 statement does nothing here, because the Set OFF will be the only true statement as soon as the temp goes up to 79.0. The result will be that your heater gets switched on and off fairly rapidly. If you want a cleaner code and the temp to stay at 80, then just use this: If D_Tmp < 79.0 Then ONIf D_Tmp > 80. Then OFF The heater will turn ON until the temp hits 80 and then will turn off, it will stay off until the temp goes to 79 again and will turn On until the temp exceeds 80. I think in your case you may want to look at incorporating the "when" or "and" statements: for example: The 'When' will be an force an output to the OFF state if it has been ON for more than a specified duration: When On > 005:00 Then OFF For using the "AND" command, for the outlet you need to turn off if both virtual outelts are true: ie: XandYSet OFFIf X = ON Then ONIf Y = OFF Then OFF Then add If Outlet XandY = ON Then OFF Hopefully it all makes sense and I understood what you were trying to do in your code. If you need more info: for AND: https://forum.neptunesystems.com/showthread.php?7057-How-to-incorporate-AND-in-your-programming for WHEN: https://forum.neptunesystems.com/showthread.php?18393-Programming-enhancements-in-Apex-(2016)-AOS-v5-02-and-Apex-Classic-Firmware-4-52 For the DEFER and MIN TIME: https://forum.neptunesystems.com/showthread.php?52-Defer-and-Min-Time-statements For the SET command: https://forum.neptunesystems.com/showthread.php?14598-New-APEX-Users-Read-This-Thread! And general programming usage: https://forum.neptunesystems.com/forumdisplay.php?33-Misc-Apex-Usage-amp-Programming
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now