Using 24 V PNP switch on NPN input
Your question is quite garbled but if I understand correctly what you are asking is:


  How can I adapt a 24 V, PNP proximity switch for an NPN machine input.








simulate this circuit &ndash; Schematic created using CircuitLab

Figure 1. Adding R1 and a small signal NPN transistor should do the trick.

If your machine input requires a "pull-to-ground" to activate it then the NPN transistor configuration of Figure 1 will do the trick.