Scale SCALE

Maps Input from one range onto another, like 4–20 mA to 0–100 %.

TagAfter two scans
LevelPct50
mA_Hi20
mA_Lo4
Pct_Hi100
Pct_Lo0
Raw_mA12

How it works

While the rung is true, maps Input from its range (Input Low to Input High) onto the output range (Output Low to Output High), so 12 in 4 to 20 becomes 50 in 0 to 100. All values are REAL. An Input outside its range gives a result outside the output range.

How it's used

Use SCALE to turn a raw signal into units, such as 4–20 mA into 0–100 %.

TagValue
Raw_mA18.8
LevelPct92.5
HighLevel1

18.8 mA is 92.5 %, so HighLevel is on.

Operands

OperandData typeRead or write
InputREAL or a numberReads
In lowREAL or a numberReads
In highREAL or a numberReads
Out lowREAL or a numberReads
Out highREAL or a numberReads
DestREALWrites

Common mistakes

  • Expecting the result to stop at the range endsSCALE does not limit. An Input outside its range goes outside the output range. Add a LIM if needed.

Related