Jump to content

Apex Prog Q: Push Button On / Off outlet


obrien.david.j
 Share

Recommended Posts

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?

Link to comment
Share on other sites

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 by GreenJeans
Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

 

  • Haha 1
Link to comment
Share on other sites

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.

  • Like 2
Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...