this idea sounds really simple but after spending some time thinking about it, it is not that simple.
the idea is to save somewhere the last sequence of buttons that were pushed that are connected to a plc since sometimes if you push some set of buttons just the right way the machine will do something you do not want it to do, a ladder example would be nice of such.