LEARN · INSTRUMENTATION · SCALING
Scaling without fear: from 4–20 mA to engineering units
Convert a transmitter's signal to meters, bar or °C and see it on three rulers side by side. One arrow shows the real value and another what your PLC calculates: if they do not match, you see it instantly. In 7 short steps.
Scaling is changing rulers
Like going from inches to centimeters. The analog card measures the level with a ruler that goes from 0 to 27648. You want to read it on a ruler from 0 to 3 meters. Both measure the same thing, only the numbers change:
| Current | Card raw value | Meters |
|---|---|---|
| 4 mA | 0 | 0 m |
| 8 mA | 6912 | 0.75 m |
| 12 mA | 13824 | 1.5 m |
| 16 mA | 20736 | 2.25 m |
| 20 mA | 27648 | 3 m |
Look at the table: half of the raw value is half of the meters, a quarter of the raw value is a quarter of the meters. The calculation takes two steps:
- What fraction of the total is the raw value? You divide: 13824 / 27648 = 0.5. It is half.
- That fraction, in meters. You multiply by the range: 0.5 × 3 = 1.5 m.
In TIA Portal those two steps are two boxes: NORM_X (step 1) and SCALE_X (step 2). The 27648 belongs to S7-1200 and S7-1500 cards; other brands and models use other numbers, such as 0 to 4095 or 0 to 32000. Check the card's manual and replace 27648 with that value.
See a hint
- 1Write or change the code
- 2Tap ▶ Run and test it on the plant
- 3Tap ✓ Check to review it
Ctrl + Enter runs. Your code is saved in this browser.
▶ blue: real value of the instrument · ◀ purple: what your PLC calculates
The formula that works for everything
value = minimum + NORM × (maximum − minimum)- Level from 0 to 3 m: 0 + NORM × 3.
- Pressure from 0 to 10 bar: 0 + NORM × 10.
- Temperature from −50 to 150 °C: −50 + NORM × 200.
That is exactly what SCALE_X does inside. That is why, with SCALE_X, you only write the instrument's minimum and maximum, and the box takes care of the rest.
Why the .0?
With integers (INT), the PLC drops the decimals: 13824 / 27648 gives 0.5, but as an integer it becomes 0. If you write 27648.0, the calculation is done with decimals (REAL). Also, an INT only goes up to 32767: LT_101_RAW * 3 with the raw value at 20000 gives 60000 and overflows. With 3.0 it does not happen.
Keep practicing
In SCL lesson 2 you use the scaled level to control a pump, and in instrument faults you see what happens to the signal when the wire breaks.
Scale your transmitters on a 3D plant
In Procesia the level, pressure and temperature transmitters reach the analog inputs of your real PLC or PLCSIM. Scale, control and watch it work in 3D. Use the full version free for 7 days, no card.