Prompting before momentary button click

Is there a way to control a momentary button just like a regular button without crazy scripting? I just want to prompt the user to hit OK before proceeding but since the momentary button uses three bindings i didn’t know if there was an easier way for the prompt than scripting each binding after the user hits OK.

Thanks

I had similar need but the only way I could figure it out was with scripting. I used a mem tag called ‘proceedOK’.
on the mouseEntered of the momentary button I used:

proceedOK = system.tag.read('proceedOK').value if proceedOK == 0: system.nav.openWindow('OK_popup') system.nav.centerWindow('OK_popup')

on the actionPerformed of the OK button on popup page I used:

system.nav.closeParentWindow(event) value = 1 system.tag.writeToTag('proceedOK', value)

then somewhere either on the momentary control or later I set the ‘proceedOK’ tag back to 0.

if the momentary is used on a touchscreen you may not be able to use the ‘mouseEntered’ event

I don’t understand how this would work.

Momentary buttons by definition are meant to be held down. If you pop up a confirmation, how would they hold the button down. They’d have to take their finger off the momentary button to deal with the prompt.

maybe I misunderstood what you mean…‘proceedOK’ is 0 starting off so it would open the popup. once they press OK it sets ‘proceedOK’ to a 1 so when the mouse is entered into the momentary the next time it will allow controls and you can set that proceedOK back to 0 elsewhere. it’s clunky I know but it works for what I needed, basically an ‘OK’ confirmation that they’re about to do a manual jog of a pump…

I plan on working on my version of the popup on a momentary button tomorrow, ill let you know what i come up with. Thanks for the suggestion

Carl,
Yes, a momentary is inherently for holding you finger on the button for any amount of time. But is (from what ive seen) 98% of the time used as a "on and then off" button. Unlike the oneshot which waits for the plc to reset it.
At the moment, not the first time and im sure won't be the last time, we need a confirmation popup before the tag on the momentary actually writes.
What would the cleanest way to do that be?

IMNSHO, the cleanest way is to not use a popup. Use a separate button or UI element, probably a latching button without a tag, that enables one or more buttons. If you need confirmation each time, have a mouse-up event resets the first button.

1 Like