obrien.david.j Posted April 22, 2020 Share Posted April 22, 2020 Okay, Apex programming question. (inputs from everyone and @SuncrestReef welcome) I've got a break out box with a push button connected to one of the switch inputs. I'd like to use it like an On / Off light switch. Push the button, Outlet on EB832 goes on. Push the button, Outlet on EB832 goes off. Push the button, outlet goes On. (you get the idea) Any idea how to program this? Quote Link to comment Share on other sites More sharing options...
GreenJeans Posted April 22, 2020 Share Posted April 22, 2020 (edited) Personally, I'd swap it for a 2p2t switch and simplify the whole problem https://www.amazon.com/MTS-101-Position-Miniature-Toggle-Switch/dp/B0799LBFNY/ref=sr_1_6?crid=37LBZYGJANK3Y&dchild=1&keywords=2p2t+toggle+switch&qid=1587525982&sprefix=2p2t%2Caps%2C224&sr=8-6 If Sw = closed Then ON, problem solved Edited April 22, 2020 by GreenJeans Quote Link to comment Share on other sites More sharing options...
SuncrestReef Posted April 22, 2020 Share Posted April 22, 2020 This has been covered in the Neptune Community Forums. It's called a toggling momentary switch, and requires some virtual outputs to track the current state. Here's a modified version for your light: [Light] <-- EB832 output controlling your light If Output ToggleSet = ON Then ON If Output ToggleRst = ON Then OFF [ToggleSet] <-- virtual output Set OFF If Switchname CLOSED Then ON If Output Light = ON Then OFF Defer 000:01 Then ON Defer 000:05 Then OFF [ToggleRst] <-- virtual output Set OFF If Switchname CLOSED Then ON If Output Light = OFF Then OFF Defer 000:01 Then ON Defer 000:05 Then OFF You need to hold the push button for 1 second to toggle the light, and you need to wait 5 seconds in between turning it On and turning it Off. It can be tricky because if you hold the button too long it will toggle on and off and on and off. I agree with @GreenJeans that a physical toggle switch is a simpler solution. Source: https://forum.neptunesystems.com/showthread.php?25351-Push-button-on-off Quote Link to comment Share on other sites More sharing options...
GreenJeans Posted April 22, 2020 Share Posted April 22, 2020 d'oh, you posted the solution before I got there! I got here, and was about to try adding the defer statements... v1 (turn on): if output a OFF then OFF if SW closed then ON v2 (turn off): If output a ON then OFF if SW closed then ON a (outlet): if v1 ON then ON if v2 ON then OFF 1 Quote Link to comment Share on other sites More sharing options...
obrien.david.j Posted April 22, 2020 Author Share Posted April 22, 2020 That was fast help. The easy solution would be to replace the botton with a latching push button switch, which I considered. But I've got the box, got the switch... So I'll try the programming approach first. THANKS! https://www.amazon.com/s?k=Latching+Push+Button+Switch&i=industrial&ref=nb_sb_noss_2 Quote Link to comment Share on other sites More sharing options...
obrien.david.j Posted April 26, 2020 Author Share Posted April 26, 2020 Update on an Apex Push-Button light switch. A. Programming Works B. Super Touchy and not intuitive. Press the button, Count to two, (before anything has happened), Let the button go. Sometimes lights toggle, and stay toggled. Sometimes lights toggle, and then switch back to prior state. This is not a workable long term solution. But had to try. Thought I'd give everyone an update. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.