SensorCatalog

PLC analog scaling calculator

Convert PLC analog raw counts, 4–20 mA / 0–10 V signals and process values with ready-to-paste TIA Portal, IEC ST and Studio 5000 code.

On a Siemens S7-1200/1500 4–20 mA card (0–27648), 13824 counts is 50 % (12 mA, or 5 bar on a 0–10 bar span), and NAMUR NE 43 fault alarms sit at −691 (3.6 mA) and 29376 (21 mA).

PLC analog card and transmitter range

Presets

Convert

Result

Percent of span
50 %In range
Active count span
2764814.75 effective bits
Value per count
0.0003617 bar0.5787 µA / count
NE 43 fault limits
-691 / 29376≤ 3.6 mA / ≥ 21 mA

Generated PLC scaling code

(* 4-20 mA, raw 0..27648 -> 0..10 bar (linear) | sensorcatalog.com *)
#rNorm := NORM_X(MIN := 0, VALUE := #iRaw, MAX := 27648);
#rPV := SCALE_X(MIN := 0.0, VALUE := #rNorm, MAX := 10.0);
(* NAMUR NE 43 fault: raw <= -691 (3.6 mA) or raw >= 29376 (21 mA) *)
#xFault := (#iRaw <= -691) OR (#iRaw >= 29376);

Counts depend on the analogue input card. Siemens S7-1200 and S7-1500 inputs report the nominal range as 0 to 27648 (the default here); for other cards enter the counts at both ends of the signal from the card’s manual. In the code, iRaw (INT) is the card’s value and rPV (REAL) the process value. Check one known signal on site before commissioning.

Schematic

PV5 bar0 … 10 bar4–20 mA12 mAIn rangePLC RAW1382450 %50 %0276480 % … 100 %
Drawn from the inputs above; not to scale.

Scaling points

Raw countSignal (mA)OutputValue (bar)
04.00 mA0 %0
69128.00 mA25 %2.5
1382412.00 mA50 %5
2073616.00 mA75 %7.5
2764820.00 mA100 %10

Click a row to load it into the converter.

Formulas and standards
PV = LRV + (Raw − Rawmin) / (Rawmax − Rawmin) × (URV − LRV)
PV√ = LRV + √((Raw − Rawmin) / (Rawmax − Rawmin)) × (URV − LRV)

Siemens S7-1200, S7-1500 and S7-300 analog modules map the nominal measuring range to 0 … 27648 counts (overrange up to 32511, underrange down to −4864 on 4–20 mA). S7-200 maps 4–20 mA to 6400 … 32000. Allen-Bradley 1756/1769 cards commonly use Engineering Units (4000 … 20000 for 4–20 mA), Proportional / PID counts (3277 … 16384) or 0 … 32767.

For 4–20 mA inputs, NAMUR NE 43 fault counts are computed directly from 3.6 mA (downscale) and 21 mA (upscale) so alarm comparators in the PLC match the transmitter failure settings. Square-root extraction applies only when the transmitter outputs current linear in differential pressure.

Need a transmitter or signal isolator matched to this PLC input?

Contact us

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.

↑ ↓ choose · Enter open · Esc close