> ## Documentation Index
> Fetch the complete documentation index at: https://wiki.codeandcompile.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Analog Scaling Calculator (4–20 mA, 0–10 V)

> Convert a 4–20 mA, 0–20 mA or 0–10 V signal to engineering units and PLC raw counts, with the formula and a free calculator.

Most transmitters send their measurement as an analog signal: **4–20 mA**, **0–20 mA** or **0–10 V**. The PLC's analog input turns that signal into a raw number, and your program scales the raw number into engineering units such as bar, °C or litres.

## The formula

Every analog scaling is the same straight line between two points:

```text theme={null}
percent     = (signal − signal_min) / (signal_max − signal_min)
engineering = eng_min + percent × (eng_max − eng_min)
raw count   = percent × raw_max
```

**Example:** a pressure transmitter with a 0–10 bar range sends **12 mA**.

```text theme={null}
percent     = (12 − 4) / (20 − 4)  = 0.5   → 50 %
engineering = 0 + 0.5 × (10 − 0)   = 5 bar
raw count   = 0.5 × 27648          = 13824 (Siemens S7-1200 / S7-1500)
```

> [!NOTE]
>
> Siemens S7-1200 and S7-1500 analog inputs use **0 to 27648** for the nominal range. In TIA Portal you do the same calculation with `NORM_X` (raw count to 0.0–1.0) followed by `SCALE_X` (0.0–1.0 to engineering units). Other PLC brands use other raw ranges, so set **Raw count at 100 %** to match your module's manual.

## Calculator

Pick the signal type, enter the transmitter range, and move the slider to see the engineering value and the raw count the PLC reads.

Example values for a 4–20 mA transmitter with a 0–10 bar range and a raw range of 0–27648: 4 mA = 0 % = 0 bar = 0 counts; 8 mA = 25 % = 2.5 bar = 6912 counts; 12 mA = 50 % = 5 bar = 13824 counts; 16 mA = 75 % = 7.5 bar = 20736 counts; 20 mA = 100 % = 10 bar = 27648 counts.

## Why 4–20 mA starts at 4 mA

A 4–20 mA loop has a **live zero**: 0 % of the measuring range is 4 mA, not 0 mA. If the current drops close to 0 mA, the PLC knows the wire is broken or the sensor has failed, instead of reading a valid "0 bar".

Many transmitters follow the NAMUR NE 43 recommendation: the normal signal stays between **3.8 and 20.5 mA**, and a current of **3.6 mA or less**, or **21 mA or more**, signals a fault. The calculator shows a warning in those zones.

## Related

> [card] [Modbus float converter](https://wiki.codeandcompile.com/tools/modbus-float-converter.md)
>
> Turn two Modbus registers into a float in all four byte orders.

> [card] [Get my courses – 20% off](https://wiki.codeandcompile.com/who-am-i/get-my-courses-20-off.md)
>
> Learn PLC programming step by step. Use code **WIKI** for 20% off.


## Related topics

- [Articles](https://wiki.codeandcompile.com/factory-automation/plc/articles/index.md)
- [Free Engineering Tools](https://wiki.codeandcompile.com/tools/index.md)
- [PID Tuning Simulator](https://wiki.codeandcompile.com/tools/pid-simulator.md)
- [DVP 10SX](https://wiki.codeandcompile.com/factory-automation/plc/delta-electronics/dvp-10sx.md)
- [Get my courses – 20% off](https://wiki.codeandcompile.com/who-am-i/get-my-courses-20-off.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.