Skip to content
PROCESIAby Aterra Ingeniería

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:

CurrentCard raw valueMeters
4 mA00 m
8 mA69120.75 m
12 mA138241.5 m
16 mA207362.25 m
20 mA276483 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:

  1. What fraction of the total is the raw value? You divide: 13824 / 27648 = 0.5. It is half.
  2. 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

  1. 1Write or change the code
  2. 2Tap ▶ Run and test it on the plant
  3. 3Tap ✓ Check to review it
Program · OB1 (SCL)

Ctrl + Enter runs. Your code is saved in this browser.

LT-101 · Level
CARD FRACTION LT_101m 4812162006912138242073627648 00.250.50.751 01.53 12.0 mA 13824 0.50 1.50 m — Run your program to see what value it calculates.

▶ blue: real value of the instrument · ◀ purple: what your PLC calculates

Level1.50 m
Watch table

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.