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):

CurrentRAWPressure
4 mA00 bar
8 mA69122.5 bar
12 mA138245 bar
20 mA2764810 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 rangeUnipolar range (e.g. 4–20 mA)
32767> 117.589overflow
27649 … 32511up to 117.589overrange
0 … 276480 … 100rated range
−1 … −4864down to −17.593underrange
−32768< −17.593underflow, 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 * 10 in 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

Loading the map…

Sources

  1. SIMATIC S7-1500, ET 200MP, ET 200SP, ET 200AL, ET 200pro Analog value processing — Function Manual 06/2014 — Siemens AG

Updated 2026-10-01