How PLC analog input scaling works
An industrial PLC analog input card digitises a continuous loop current (such as 4–20 mA) or voltage (0–10 V) into a signed or unsigned integer count. The program then maps that integer range onto the transmitter’s engineering range (LRV to URV) using a two-step linear scaling equation:
PV = LRV + (Raw − Rawmin) / (Rawmax − Rawmin) × (URV − LRV)
Type a value into any of the three main fields—PLC raw count, analog signal or process value—and the other two update immediately. Select a PLC card preset to load the standard integer bounds automatically, or enter custom bounds for any module.
Standard PLC raw count ranges
Different PLC families map 4–20 mA and 0–10 V onto different raw integer counts:
| PLC platform / mode | 4–20 mA raw counts | 0–10 V / 0–20 mA counts | Notes |
|---|---|---|---|
| Siemens S7-1200 / S7-1500 / S7-300 | 0 … 27648 | 0 … 27648 | Rated overrange to 32511, underrange to −4864 |
| Siemens S7-200 / SMART | 6400 … 32000 | 0 … 32000 | Live zero at 4 mA sits at 20 % of 32000 |
| Allen-Bradley Engineering Units (1756/1769) | 4000 … 20000 | 0 … 10000 / 20000 | 1 count = 1 µA on 4–20 mA |
| Allen-Bradley Proportional / PID (1746-NI) | 3277 … 16384 | 0 … 16384 | 14-bit proportional scaling |
| Allen-Bradley / Beckhoff 16-bit Signed | 0 … 32767 | 0 … 32767 | 15-bit unipolar positive integer |
| 12-bit / 16-bit generic ADC | 0 … 4095 / 0 … 65535 | 0 … 4095 / 0 … 65535 | Raw unscaled converter counts |
Worked example: Siemens S7-1500 with 4–20 mA
Suppose a 0–10 bar pressure transmitter is wired to a Siemens S7-1500 4–20 mA input (0 … 27648):
- At 13824 counts, the signal is 12 mA (50 % of span) and the process value is 5 bar.
- Each count represents 16 / 27648 = 0.5787 µA and 10 / 27648 = 0.0003617 bar (14.75 effective bits).
- NAMUR NE 43 downscale failure (3.6 mA) appears at −691 counts; upscale failure (21 mA) appears at 29376 counts.
In TIA Portal SCL, NORM_X normalises 0 … 27648 to 0.0 … 1.0, and SCALE_X maps 0.0 … 1.0 onto 0.0 … 10.0 bar.
Square-root extraction and fault checks
For differential-pressure flow transmitters configured with a linear Δp output, flow is proportional to the square root of the normalised raw count:
PV = LRV + √((Raw − Rawmin) / (Rawmax − Rawmin)) × (URV − LRV)
Only enable square-root scaling in the PLC if the transmitter itself is not already extracting the square root. Always clamp the normalised fraction at 0.0 before calling SQRT so a small negative raw count (such as −100 counts at 3.94 mA) does not trigger a runtime math fault. For complete loop diagnostics and two-point range finding, use the 4–20 mA converter, and verify the supply voltage budget with the loop power calculator.
Frequently asked questions
Why does Siemens S7 use 27648 instead of 32767?
Siemens reserves the counts above 27648 (up to 32511) for rated overrange (20 to 22.81 mA) and above 32511 for overflow diagnostics, while leaving −4864 to −1 for underrange and wire-break detection below 4 mA.
What raw counts correspond to NAMUR NE 43 faults on Siemens S7?
On a 4–20 mA Siemens S7 input (0 … 27648), 3.6 mA equals −691 counts and 21 mA equals 29376 counts. Trigger a transmitter fault alarm whenever iRaw <= -691 or iRaw >= 29376.
How do I scale 4–20 mA in Allen-Bradley Studio 5000?
Either configure the module scaling directly in the I/O card properties (e.g. 4000–20000 to Engineering Units) or use an SCP Add-On Instruction / Structured Text formula with Raw_In, Raw_Min, Raw_Max, LRV and URV.
Why is my PLC reading slightly negative at 4 mA?
A small negative count (such as −50 to −200 on S7) means the loop current is slightly under 4.00 mA due to zero drift or calibration offset. It is still a valid live signal down to 3.8 mA (−346 counts on S7) under NAMUR NE 43.