Connecting proximity switches to PLC inputs looks trivial until the four variables - sink or source, two-wire or three-wire, leakage current and residual voltage - combine into a fault. A short checklist per combination prevents most of it.
Step one is always the common logic: NPN switches need sinking wiring with S/S or COM on +24V, current leaving the input terminal through the switch to 0V; PNP switches need sourcing wiring with S/S on 0V, current entering the input. Get this backwards and the whole bank of inputs stays dead or inverts. Three-wire units go wire by wire; two-wire units sit in series with the input loop - one lead to supply, one to the input, the other supply rail into the common per the chosen logic. Trigger each point by hand and watch the input LED before touching the program.
Two-wire units carry two numeric constraints: standby leakage must stay below the input off-threshold, typically around 1.5mA, or the input ghosts on; and the ON-state loop current must reach the input on-threshold, typically 3~5mA, or actuation stays unreliable. Residual voltage of 3V or less eats into the supply budget. Route shielded twisted pair with the shield earthed at the cabinet end only, keep 200mm from power runs, cross at right angles, and megger the cables yearly - below 1 megohm, schedule replacement.
| Switch type | PLC wiring | Key check |
|---|---|---|
| Three-wire NPN | Sinking, S/S on +24V | Input pulled toward 0V when active |
| Three-wire PNP | Sourcing, S/S on 0V | Input pushed toward +24V when active |
| Two-wire | In series with input loop | Leakage under 1.5mA, ON current at threshold |
| Four-wire with diagnostic | Signal and diagnostic separated | Diagnostic to its own input for warning |
| High-speed pulse output | High-speed counter terminal | Filter set under 1ms |
| Cable over 20m | Shielded pair plus repeater | Check end-of-line drop |
Three disciplines keep this interface healthy: fix the common logic before wiring, measure three numbers after wiring - idle current, acting current, input LED response - and record the single-point shield earth on the drawing. Follow them and sensor-to-PLC faults drop to nearly zero.
The quantities and component characteristics discussed here follow current national standards and the corresponding IEC documents: Control circuits and interfaces per GB/T 5226.1 (IEC 60204-1); switch characteristics per GB/T 14048.10. Always check the device datasheet and the product design file for ratings and derating.
Locate the issue with the approach above, then confirm with measurements; safety-related circuits must follow the standards and manufacturer requirements.