Perspective Button onClick Action scripting

Looking to get help scripting a momentary push button using the onClick action.

Very new to python. So far i've created a custom parameter at the root container level called: "start_man" and using that in my onClick script.

How do I script "self.parent.custom.start_man" to momentarily turn the boolean tag on which i've binded to "start_man"

Momentary push buttons through HMIs are not recommended. This thread will lead to discussions about them:

Or just all these threads (notice all the problems they tend to have):
https://forum.inductiveautomation.com/search?q=momentary%20push%20button

However, if you have to, you could use system.tag.writeBlocking in a Button's onMouseDown and onMouseUp events. I would personally not do it this way.

How would you do something like a jog command? The jog would only be active while the operator holds down the button.

With a hard-wired button.
Read post #2 and the linked articles carefully. The topic has been discussed many times on the forum.

2 Likes

I read through some of the posts, and it looks like this is an issue with the Vision button component. I'm working strictly with Perspective and, unless I'm missing something, I don't really see a way to make a momentary button.

I have three types of buttons in my project, buttons that write a value on action (set button), buttons that set a value and then reset it, and toggles.

The set and reset buttons are what I was referring to as momentary. The way I do these can vary but, for the most part are one of the following:

  1. Set value onClick, reset value onMouseUp
  2. Set value onActionPerformed, wait, reset value

Do you see any issues with my understanding of buttons?

The discussions go back to the Vision-only days. The fundamental problems are not Vision-specific. And Vision has the tools (local code execution) with which to create robust work-arounds. (Not trivial, but possible.)

Perspective simply cannot do this reliably. The part that does the "reset value" cannot be guaranteed to happen on time, if at all. Do not try to Perspective perform two write operations, separated by time or user action, from one button. Full stop.

Hardly any UI on the market can do this truly reliably, but most are far more reliable than anything browser-based.

1 Like

FWIW, I've personally had issues with momentary buttons on several platforms, In touch, FactoryTrash, C-More (see less) and Vision. So it's not just an Ignition thing, it's a thing thing.

As far as jog buttons, unless the HMI/OIT is right next to the equipment, jog buttons are bad practice regardless. For maintenance jog they should be hardwired as previously suggested.

1 Like

For majority cases I let the PLC reset the HMI bit but, this jog case is the one thing that bothers me. The motion controllers have their own IDE which has a jog button that seems to work without fail. I want to put similar functionality into the HMI, locked behind an elevated user, for troubleshooting purposes. I do have some hardwired controls that I can use if there is no other way.