An NPN sensor sinks current by connecting the input line to ground when active. The PLC input needs a pull-up resistor to positive voltage to detect this change.
A PNP sensor sources current by connecting the input line to positive voltage when active. The PLC input needs a pull-down resistor to ground to detect this high signal.
Supply voltage = 24V Sensor active = input connected to ground Pull-up resistor present What is the voltage at the PLC input terminal?
When the NPN sensor is active, it connects the input line to ground, pulling the voltage down to near 0V, which the PLC reads as a low state.
Supply voltage = 24V Sensor inactive = input not connected to positive voltage Pull-down resistor present What is the voltage at the PLC input terminal?
When the PNP sensor is inactive, the input line is connected to ground through the pull-down resistor, so the voltage is near 0V, read as low by the PLC.
Using a pull-up resistor with a PNP sensor causes the input line to always be high, so the PLC never detects a change when the sensor activates.
