One state for sequence logic, counting, confirmation, permissives or simple alarms.
Discrete vs Continuous Sensors in Automation: Choose the Information First
A discrete sensor tells the controller whether a condition is true. A continuous sensor tells it how much of a variable is present. The right choice depends on the machine decision, not on whether the signal happens to be called digital or analog.
Use a switching sensor for dependable sequence states such as part present or cylinder extended. Use a measuring sensor when the PLC needs distance, pressure, temperature, level, flow or position for control, trends or adjustable limits. Use a hybrid sensor only when both outputs serve a defined purpose.
Photo: Bulat843 / Pexels.
A measured magnitude for feedback, adjustment, trending, quality or diagnostics.
A switching point plus measurement can help, but shared sensing elements remain a common dependency.
Start with the PLC decision.
Do not begin with a connector, output acronym or sensor family. Write what the controller and operator must know. That one sentence usually makes the first choice clear and prevents paying for unused data or losing information the process actually needs.
One stable condition is enough
Examples: part present, clamp closed, end position reached, pressure above a permissive or tank at a fixed high level.
Confirm switching margin, logic, timing and PLC electrical compatibility.The magnitude changes the action
Examples: closed-loop pressure, distance feedback, inventory level, process temperature, flow trend or multi-position control.
Confirm measuring range, total error, update time, scaling and fault values.Logic and visibility are both useful
Examples: a fast pressure switch for a permissive plus a measured pressure value for HMI, trend and maintenance review.
Confirm simultaneous outputs, pin mode, common failures and parameter ownership.Discrete answers whether; continuous answers how much.
A discrete sensor exposes a limited state such as ON/OFF, present/absent or open/closed. A continuous sensor exposes a numerical value across a range. Either result may travel through a digital interface, so “digital” does not automatically mean “discrete.”
A standard inductive proximity switch may internally respond to a continuously changing electromagnetic condition but expose only one evaluated state. An IO-Link distance sensor can send a numerical distance in a digital process-data frame. A pressure sensor may provide a PNP switching output, a 4–20 mA measurement and device diagnostics from one sensing element.
The controller choice is therefore not simply binary versus analog electronics. It is a chain: physical variable, sensing principle, information required, output or protocol, receiving input, PLC processing, failure handling and final machine action. If any link is undefined, a technically good sensor can still become the wrong automation point.
Technical basis: Balluff switching versus measuring sensors.
Side-by-side comparison
| Decision factor | Discrete sensor | Continuous sensor |
|---|---|---|
| Controller question | Is the condition true? Usually one Boolean state or a small set of defined states. | What is the measured value? A number plus units, status and sometimes diagnostics. |
| Typical examples | Inductive proximity switch, photoelectric presence sensor, limit switch, pressure switch, float switch. | Distance sensor, pressure transmitter, temperature transmitter, level sensor, flowmeter, linear-position sensor. |
| Common interface | 24 VDC PNP, NPN, push-pull, relay, two-wire switching, pulse or qualified safety output. | 4–20 mA, 0–10 V, RTD, thermocouple, IO-Link process value, fieldbus or industrial Ethernet data. |
| PLC work | Read a digital input or bit; debounce, interlock, count, time or sequence it. | Validate and scale a number; filter if justified, compare, trend, alarm or use it in control. |
| Main strength | Simple, direct and easy to troubleshoot when one threshold is enough. | Shows magnitude, margin and trend; supports adjustable thresholds, feedback and richer diagnostics. |
| Main limitation | No visibility between states; the PLC cannot see approach to the threshold. | More integration work, performance terms, fault modes and verification are required. |
| Commissioning proof | Prove both transitions, hysteresis, normal/fault logic and timing at real speed. | Prove low, middle and high values, units, direction, tolerance, faults and total response. |
Do not mix the process question, data and interface.
Most wrong selections begin when one word is used for several different layers. Keep these three decisions separate in the specification.
Physical variable
Presence, distance, pressure, temperature, level, flow, position, speed or another real process condition.
Question: what is happening at the machine?Information required
A state, a numerical value, a pulse count or frequency, direction, quality status, diagnostics or a justified combination.
Question: what must the PLC know?Transport and input
PNP/NPN switching, relay, 4–20 mA, voltage, RTD, pulse, IO-Link or network data matched to the receiving hardware.
Question: how will valid data reach the controller?
Turn a physical condition into a stable state.
A discrete sensor evaluates the sensed condition against a switching rule and exposes a limited state the PLC can use. Its electronics may be sophisticated, but the control result remains simple.
Detect light, metal, pressure, position, level or another physical condition.
Use a fixed point, taught point, window, contrast level or other defined rule.
PNP, NPN, push-pull, relay or another switching stage must match the PLC input.
Test real targets, both travel directions, input filtering, sequence meaning and fault behavior.
Switching point and reset point are not normally identical.
Hysteresis is the difference between the point where an output changes in one direction and the point where it resets in the other direction. It helps prevent chatter when a target vibrates or moves slowly near the threshold.
Too little hysteresis can create repeated ON/OFF transitions. Too much can make the reset point farther from the required machine position. Commission both directions and record the actual process meaning of each state.
Approach: OFF → switch point → ONReturn: ON → reset point → OFF. The gap between the two points is the hysteresis band.PNP, NPN and NO/NC answer different questions.
PNP and NPN describe current direction in common three-wire DC sensor circuits. NO and NC describe selected output behavior relative to the sensing condition. A PNP sensor can be NO or NC; an NPN sensor can also be NO or NC.
- PNP: normally sources current toward a compatible sinking PLC input.
- NPN: normally sinks current from a compatible sourcing PLC input.
- Two-wire electronic: check OFF leakage and ON voltage drop.
- Pulse or encoder: check frequency, pulse width and high-speed input capability.
Continue with the verified PLC sensor input guide or NPN vs PNP wiring guide.
Convert the process into a value the PLC can interpret.
A measuring sensor reports a variable across a defined range. Its internal chain can include the sensing element, excitation, signal conditioning, compensation, linearization, filtering, analog-to-digital conversion and output formatting.
The result has finite range, resolution, accuracy, repeatability and update time. A display with many digits does not prove that every digit is accurate. A high-resolution PLC input cannot recover information that the sensor did not measure accurately.
- Map the approved physical range to the configured electrical or digital range.
- Preserve units, direction, status and invalid-data information.
- Check sensor error, input-module error, temperature effects, noise and mechanics together.
- Verify low, middle and high values plus overrange, underrange and lost-signal behavior.
Match the sensor information to the correct receiving hardware.
A valid sensor output is useful only when the input module, common, range, timing and data format can receive it correctly.
PNP / NPN
Boolean machine states through a compatible 24 VDC digital input.
Check common, thresholds, load, leakage and filter.4–20 mA
Measured values for pressure, level, flow, temperature, position and other processes.
Check loop power, resistance, isolation and fault current.0–10 V
Measured values in many shorter machine-level cable runs and compatible controllers.
Check reference, impedance, grounding, noise and load.Pulse or encoder
Digital transitions that represent quantity, position, direction or speed.
Check pulse width, maximum frequency and counter input.IO-Link
Switch states, measured values, parameters, identification, events and diagnostics.
Check IODD, profile, process-data map, cycle and validity.A hybrid sensor is useful only when both data paths have a defined job.
Many pressure, flow, level, temperature and distance devices can provide switching outputs plus an analog value or digital process data. This can support fast machine logic and richer HMI or maintenance information without adding another process connection.
However, do not assume the outputs are independent. They may share the same sensing element, power, processor, cable and connector. One failure can therefore affect the switching state and measurement together. If independent protection is required, use the risk assessment and applicable safety or availability architecture rather than treating two outputs from one ordinary sensor as two independent channels.
| Hybrid architecture | Useful benefit | What must be confirmed |
|---|---|---|
| Switch + analog | Direct Boolean logic plus a value for display, trend or adjustment. | Two input channels, pin assignment, signal common, simultaneous operation, aligned range and shared-failure behavior. |
| Switch + IO-Link | Simple switching mode plus remote parameters, measurement, identification and diagnostics. | Master port mode, IODD, process-data layout, cycle time, parameter source, fallback and replacement restore. |
| Several software thresholds | One measured value can create high, low and window states for several recipes. | Hysteresis, invalid/stale data, update delay, common-cause failure and whether an independent limit is still required. |
| Measurement + pulse | Quantity or rate can be transmitted as pulses for counting or totalizing. | Pulse constant, maximum frequency, minimum width, counter interface, timeout, rollover and missed-event behavior. |
Scale the configured signal, not the sensor family brochure.
An analog module converts current or voltage into a raw number. The PLC maps that number into engineering units. Use the exact input range, raw representation and sensor endpoints from the approved configuration.
EU = EU_low + (Raw - Raw_low) × (EU_high - EU_low) / (Raw_high - Raw_low)EU means engineering units. The exact raw endpoints, overrange values and data format depend on the selected I/O module and configuration.Do not clamp every abnormal value into the normal range. Preserve enough information to distinguish a real low process value from open circuit, underrange, invalid data or communication loss.
Reference: Siemens S7-1200 System Manual V4.7, processing of analog values.
What does 12 mA mean in a 0–10 bar loop?
This example illustrates a linear 4–20 mA mapping. It is not a substitute for the exact transmitter and input-module documentation.
The sensor maps 0 bar to 4 mA and 10 bar to 20 mA.
The reading is 8 mA above the live-zero endpoint.
The signal is halfway through the 16 mA measurement span.
Half of the configured 10 bar span is 5 bar.
Compare the specifications that control the real machine result.
After choosing state or measurement, build a complete performance budget. Sensing range and price alone do not tell you whether the point will be stable, fast or accurate enough.
| Specification | What it means | How it changes selection |
|---|---|---|
| Sensing or measuring range | The region where the sensor is intended to detect or measure under stated conditions. | Confirm target, geometry, dead zone, blind zone, usable linear zone and real installation margin. |
| Switching repeatability | How consistently the switching point is reproduced under defined conditions. | Often more important than absolute sensing distance for repeatable part positioning. |
| Accuracy | Closeness to a suitable reference under stated conditions, usually with several error components. | Read the complete statement, including range, temperature and target conditions; do not replace it with resolution. |
| Resolution | The smallest output step or change the system can distinguish or report. | Fine steps help only when sensor noise, accuracy, mechanics and input conversion support them. |
| Linearity | Deviation of the transfer function from the defined straight-line relationship. | Changes the error across the range and matters when simple linear scaling is used. |
| Hysteresis | Difference between transition points for opposite travel directions or states. | Prevents chatter but creates a reset band; verify both approach directions. |
| Response or update time | How quickly a sensor or channel reacts or publishes changed information. | Add sensor, filter, input conversion, network, PLC task and logic delays; one number is not total machine latency. |
| Temperature drift | Change in output or threshold as ambient or process temperature changes. | Important near ovens, outdoors, in cold storage, washdown areas and precision applications. |
| Output and diagnostics | Electrical load limits plus behavior for overload, short circuit, open circuit, out-of-range or invalid data. | Must match the receiving I/O and programmed failure response, not just the normal signal. |
A fast sensor does not guarantee a fast machine response.
Every stage can add delay. Filtering may improve stability, but it can also reject a valid short pulse or slow a measured step. Define the maximum allowed end-to-end response before selecting parts.
Target enters the field, pressure changes or position moves.
Sensing element and internal processing react to the change.
Switching edge, analog update or digital process data is published.
PLC or remote I/O detects, converts and filters the signal.
Data reaches the PLC task and the program evaluates it.
Output, valve, reject, drive, alarm or HMI changes state.
For high-speed applications, continue with response time versus switching frequency and why high-speed machines miss signals.
Use the simplest signal that still supports the required decision.
These examples show how the same process can justify discrete, continuous or hybrid sensing depending on what the machine must do.
One transfer signal usually favors discrete.
If the PLC only needs a dependable carton-present transition before a timing window closes, a switching photoelectric sensor is usually the simpler choice. Check target surface, background, spot size, minimum object, speed, mounting and input filter.
Choose continuous only when height, distance, profile or margin is required.Fixed alarms may use switches; inventory needs a value.
Low-level pump protection and high-level alarm may be served by two qualified switches. Inventory, several recipes, variable-speed control, fill-rate trend or leak detection usually needs continuous measurement.
An independent high-high function may still be required by the risk assessment.End positions favor discrete; full stroke favors measurement.
Two magnetic switches can prove fully retracted and fully extended. A continuous position sensor becomes useful for multiple tooling positions, motion monitoring, setup confirmation or wear trends.
Measurement adds alignment, numerical tolerances and update-time requirements.A hybrid sensor can serve logic and visibility.
A switching output can provide the machine permissive while 4–20 mA or IO-Link provides pressure for HMI, alarm history and leak analysis. Both paths must be checked against the same pressure reference.
Document set/reset points, units, fault states and common dependencies.Diagnose the signal at each stage instead of replacing the sensor first.
Compare the physical condition, sensor indicator or display, electrical output, PLC raw data, engineering tag and final logic. The first point of disagreement narrows the fault.
| Symptom | Likely causes | How to confirm | Corrective direction |
|---|---|---|---|
| Discrete input chatters | Low margin, vibration, interference, unstable power, sensitivity or insufficient hysteresis. | Watch the raw sensor output and target position through both transitions. | Improve mounting and margin, correct interference, teach properly, then add only justified filtering. |
| Fast parts are missed | Slow sensor or input, narrow pulse, long filter, network/task delay or ordinary DI used for high-speed work. | Measure pulse width and each delay stage against guaranteed limits. | Use faster sensing and a high-speed input, counter or capture architecture. |
| Analog value is noisy | Mechanical instability, grounding, interference, wrong range, poor shielding or unsuitable output. | Compare local display, signal at the input, raw counts and process stability. | Correct the physical or electrical cause before adding documented filtering. |
| Analog value is offset | Wrong scaling, common-reference error, voltage drop, calibration, incorrect range or drift. | Test low, middle and high references through the whole loop. | Correct configuration and wiring; recalibrate or replace only after isolating the error. |
| Value freezes but looks valid | Stale network data, held-last-value behavior or a hidden communication/device fault. | Monitor quality, update timestamp, timeout, sequence counter and device events. | Program stale-data detection and a defined fallback; do not trust the number alone. |
| Switch works, value is wrong | Hybrid outputs mapped to different ranges or variables, wrong pin mode or units. | Read device parameters and test both outputs against one reference. | Align range, units and PLC mapping; document which path is authoritative. |
Move from the process question to a released configuration.
This sequence keeps sensing, wiring, PLC processing and acceptance evidence connected throughout design and purchasing.
Define the decision
State, magnitude, count, frequency, direction or a justified combination. Explain how the PLC uses it.
Define the target
Record material, size, surface, range, speed, direction, process media and expected variation.
Choose information class
Select switching, measuring or hybrid. Treat encoder, pulse and safety functions as special architectures.
Choose the interface
Match output or protocol to supply, PLC input, cable, grounding, isolation, update and maintenance capability.
Build the budget
Check range, margin, repeatability, accuracy, resolution, hysteresis, drift, response, I/O and mechanics.
Define failures
Plan for stuck state, missing transition, short/open circuit, invalid value, stale data and communication loss.
Test extremes
Use real targets and speeds. Test both discrete transitions or low/mid/high values plus fault behavior.
Release the record
Store model, suffix, wiring, range, units, filters, IODD, scaling, setpoints, test evidence and exact spare.
Commission the complete loop, not only the sensor LED.
A correct local indication can still reach the wrong PLC channel, use the wrong polarity, be inverted in logic or be scaled to the wrong range. Preserve evidence from physical input to final machine action.
Verify model, suffix, firmware, output, protocol, connector, range, units, supply and I/O channel.
Check gap, approach, target size, alignment, bracket, torque, dead zone, process connection and environment.
Verify PNP/NPN common or analog range, loop budget, isolation, shield, IODD, mapping, quality and diagnostics.
Prove OFF-to-ON, ON-to-OFF, hysteresis, filter, pulse width, normal state, fault state and repeated operation.
Prove units, direction, tolerance, response, overrange, underrange, invalid/stale data and downstream logic.
Record wiring, setpoints, range, scaling, parameters, filters, acceptance result and replacement restore method.
Send the information needed to check the complete signal chain.
A useful recommendation requires more than a sensor category. Share the target, control decision, environment and installed I/O so the proposed model can be checked against the real machine.
Material, size, surface, distance or measuring span, speed, direction and operating extremes.
State, value, pulse, direction, switch points, trend, feedback or diagnostic purpose.
Supply, input-module model, common, current/voltage range, IO-Link master, cable and grounding.
Allowed error, repeatability, response, fault behavior, test points, documentation and OEM quantity.
Let xsz sensor review the task before you freeze the model.
Send the real process and controller details. We can help narrow the sensing principle, switching or measuring output, wiring, range, housing, cable and sample-test direction for an OEM or replacement project.
Use these published guides for the next decision.
Each resource addresses a specific part of the sensor-to-controller path discussed in this guide.
Match sourcing, sinking, common wiring, analog ranges and input behavior.
Discrete outputNPN vs PNP Sensor OutputsTrace the current path and pair the field device with the correct PLC input.
Continuous output0–10 V vs 4–20 mACompare voltage and current transmission around the real cable and input module.
TimingResponse Time vs Switching FrequencySeparate one-event delay from repeated-event capacity in a high-speed machine.
Specification reviewHow to Read a Sensor DatasheetCheck the exact output, distance, housing, protection and stated conditions.
Wiring architecture2-Wire vs 3-Wire SensorsUnderstand supply paths, leakage, voltage drop, output behavior and PLC fit.
Discrete and continuous sensor FAQ
Short answers to the questions that commonly appear during automation design, replacement and purchasing.
What is a discrete sensor in automation?
A discrete sensor reports one of a limited number of states, usually OFF or ON. Examples include a proximity switch reporting metal present, a limit switch reporting end position or a pressure switch reporting pressure above a setpoint. The physical condition may change continuously, but the controller receives the evaluated state.
What is a continuous sensor in automation?
A continuous or measuring sensor reports the magnitude of a physical variable across a defined range. Examples include pressure, distance, level, temperature, flow and linear position sensors. The value may be carried through 4–20 mA, voltage, IO-Link or another digital protocol.
Is a continuous sensor the same as an analog sensor?
No. Continuous describes the information: a measured value across a range. Analog describes an electrical interface such as current or voltage. A continuous measurement can also be transmitted digitally through IO-Link, fieldbus or industrial Ethernet.
Can one sensor provide both discrete and continuous outputs?
Yes. Many pressure, flow, level, temperature and distance sensors provide a switching output plus analog or digital process data. Confirm the exact model, pin mode, whether outputs work simultaneously, what each output represents and how shared failures are handled.
Is a proximity sensor discrete or continuous?
It can be either. A standard inductive or photoelectric proximity switch usually provides a discrete target-present output. Analog and smart proximity sensors can report distance, position, signal strength or another measured value. Check the exact output and process data rather than classifying by sensing principle alone.
Why use 4–20 mA instead of 0–10 V?
A 4–20 mA loop is often selected for longer runs or electrically noisy environments, while 0–10 V can be straightforward for shorter machine-level runs. The correct choice depends on input availability, grounding, isolation, loop-voltage budget, cable route, response and the exact sensor and module specifications.
Can a PLC create a discrete alarm from a continuous sensor?
Yes. The PLC can compare a validated measured value with one or more thresholds. Use separate trip and reset points or hysteresis, and define behavior for invalid, stale or out-of-range data. A software alarm does not automatically replace an independent or safety-rated protective function.
What is the difference between sensor accuracy and resolution?
Resolution is the smallest output step or change the system can distinguish. Accuracy describes closeness to a suitable reference under stated conditions and may include offset, span, linearity, temperature and other errors. Many display digits do not prove matching accuracy.
Does an encoder use a normal discrete PLC input?
Not always. An encoder produces digital transitions, but position, direction and speed depend on capturing pulse count, phase and frequency correctly. If the signal exceeds an ordinary input's guaranteed pulse width or frequency, use a suitable high-speed counter, encoder, capture or motion interface.
How should a continuous sensor be commissioned?
Verify the complete loop at low, middle and high reference values, plus direction, units, output range, PLC raw value, scaling, tolerance, response, overrange, underrange, invalid or stale data, HMI display, alarms and final control action. One-point testing cannot reveal an incorrect span or reversed mapping.
Primary technical references
- Balluff: Switching versus measuring sensors — practical distinction between presence states and continuous position or distance values.
- IEC 61131-9:2022 — single-drop digital communication interface commonly known as IO-Link.
- IO-Link Community: Technology overview — process data, parameters, diagnostics and point-to-point architecture.
- Siemens S7-1200 System Manual V4.7 — analog value normalization, scaling and range representation.
- ISO 13849-1:2023 — methodology for safety-related parts of control systems.