How to implement "Momentary Button" function in Perspective View

In Vison there is “Momentary Button” to easily achieve Pulse output command to PLC, but move to Perspective View, I can find same function accordingly, can someone advise?
Thanks

Momentary buttons in any SCADA platform are general a bad idea, as any comms dropout will result in the bit staying high. These should be converted to auto-resetting bits in the PLC.

If you still want to go this route, or have your hands tied, then you can always just use a Script to write the value to on, then use invokeLater with a delay time to write the tag back off.

E.g.

tagPath = 'tag/path'
system.tag.writeBlocking([tagPath], [1])
def turnOff():
	system.tag.writeBlocking([tagPath], [0])
system.util.invokeLate(turnOff, 2500)

Of course, you could also create this as a template View to use everywhere

2 Likes

I suspect IA hasn’t implemented it because they can’t make browsers behave well enough for it to be reliable. Vision’s Momentary Button is not reliable by itself. Search this forum for stuck momentary button for a variety of discussions on the topic and the fundamental problems behind it.

2 Likes

Hello all,

I'm currently converting an old wonderware app to ignition which seems to have momentary buttons all over the place which I know isn't ideal, but have no other choice at the moment. I'm using the script above and it seems like the valve I'm writing to is getting stuck at a value of 1 and not going back to 0. Do you mind reviewing the script that I'm using to see if there are any potential issues with it? Thank you.

def runAction(self, event):
	system.tag.writeBlocking([self.view.custom.CLOSE_CMD], [1])
	def turnOff():
			system.tag.writeBlocking([self.view.custom.CLOSE_CMD], [0])
	system.util.invokeLate(turnOff, 2500)

Sure you have a choice. Use Vision instead of Perspective. Spend the extra engineering on the momentary buttons to use repeating message verification. (Or purchase a module that offers it in a neat package, for EtherNet/IP class 1 applications. /shameless plug.)

Momentary buttons in Perspective are unfixably unreliable. Full stop.

2 Likes

Do you mind elaborating more on repeating message verification?

Also, where can I find more info on the module? I'd like to take a look.

Thanks, I fixed the post.

The technique uses a fast timer tightly bound to the button in the UI to check and send "I'm still pressed" messages through the full comms path, with a PLC timeout catching any hiccups to release the button. Also requires some metadata to prevent re-activation if a UI script stalls and resumes.

Perspective cannot do this because its scripts run in the gateway, not in the UI. It might be possible to do with javascript in a custom Perspective component, but I haven't figured out how, and nobody else wants to touch it with a ten-foot pole.

For Vision, my EtherNet/IP module offers a Momemtary I/O Button, that pairs with a class 1 Host device in adapter mode (typically). It does the tight-coupled messaging internally from Vision Client to gateway, and relies on class 1 I/O status automatic monitoring in PLCs. Class 1 I/O is also a repeating message technology, and PLC provide native monitoring of connection/module status.

Latest:

Older description of the technique one would use here:

Yeah I spent about half a day thinking about this, before realizing “hell no”.

1 Like