2. Discrete vs Analog Sensors Explained for PLC Technicians (2 of 15)

Introduction
In industrial automation, sensors provide the feedback that allows a PLC to understand what is happening in the real machine. However, not all sensors send the same type of signal.
Some sensors send a simple ON/OFF signal.
Other sensors send a variable signal that represents a changing value.
This is the basic difference between discrete sensors and analog sensors.
According to the Rockwell Automation sensor reference manual, discrete sensing answers the question “Is the target there?” and produces an ON/OFF digital signal. Analog sensing answers questions like “Where is it?” or “How much is there?” by providing a continuous output response proportional to the target condition.
For a PLC technician, this difference is very important because it affects:
PLC input module selection
Wiring
Troubleshooting method
Ladder logic design
HMI display
Alarms and faults
Scaling
Calibration
What Is a Discrete Sensor?
A discrete sensor provides a digital signal to the PLC.
That signal has only two basic states:
ON or OFF
TRUE or FALSE
1 or 0
Energized or de-energized
A discrete sensor answers a simple question:
Is the condition present?
Examples:
Is the box present?
Is the door closed?
Is the cylinder extended?
Is the label detected?
Is the guard door closed?
Is the motor feedback present?
In PLC logic, discrete sensors are usually represented as BOOL tags.
Example tags:
DI_Box_Present
DI_Door_Closed_LS
DI_Cylinder_Extended_Prox
DI_Label_Detected
DI_Motor_Run_FB
DI_Guard_Door_Closed
The prefix DI_ means Digital Input.
Discrete Sensor Example: Box Present
Imagine a conveyor moving boxes into a filling station.
A photoelectric sensor detects when a box is in position.
Basic flow:
Box arrives
↓
Photoelectric sensor detects box
↓
PLC input turns ON
↓
PLC logic allows the fill cycle
PLC tag:
DI_Box_Present_PE
When the box is present:
DI_Box_Present_PE = 1
When the box is not present:
DI_Box_Present_PE = 0
This is discrete feedback because the PLC only needs to know:
Box present or box not present
Discrete Sensor Example: Door Limit Switch
A limit switch can be used to confirm that a door is fully closed.
PLC tag:
DI_Door_Closed_LS
When the door reaches the closed position, the limit switch changes state and the PLC input turns ON.
The PLC can use this signal as a permissive:
Machine can run only if DI_Door_Closed_LS is ON.
Basic ladder logic concept:
Start_Request
AND DI_Door_Closed_LS
AND No_Faults
= Machine_Run_Command
In this example, the limit switch is not measuring how far the door is open. It only confirms whether the door is closed or not closed.
That is a discrete condition.
Common Discrete Sensors
Common discrete sensors include:
| Sensor Type | Common Use | Example PLC Tag |
|---|---|---|
| Photoelectric sensor | Product presence | DI_Box_Present_PE |
| Inductive proximity sensor | Metal part detection | DI_Cylinder_Extended_Prox |
| Limit switch | Mechanical position | DI_Door_Open_LS |
| Pressure switch | Pressure reached | DI_Air_Pressure_OK |
| Float switch | High/low level | DI_Tank_High_Level |
| Motor feedback contact | Motor running proof | DI_Motor_Run_FB |
| Safety switch | Guard closed | DI_Guard_Door_Closed |
What Is an Analog Sensor?
An analog sensor provides a variable signal to the PLC.
Instead of only ON or OFF, the signal changes over a range.
An analog sensor answers questions like:
How much?
How far?
What level?
What pressure?
What temperature?
What position?
How fast?
Common analog signals include:
4–20 mA
0–10 VDC
1–5 VDC
0–5 VDC
In PLC systems, analog sensors usually connect to an analog input module.
The PLC receives a raw numeric value and then scales that value into engineering units.
Example:
Raw Analog Input → Scaled Engineering Value
Or:
Raw Value → Tank Level %
Analog Sensor Example: Tank Level
Imagine a tank with an ultrasonic level sensor.
The sensor measures the distance to the liquid surface and sends a 4–20 mA signal to the PLC.
Example:
4 mA = 0% tank level
20 mA = 100% tank level
PLC tags:
AI_Tank_Level_Raw
AI_Tank_Level_Pct
The raw input may be a number from the analog module. The PLC logic then scales it into a useful value.
Example:
AI_Tank_Level_Pct = 73.5%
This is analog feedback because the PLC is not just seeing high or low. It is seeing a changing process value.
Analog Sensor Example: Pressure Transmitter
A pressure transmitter may send a 4–20 mA signal that represents pressure.
Example:
4 mA = 0 PSI
20 mA = 100 PSI
PLC tags:
AI_Line_Pressure_Raw
AI_Line_Pressure_PSI
The PLC may use this value for:
Low pressure alarm
High pressure alarm
Pump control
Process monitoring
Trend display on HMI
Fault detection
Unlike a pressure switch, a pressure transmitter gives the actual pressure value.
Discrete vs Analog: Simple Comparison
| Feature | Discrete Sensor | Analog Sensor |
|---|---|---|
| Signal type | ON/OFF | Variable |
| PLC data type | BOOL | INT, DINT, REAL |
| Common input module | Digital input module | Analog input module |
| Main question | Is it there? | How much is there? |
| Example | Box present | Tank level percentage |
| Ladder use | XIC/XIO logic | Compare, scale, alarm limits |
| HMI display | Status indicator | Numeric value or trend |
| Troubleshooting | Check ON/OFF state | Check signal value and scaling |
PLC Logic Difference
Discrete Logic
Discrete signals are usually used with basic ladder instructions such as:
XIC
XIO
OTE
OTL
OTU
TON
CTU
Example:
DI_Box_Present
AND Fill_Station_Ready
AND No_Faults
= Start_Fill_Cycle
This logic is based on TRUE/FALSE conditions.
Another example:
DI_Door_Closed_LS
AND Start_PB
AND Safety_OK
= Motor_Run_Command
The PLC is checking whether each condition is true before allowing the output.
Analog Logic
Analog signals usually require numeric instructions such as:
SCP or scaling logic
CPT
MOV
LES
GRT
GEQ
LEQ
LIM
Alarm comparisons
PID control
Example:
If AI_Tank_Level_Pct >= 90%
Then High_Level_Alarm = ON
Another example:
If AI_Line_Pressure_PSI < 40 PSI
Then Low_Pressure_Alarm = ON
Analog values are often used for:
Scaling
Comparisons
Alarms
Trends
Process control
PID loops
HMI numeric display
Discrete Sensor in Ladder Logic
Example: Box present permissive.
Rung Purpose:
Allow the fill cycle only when a box is present, the station is ready, and no faults are active.
Logic:
DI_Box_Present_PE
AND Fill_Station_Ready
AND No_Faults
= Fill_Cycle_Enable
Suggested tag names:
DI_Box_Present_PE
Fill_Station_Ready
No_Faults
Fill_Cycle_Enable
This is a typical use of a discrete input.
The sensor does not tell the PLC how large the box is or how far away it is. It only confirms:
Box detected = Yes
Analog Sensor in Ladder Logic
Example: Tank level monitoring.
Rung Purpose:
Generate a high-level alarm when the tank level is above the alarm setpoint.
Logic:
AI_Tank_Level_Pct >= Tank_High_Level_SP
= Tank_High_Level_Alarm
Suggested tag names:
AI_Tank_Level_Raw
AI_Tank_Level_Pct
Tank_High_Level_SP
Tank_High_Level_Alarm
This is a typical use of an analog input.
The sensor provides a continuous level value. The PLC compares that value to a setpoint.
Discrete vs Analog in Troubleshooting
Troubleshooting a discrete sensor and troubleshooting an analog sensor require different thinking.
Troubleshooting a Discrete Sensor
For a discrete sensor, check whether the input changes state.
Basic checklist:
1. Is the sensor powered?
2. Is the sensor LED changing?
3. Is the target present?
4. Is the PLC input LED changing?
5. Is the input tag changing online?
6. Is the logic using XIC or XIO correctly?
7. Is the sensor wired PNP/NPN correctly?
8. Is the input common correct?
Common problem:
Sensor LED turns ON, but PLC input does not turn ON.
Possible causes:
Wrong common
Broken wire
PNP/NPN mismatch
Bad input module
Incorrect terminal
Loose M12 connector
Wrong tag mapping
Troubleshooting an Analog Sensor
For an analog sensor, the question is not only whether the signal is present. The question is whether the value makes sense.
Basic checklist:
1. Is the transmitter powered?
2. Is the signal 4–20 mA or 0–10 VDC?
3. Is the analog card configured correctly?
4. Is the raw value changing?
5. Is the scaling correct?
6. Does the HMI value match the real process?
7. Is the signal noisy or unstable?
8. Is the transmitter calibrated?
9. Is the wiring shielded and grounded correctly?
Common problem:
The tank is half full, but the HMI shows 0%.
Possible causes:
Bad scaling
Open 4–20 mA loop
Wrong analog channel
Wrong input type selected
Transmitter not powered
Broken cable
Incorrect engineering units
Calibration issue
Important Concept: Discrete Does Not Mean Simple
Discrete sensors are ON/OFF, but that does not mean the application is always simple.
A discrete input can still be used in very important logic:
Safety permissives
Door closed confirmation
Motor feedback fault
Product reject logic
Jam detection
Step complete confirmation
Machine state transitions
Example:
Motor_Run_Command = ON
AND DI_Motor_Run_FB = OFF
AND Timer Done
= Motor_Failed_To_Start_Fault
That is discrete feedback, but it creates professional fault detection.
Important Concept: Analog Does Not Mean Better
Analog sensors provide more information, but they are not always the best choice.
Use analog when the PLC needs a value.
Use discrete when the PLC only needs a yes/no condition.
Example:
Need to know if tank is high?
Use a discrete high-level switch.
Need to know actual tank percentage?
Use an analog level transmitter.
Both can be correct depending on the application.
Practical Industrial Examples
Example 1: Conveyor Box Detection
Sensor type:
Discrete photoelectric sensor
PLC question:
Is the box present?
PLC tag:
DI_Box_Present_PE
PLC use:
Start fill cycle
Stop conveyor
Count product
Verify box position
Example 2: Tank Level Monitoring
Sensor type:
Analog level transmitter
PLC question:
How much product is in the tank?
PLC tag:
AI_Tank_Level_Pct
PLC use:
Display level on HMI
Start/stop pump
Generate high-level alarm
Generate low-level alarm
Trend level over time
Example 3: Door Position
Sensor type:
Discrete limit switch
PLC question:
Is the door fully open?
Is the door fully closed?
PLC tags:
DI_Door_Open_LS
DI_Door_Closed_LS
PLC use:
Stop open motion
Stop close motion
Start auto-close timer
Confirm machine state
Trigger timeout fault if position is not reached
Example 4: Line Pressure
Sensor type:
Analog pressure transmitter
PLC question:
What is the current line pressure?
PLC tags:
AI_Line_Pressure_PSI
PLC use:
Low-pressure alarm
High-pressure alarm
Pump permissive
PID control
HMI trend
Recommended PLC Tag Naming
Discrete Inputs
Use DI_ for digital inputs.
Examples:
DI_Box_Present_PE
DI_Door_Open_LS
DI_Door_Closed_LS
DI_Cylinder_Extended_Prox
DI_Cylinder_Retracted_Prox
DI_Motor_Run_FB
DI_Guard_Door_Closed
DI_Air_Pressure_OK
Analog Inputs
Use AI_ for analog inputs.
Examples:
AI_Tank_Level_Raw
AI_Tank_Level_Pct
AI_Line_Pressure_Raw
AI_Line_Pressure_PSI
AI_Temperature_Raw
AI_Temperature_DegF
AI_Distance_Raw
AI_Distance_Inches
Setpoints and Alarms
Examples:
Tank_High_Level_SP
Tank_Low_Level_SP
Tank_High_Level_Alarm
Tank_Low_Level_Alarm
Pressure_Low_SP
Pressure_Low_Alarm
Clear naming makes the PLC program easier to troubleshoot and easier to explain on an HMI.
Technician Mindset
When you see a sensor in the field, ask:
Is this sensor discrete or analog?
What condition does it prove?
Is the PLC expecting ON/OFF feedback or a variable value?
Is this signal used as a permissive, interlock, alarm, or fault?
Is the problem in the sensor, wiring, input module, scaling, or logic?
This is the mindset that helps you troubleshoot faster.
For discrete sensors, think:
Did the input turn ON or OFF when expected?
For analog sensors, think:
Does the value match the real process?
Final Thoughts
Discrete and analog sensors are both essential in industrial automation.
A discrete sensor tells the PLC whether a condition is present or not present. It is commonly used for product detection, limit switches, position feedback, permissives, interlocks, and fault logic.
An analog sensor tells the PLC how much, how far, how full, how hot, or how much pressure exists in the process. It is commonly used for level, pressure, temperature, flow, distance, and process control.
The most important point is this:
Discrete sensors confirm a state.
Analog sensors measure a value.
Both types provide feedback. Both can be used to make PLC logic safer, smarter, and easier to troubleshoot.
For a PLC technician, understanding the difference between discrete and analog sensors is a major step toward understanding real industrial control systems.