Here’s a simple way remember how to wire up a 3-wire DC PNP or NPN sensor:
PNP = Switched Positive
NPN = Switched Negative
“Switched” refers to which side of the controlled load (relay, small indicator, PLC input) is being switched electrically. Either the load is connected to Negative and the Positive is switched (PNP), or the load is connected to Positive and the Negative is switched (NPN). These diagrams illustrate the differences between the two connections.
Click here for more information about the Basics of Automation.