Not everything is ON or OFF. Tank level, pressure, flow, temperature and speed vary continuously. PLCs read and write these with analog signals.
Common analog signals
| Signal | Range | Strengths | Watch out for |
|---|---|---|---|
| Current | 4–20 mA | Immune to cable resistance, long runs, detects broken wires | Needs a loop supply |
| Voltage | 0–10 V | Simple, common on drives | Voltage drop and noise on long cables |
| Temperature | RTD (Pt100), thermocouple | Direct sensor connection | Needs a matching input module |
Why 4 and not 0?
The “live zero” at 4 mA is clever. A transmitter at the bottom of its range still sends 4 mA, so 0 mA means a fault: a broken wire, a dead supply or a failed transmitter. With 0–20 mA or 0–10 V, a broken wire looks exactly like “empty tank”, which is dangerous. The 4 mA also gives a two-wire transmitter enough current to power its own electronics from the loop.
Because it is a current, the signal is the same at the PLC as at the transmitter, even through hundreds of metres of cable. That is why 4–20 mA has been the process industry’s standard for decades.
Wiring a two-wire transmitter
Most pressure and level transmitters are two-wire, loop-powered: the same two wires carry the power and the signal. Current flows from +24 V, through the transmitter, into the PLC’s analog input and back to 0 V. The transmitter regulates that current between 4 and 20 mA according to what it measures. Check whether your analog card supplies loop power itself or expects an external 24 V supply.
Raw counts and resolution
The analog input module converts the signal into a number, called raw counts. The range depends on the PLC:
- Siemens S7-1200/1500: 0 to 27,648 for the nominal range.
- Many others: 0 to 4,000, 0 to 32,000 or 0 to 65,535, depending on the module and settings.
A 12-bit module divides the range into 4,096 steps. On a 0–10 bar transmitter that is about 0.0025 bar per step: plenty for most jobs.
Scaling to engineering units
Nobody wants to read “13824” on a screen. Scaling converts raw counts into real units with a straight line:
value = LOW + (raw − RAW_MIN) × (HIGH − LOW) / (RAW_MAX − RAW_MIN) Example: 0–10 bar transmitter, Siemens raw 0–27648, raw = 13824 value = 0 + (13824 − 0) × (10 − 0) / (27648 − 0) = 5.0 bar
Most PLCs have a ready-made scaling instruction (SCALE, SCP, NORM_X with SCALE_X, or a function block in the library). Do the maths in REAL (floating point) to keep the decimals. Check your numbers with the calculator:
4–20 mA scaling
Signal to engineering units and back
Formula and notes
EU = LO + (mA − 4) / 16 × (HI − LO) mA = 4 + 16 × (EU − LO) / (HI − LO)
Example: a 0–10 bar transmitter reading 12 mA is at 5 bar. Below 3.8 mA usually means a broken wire (NAMUR NE43).
Alarms and sanity checks
- Wire break / under-range: below about 3.8 mA (NAMUR NE 43 recommends treating ≤ 3.6 mA as a failure). Raise a fault and put the process in a safe state.
- Over-range: above about 20.5 mA means the measurement is beyond the transmitter’s span, or the transmitter has failed high.
- Process alarms: high, high-high, low and low-low levels with a small hysteresis or delay so they do not chatter.
- Filtering: a short average or the module’s built-in filter smooths a noisy signal, at the cost of slower response.
Analog outputs
Analog outputs work in reverse: the program writes a raw value and the module produces 4–20 mA or 0–10 V. A typical use is the speed reference to a variable frequency drive (VFD): 0 V = 0 Hz, 10 V = 50 Hz.
Frequently asked questions
Why is 4–20 mA preferred over 0–10 V?
Current signals are not affected by cable resistance, are less sensitive to noise, and the 4 mA live zero lets the PLC detect a broken wire.
What raw value does Siemens give for 20 mA?
On S7-1200 and S7-1500 analog inputs, the nominal range maps to 0–27648, so 20 mA reads 27648 and 4 mA reads 0 for a 4–20 mA input.
