That's one of the nice things about PLC's. They usually instigate some machine motion and then look for some result of that motion before, say, instigating a second motion. The nice part about it is that the controller that instigates the motion has all the required information to decide if everything is all right, or if something has gone wrong. Now, these days, with text displays, touchscreens, etc, that connect to these controllers, it's easy, albeit time consuming, to program all kinds of error and/or fault conditions. Then, through the display, tell somebody what's wrong--in plain english.
I, having come to be a programmer through the ranks of the troubleshooting electricians, write this kind of code into every system I do. All you have to do is ask yourself "what could go wrong, here?". Then write some code to catch it going wrong. It really gives the guys on the floor a head start when something bad happens. Instead of the operator saying "It didn't splice", the touchscreen says "the knife was told to fire, but did not move from home." It tells the electrician where to start--what to look for. If I have room, I include ladder rung #'s and hardwired drawing references, too.
Like I say, it takes extra time. But you only have to code it once, and it works forever.
There's all kinds of checks to put in--just use your imagination. If the up and down limits are both made at the same time, logic says that if you most recently told the thing to go up, it's most likely the down switch that is stuck--so tell somebody it's stuck.
The one I like best is the flow proof switch on blowers. Engineers always make sure the switch is made when the fan runs, but very seldom do they check to see if the switch opens when the fan is switched off. A stuck on flow switch could be very disastrous. it's easy to check it both ways. I do it all the time. If it's stuck closed--don't allow operation until it's fixed--through the code--and tell somebody what's wrong. This code prevents the lazy electrician from jumping it out, too.
Anyhow, I didn't mean to ramble--use your imagination and have fun.