Noise on Proximity switch signal on PLC system
If the transistor is rated at 200mA try a lower value resistor first like 1k ohm. Then try adding a 100nF capacitor across it. Put these components close to the input for best effect. Come back and report what you find.

NB if a 1K resistor is used the power rating will probably have to be 1W. You could try a 2k2 - this will be OK at a 0.6W power rating.