Remember that a "momentary" button on a HMI is not the same as a "momentary" physical pushbutton wired to an input.
With a physical pushbutton, as long as you hold it down, power flows to your digital input, forcing your input to stay on. The moment you release the button, power flow to your input stops, and your input turns off.
With a HMI button, when you press it, the HMI sends a single message to the PLC saying "set bit [whatever] to 1". The PLC does so. When you release the button, the HMI sends another message to the PLC saying "set bit [whatever] to 0". The PLC does so. But in between those times,
the HMI is not actively holding the PLC tag in the "on" state. Nor is the HMI actively holding the PLC tag in the
off state when the button is
not being pressed.
Now, what happens if there's a momentary glitch in the communications just before you release the button? Or what if a packet is dropped somewhere and that single "set bit [whatever] back to 0" message doesn't get through? That single message is the only thing that "releases" the pushbutton tag, so if it gets lost, as far as the PLC is concerned, your button is still being pressed.
This doesn't happen hugely often, but it happens often enough that I will never ever use HMI buttons without buffering them through the PLC, like this:
Code:
|
| HMI_PB_Start HMI_Start
|--------| |-----------------+---------( )---|
| |
| | HMI_PB_Start
| +---------( U )---|
...so that as soon as I see the "Start" pushbutton pressed, I turn it off myself inside the PLC, and set a "HMI_Start" bit for one scan to be used everywhere else in the code.
I say "it doesn't happen hugely often", but by making the operator press and hold for two seconds, you're significantly increasing the likelihood that somewhere in that two second period you'll experience such an issue.
The method suggested by cwal is where I'd be looking. This function exists for exactly this reason. Your HMI sends no message at all to the PLC until the button has been held for two seconds,
then it sends the "set bit [whatever] to 1" message. When you release the button, it will send the "set bit [whatever] to 0" message.
However! That still doesn't completely alleviate the issue above! If you're using this button as a jog control of sorts, there's still the possibility of the button release message getting lost. Whenever I have to use a HMI button for a jog function, I always have logic such that if my motor becomes "not ready", I immediately turn off the jog pushbutton. That means I can hit an e/stop, turn off a motor isolator, trip a breaker, or whatever else I need to do to enforce a stop, and know that my HMi button has now been reset as well. Otherwise, as soon as I release the e/stop and reset the safety circuit, the motor may very well pick up and run again, seeing as (as far as it's concerned), someone is still holding their finger on the jog button.