Momentary button: not deterministic behaviour

Hi,
I need some explanations on the Momentary button behaviour. I have a Momentary button whose Control value and Indicator value are connected to a PLC bit variable (S7-1500 over Kepware OPC UA Server). Min Hold Time property is set to 2000 msec. The scan class of the connected variable is


I’m using Ignition with mouse/keyboard (final installation will be on a touch-screen). What I’m experiencing is that when I click the Momentary button, the connected bit on the PLC keeps the ON value for a time between 0 and 3000 seconds. I’m not warried about the 3000 seconds, but about the 0 seconds: sometimes even if I click the button with the mouse, nothing is written to the PLC. Is there anything I must pay attention to in the scan classes or driver configuration?

Thank you in advance
regards

Momentary buttons in GUIs are a pit of despair. :cry:
The chain of messages needed from client to gateway sqltag to gateway opc item to opc server to plc for set, then again for reset, possibly from multiple clients, provides numerous opportunities for weird timing effects. Just say no.
Use a standard button with a write tag operation in the actionPerformed event. Catch the leading edge in the PLC, delay it for a second or two, then reset it in the PLC.

1 Like

I saw a similar issue and dropped my Min Hold Time to 500 msec, thinking they were not holding the button long enough to write the tag value down. It seemed to help, but I think occasionally it does not write down the value.

I may go back and just use a regular button and set values on mouse pressed and unset it on mouse release. I’d rather not, but then I’d be sure it was behaving the way I intended it to. Problem with mouse events is they don’t care about if the button is enabled or not.

[quote=“Kraenbring”]I may go back and just use a regular button and set values on mouse pressed and unset it on mouse release. I’d rather not, but then I’d be sure it was behaving the way I intended it to.[/quote]This will be even less reliable than the momentary button, as a simple click will create press and release events with practically no time gap. Easy for the on value to be replaced by the off value in the PLC before the PLC logic has a chance to see it.
If you absolutely cannot put the release code in the PLC, at least put it in the gateway.
Oh, and the actionPerformed event does honor the enabled status.

+1 to Phil for the Princess Bride reference. :thumb_left:

:smiley: I’m a fan.
And I saw a reference to it this morning on one of my favorite non-technical sites.