The sensor that was fine
Where you'll meet it. You replace a proximity sensor on a hatch cover. The new sensor's own LED comes on when the target passes, so the sensor works. The PLC input LED never lights, so the PLC says the hatch never closes. The old sensor was NPN, sinking current out of the input; the new one is PNP, sourcing current into it, and the card is wired for the first kind. The sensor is fine, the card is fine, and the two cannot talk. Ten minutes with the card's manual and the sensor's data sheet, and you order the right one or move the common.
The idea. AND is contacts in series; OR is contacts in parallel; NOT is a normally closed contact. That is all logic ever is, and a relay panel, a ladder rung and a PLC program are the same three ideas in different clothes. The one thing the PLC adds that bites is sinking versus sourcing: whether an input expects the sensor to push current into it or pull current out of it. The card's manual says which; the sensor's wiring diagram says which; they must agree.