Scaling

Scaling (.SCALE)

Used to transform raw data. The target tag type must be REAL or LREAL.

  • Formula: Result = (I – I.Min) x (Q.Max – Q.Min) / (I.Max – I.Min) + Q.Min
  • Usage: Tag_1.SCALE(I.Min;I.Max;Q.Min;Q.Max)
SCALE Working

The SCALE function uses a linear equation to convert data at a specific ratio.

  • Example Scenario: A pressure sensor sends a raw value between 0 and 10000 to the PLC. We want to see this as 0 to 100 on the screen.
  • Definition: Tag_1.SCALE(0;10000;0;100)

Operating States:

  • Normal Range:
    • If 5000 comes from the PLC (middle of the range), 50 is displayed on the screen.
  • Out of Bounds (Extrapolation):
    • Even if the user defined the 0-10000 range, these values are only taken as reference points to calculate the slope (ratio). The function does not stop or limit the calculation when values go outside this range.
    • Situation: If a value of 11000 comes from the PLC;
    • Result: The system maintains the ratio and displays the result as 110.

Summary: Min/Max values in the SCALE function are not “walls” or “limits”; they are just reference points determining the conversion ratio. Even if the input value exceeds the reference range, the formula continues to increase or decrease at the same ratio.

Leave a Reply