Momentary Pushbuttons in Perspective

I understand Momentary Pushbuttons are not a good idea however what I am looking for the button to stay pressed when I click and hold and unpress when I let go. Right now it will not release when I let go or it will highlight the text on the button. This seems like a pretty simple ask but I cannot seem to find any solutions here.

I’ll start the debate. :grin:

There is nothing wrong with them, I use them all of the time for jog functions. But, I protect myself in the PLC for potential issues.

Yes, there are pitfalls, but momentary buttons are fine where they add useful functionality if you’re aware of the pitfalls and program accordingly.

Click-n-hold keeps a button down till I let go in Perspective. And it will also set/reset a bidirectionally bound value on a custom property via onMouseDown/Up event scripts on press/release (this method does NOT account for any of the pitfalls; I’m not recommending it).

Can you give us some more details on exactly what’s not working as desired for you?

1 Like

I have a multi-touch panel. Right now one of two things occur, either the button will not reset once I let go or the button won’t press and instead it highlights the text on the button.

A single touch driver will likely work better for this. If you need multi-touch, there may be others here who’ve figured out how best to work with it.

1 Like

Agree on specific driver for long press and hold. You typically can’t use what comes with them, at least all of the ones I have purchased all required a different driver.

How have you gotten this to work in perspective? I’m trying to utilize the mouse down and mouse up events to write a tag true/false on mouse down/up, respectively. It’s not working for me, though.

Nevermind… I’m stupid and just had a typo in my tag path. What I did works just fine.

How do you accomplish that? Just curious for my own learning purposes.

It depends. But, my goto is to immediately unlatch/reset if anything other than jogs. I don’t have any PLC software handy, but using Studio 5000 as an example… the button will be XIC and following that will be OTU. So, no chance to get a ‘stuck’ bit. On top of that I may have other conditions following, like auto/manual state. For things like jog, where the signal may be high for a little while, I won’t unlatch immediately as then it wouldn’t work at all, but I may use conditions like ‘in/at position’ to unlatch or a timer to reset. For jog I typically reset if in conditions like running in auto, running a sequence, etc.

@pturmel has gone in depth on how he handles things. In my opinion, it really depends on the project and what may come from any safety survey. I don’t think there is a one-size-fits-all approach on this.

1 Like