I've noticed many motion control cards have optically-isolated inputs for limit switches? I can understand why you may do this with a signal which travels between two systems with separate power supplies, but what is the purpose when a shared power source is used?
Assume a control card with a 12v output for a NC limit switch. A voltage divider (using two resistors) lowers the voltage to an appropriate level determined by the MCU. A pull down resistor is used to tie the input pin to ground when the switch is open. In such a scenario, why would optically-isolating the input be a good idea? I can only think that a spike in the 12v output would produce an unacceptably high output after the voltage divider.