PLC analog scaling
Choose the PLC data format and the transmitter range. You get the process value, percent, current or voltage and a formula ready for your program.
Result
- Percent of range
- 50%
- Signal
- 12 mA
- Raw value
- 13,824
- Process value
- 5 bar
- Status (S7)
- within the nominal range
PV = LRV + (raw − 0) / (27,648 − 0) × (URV − LRV)
SCL: SCALE_X(MIN := 0, VALUE := NORM_X(MIN := 0, VALUE := raw, MAX := 27,648), MAX := 10)
| % | Signal [mA] | Raw | Value [bar] |
|---|---|---|---|
| 0 | 4 | 0 | 0 |
| 25 | 8 | 6,912 | 2.5 |
| 50 | 12 | 13,824 | 5 |
| 75 | 16 | 20,736 | 7.5 |
| 100 | 20 | 27,648 | 10 |
Why 27648?
Siemens S7 PLCs represent the nominal range of every analog input as 0…27648, whether it is 4–20 mA, 0–10 V or a thermocouple. Headroom up to 32511 shows an overshoot (e.g. 22.8 mA), and negative values down to −4864 a signal below 4 mA. 32767 (or −32768) means overflow or a wire break, depending on the module and its diagnostics.
Rockwell formats
Allen-Bradley modules let you choose the data format in the module configuration. “Scaled for PID” gives 0…16383 for the nominal range, “Percent range” 0…10000 (0.00…100.00%), and “Engineering units” for 4–20 mA the current in microamps, 4000…20000. Ranges differ between module families, so check the module manual and pick “custom range” if needed.
Example
A 0–10 bar pressure transmitter on an S7 module set to the 4–20 mA range: a raw value of 13824 is half of 27648, so 12 mA and 5 bar.
Note: if the module is set to 0–20 mA (some S7-1200 inputs have no 4–20 mA range), 4 mA reads 5530, not 0. Then choose “custom range” from 5530 to 27648 with the 4–20 mA signal.
Common questions
Why doesn’t Siemens use 32767 as 100%?
The band 27649…32511 is kept for overshoot, so the PLC can see the signal went above range instead of saturating straight away.
How do I detect a broken 4–20 mA loop?
The current drops to 0 mA, which on S7 gives a value below −4864 or the code 32767 (with diagnostics enabled). Many programs also treat anything below about 3.6 mA as a fault, in line with NAMUR NE 43.