I do something similar to Mickey. I have a few rules:
- ALWAYS use "set" or "latch" buttons on the HMI, not momentary. Because I've had it happen too many times where the button gets "stuck" on. Usually pressing it again will "unstick" it - think about Ron's example above, where it has two separate messages - obviously the "turn off" message didn't make it back to the PLC, and pressing the button again will give it another chance. But if the button has since disappeared from the screen, well, then what? Setting them to be latch/maintained buttons means that it's at least always going to behave consistently, and you can deal with it consistently.
- Only ever use the button in the PLC code ONCE. Even if you just use it to turn on one coil in the PLC which is then used in 1000 other places, it just makes it easier to see what's going on, and also makes my third "rule" work nicely:
- Unlatch the button from the HMI in the same rung it's used in. If I'm using the RSLogix 5000 platform (which the OP is not), I put the OTU directly after the XIC, even if it's right at the start of the rung. I know that some people don't like output instructions programmed like this (sorry!) but I figure they're placed in pairs, and those two are the only occurrences of the bits in the whole program, so it's easy to see what's going on. And this way I'm guaranteed that when the HMI turns "on" the button, the rung sees it, turns "off" the button, and then carries on doing whatever the button was supposed to do in that rung. I'm never left with a button stuck on. It's important to note that you have to put this logic at the start of the rung, so that other rung conditions don't preclude it from being executed.
If you're using the RSlogix 500 platform, you have to put your OTU on a separate rung (I make it unconditional) directly below the rung the XIC is used in. The reason for this is because in RSLogix500, all output instructions have to be at the end of the rung. And if you put your OTU at the end of the rung, other rung conditions may not permit your OTU to be activated. Let's say you have condition A, B and C in series, which activates an OTE for output D. Condition B is your HMI pushbutton, so as well as an OTE "D", we'll have an OTU"B" to turn off your HMI pushbutton. But if your condition C is FALSE and someone presses the button on the HMI, the output instructions will not get executed, so your button will remain "stuck on".
Hopefully there's something in my ranting there that will help the OP troubleshoot/solve his problem