An NPN sensor can be used with nothing more than a pull-down resistor on the output and a diode. The value of the resistor will need to be fairly low, around 200 to 470 ohms. It should pull down to 0 volts, NEVER -5. The diode prevents +12 from being passed to the logic inputs.
The reason people don't do this, is noise causing a false input is far more probable. And the reliability issues cause the NPN preference. Much better noise immunity.
The amount of energy required to fool a digital circuit from seeing a 1 when it should be 0 is different than that required to go the other way.
That is why the sensors are "1" when they are inactive, and "0" when they are active. It seems illogical, but it is more reliable.
But technically a PNP can work.
I suggest unless this all makes sense, just get an NPN sensor. They just hook up and work.
D
"The best thing about building something new is either you succeed or learn something. Its a win-win situation."
--Greg Westbrook