Scaling and RAW values (Siemens 0…27648)
Linear scaling of a signal into engineering units, how Siemens PLCs represent analog values, over- and underrange, with an ST example.
Linear scaling
The value is converted using two points — the start and end of the range:
EU = EU_min + (RAW − RAW_min) × (EU_max − EU_min) / (RAW_max − RAW_min)
The inverse (for example, for an analog output):
RAW = RAW_min + (EU − EU_min) × (RAW_max − RAW_min) / (EU_max − EU_min)
Example: pressure transmitter 0…10 bar, 4–20 mA, Siemens module (RAW 0…27648):
| Current | RAW | Pressure |
|---|---|---|
| 4 mA | 0 | 0 bar |
| 8 mA | 6912 | 2.5 bar |
| 12 mA | 13824 | 5 bar |
| 20 mA | 27648 | 10 bar |
Siemens analog value representation
SIMATIC S7-1500 / ET 200 modules deliver an analog value as a signed 16-bit integer (two's complement). The rated range is 0…27648 (unipolar) or −27648…+27648 (bipolar); the headroom up to 32767 is used for overrange and diagnostics:
| Decimal | % of range | Unipolar range (e.g. 4–20 mA) |
|---|---|---|
| 32767 | > 117.589 | overflow |
| 27649 … 32511 | up to 117.589 | overrange |
| 0 … 27648 | 0 … 100 | rated range |
| −1 … −4864 | down to −17.593 | underrange |
| −32768 | < −17.593 | underflow, including wire break |
For 4–20 mA: 32511 ≈ 22.81 mA, −4864 ≈ 1.185 mA. The values 32767 and −32768 are not measurements but error codes: handle them separately and never feed them to a controller.
Modules with less than 16-bit resolution left-align the value: a 13-bit module, for example, changes in steps of 8. The 0…27648 range is kept.
Other manufacturers may use 0…32000, 0…4095, 0…10000 and so on — take the values from the specific module's manual.
ST example
(* RAW 0..27648 -> 0..10 bar, with out-of-range check *)
IF Raw >= 32767 OR Raw <= -32768 THEN
Fault := TRUE; (* overflow / wire break *)
ELSE
Fault := FALSE;
Pressure := INT_TO_REAL(Raw) * (10.0 - 0.0) / 27648.0 + 0.0;
END_IF;
In TIA Portal the same is done with NORM_X + SCALE_X; in the S7-300/400 library with SCALE/UNSCALE.
Where scaling goes wrong
- Scaling over 0…32767 instead of 0…27648 — the result is about 15.6 % too low.
- Integer division before multiplication:
Raw / 27648 * 10in INT always gives 0 or 10. - Clamping the value before checking for 32767 — a wire break is masked as "maximum".
- Module configured for 0–20 mA while the transmitter is 4–20 mA — a zero process value reads as 20 % of range, the error shrinking towards full scale.
Tools
- PLC RAW Scaling — Siemens presets, custom ranges, formula and ST snippet.
- Analog Signal Calculator — mA/V ↔ engineering units.
Connections
Open in Knowledge Graph →Loading the map…
Sources
Updated 2026-10-01