Analog scaling converts a raw electrical measurement into useful engineering units.
A PLC analog input card does not naturally understand bar, degrees Celsius, litres per minute or tank percentage. It receives an electrical signal—often 4–20 mA—and converts it into a raw numerical value.
The PLC program must then translate that raw number into the range used by operators and control logic.
For example:
- 4 mA = 0%
- 20 mA = 100%
- Scaled PLC value = 0 to 100%
When the scaling is correct, alarms, interlocks and control loops receive an accurate representation of the process.
When it is wrong, every downstream function may also become wrong.
The program can execute perfectly while using a completely false process value.
The Analog Measurement Chain
A typical analog signal follows this path:
- The process changes.
- A sensor detects the change.
- A transmitter generates a 4–20 mA signal.
- The PLC analog module converts the current into a raw count.
- Scaling logic converts the raw count into engineering units.
- Filtering may smooth the result.
- Alarms, permissives and PID loops use the value.
- The HMI displays it to the operator.
A scaling fault occurs near the middle of this chain, but its effects spread throughout the entire control system.
The HMI may show the wrong pressure. A PID controller may drive a valve in the wrong direction. A high-level alarm may activate too late. Startup may be blocked by a process condition that is actually healthy.
Basic Linear Scaling
A common linear scaling formula is:
Engineering Value =
(Raw Value − Raw Minimum)
×
(Engineering Maximum − Engineering Minimum)
÷
(Raw Maximum − Raw Minimum)
+
Engineering MinimumThe programmer must know five values:
- Current raw input
- Raw minimum
- Raw maximum
- Engineering minimum
- Engineering maximum
Suppose a pressure transmitter is configured as:
- 4 mA = 0 bar
- 20 mA = 10 bar
At 12 mA, the signal is halfway through the electrical range. The expected result is therefore approximately 5 bar.
The formula is straightforward. The difficulty is ensuring that every parameter matches the actual transmitter and input-module configuration.
Raw Counts Depend on the PLC Module
Different PLC platforms and analog modules represent current signals differently.
A module may represent its nominal measuring range as:
- 0 to 1,000
- 0 to 4,095
- 0 to 27,648
- 0 to 32,000
- Another manufacturer-specific range
Some modules assign zero raw counts to 4 mA when configured for a 4–20 mA range. Others use a raw representation that includes underflow and overflow regions.
Never copy raw limits from another project without checking the manual for the exact module and selected channel range.
Using 0–32,000 in a program designed for a module that uses 0–27,648 produces a measurement that appears smooth but is consistently incorrect.
Wrong Engineering Range
The transmitter and PLC must use the same lower and upper range values.
Suppose the field transmitter is configured for:
- 4 mA = 0 bar
- 20 mA = 16 bar
But the PLC scaling assumes:
- 4 mA = 0 bar
- 20 mA = 10 bar
At full current, the real pressure may be 16 bar while the HMI displays only 10 bar.
The trend still looks clean. The signal still rises when pressure rises. Nothing appears obviously broken.
However:
- High-pressure alarms operate at the wrong physical point.
- PID tuning is based on an incorrect process range.
- Operators receive misleading information.
- Process limits may be exceeded without warning.
The smaller the scaling mismatch, the harder it can be to notice.
Reversed Scaling
Reversed scaling occurs when the engineering minimum and maximum—or the raw minimum and maximum—are entered in the wrong order.
Instead of:
4 mA = 0%
20 mA = 100%the program may calculate:
4 mA = 100%
20 mA = 0%The displayed value decreases as the real process increases.
This can create severe control problems.
A PID loop may respond in the wrong direction. For example, increasing pressure causes the scaled feedback to decrease, so the controller opens the regulating valve further. The real pressure rises even more while the PLC believes it is falling.
A reversed value can therefore create positive feedback and rapid process instability.
Always test at both ends of the signal range.
Wrong Analog Input Type
The hardware channel must match the field signal.
Common configuration mistakes include:
- 0–20 mA selected for a 4–20 mA transmitter
- Voltage input selected instead of current input
- ±10 V selected for a 0–10 V signal
- Resistance measurement selected for a transmitter output
- Two-wire mode selected for a self-powered device
- Incorrect thermocouple or RTD type
The module may still produce raw numbers, but those numbers will not correspond correctly to the process.
For example, treating a 4–20 mA signal as 0–20 mA causes 4 mA to represent 20% of the input range rather than zero.
If the PLC then scales that range from 0 to 100%, the minimum process condition may appear as 20%.
Scaling the Signal Twice
Double scaling occurs when a value that is already in engineering units passes through another scaling block.
For example:
- A device sends pressure through PROFINET as 0–10 bar.
- The PLC programmer assumes the value is raw analog data.
- A second scaling calculation converts it again.
A real value of 5 bar might become 0.0018 bar or another meaningless result, depending on the formula.
This often happens when projects combine:
- Remote I/O
- Smart instruments
- Drive telegrams
- HART variables
- Data from another PLC
- Reusable function blocks
Before applying scaling, identify exactly what the source tag represents.
Is it:
- Electrical current?
- Raw module count?
- Percentage?
- Engineering units?
- A normalized value between 0 and 1?
- A fixed-point value with an implied decimal place?
The tag name alone may not provide enough information.
Integer Division and Lost Precision
PLC scaling calculations often use integer data types for performance or compatibility.
Integer arithmetic discards decimal fractions.
Consider:
Normalized := Raw_Value / Raw_Span;If both values are integers, a raw value below the full span may produce zero.
For example:
13,824 / 27,648 = 0mathematically, the expected result is 0.5. Integer division may discard the fraction and return zero.
The better approach is to convert values to a floating-point type before division:
Normalized :=
REAL(Raw_Value) / REAL(Raw_Span);Another option is to multiply before dividing, but that creates a risk of integer overflow.
The chosen method must preserve both range and precision.
Integer Overflow
Overflow occurs when an intermediate result exceeds the maximum value supported by its data type.
Consider:
Scaled_Value :=
Raw_Value × Engineering_Span ÷ Raw_Span;Even if the final answer is within range, Raw_Value × Engineering_Span may become too large for a 16-bit integer.
The result may:
- Wrap around
- Become negative
- Jump unexpectedly
- Trigger a runtime error
- Produce an incorrect engineering value
Use appropriate data types such as 32-bit integers or floating-point values.
Also monitor calculation status where the PLC platform provides overflow or error information.
Signed and Unsigned Data Errors
Analog values may be stored in signed or unsigned variables.
A signed 16-bit integer can represent negative numbers. An unsigned 16-bit integer cannot.
Problems occur when:
- Negative temperatures are stored as unsigned values
- Signed raw diagnostics are interpreted as large positive numbers
- Data received over communication uses a different byte or word interpretation
- Integer types are converted without checking their ranges
A temperature of −10°C could appear as a very large positive value if its signed representation is interpreted as unsigned.
Always confirm:
- Data type
- Word length
- Signed or unsigned format
- Byte order
- Decimal scaling factor
This is particularly important when transferring analog values through Modbus or between different PLC brands.
Incorrect Units
A value can be numerically correct but expressed in the wrong unit.
Examples include:
- Bar interpreted as kilopascals
- Litres per second displayed as litres per minute
- Celsius interpreted as Fahrenheit
- Millimetres displayed as metres
- Percentage represented as 0–1 instead of 0–100
- Revolutions per minute interpreted as hertz
A flow transmitter might send 50 litres per minute while the PLC logic assumes 50 litres per second.
The number looks reasonable, but every calculation based on it becomes incorrect.
Engineering units should be documented in:
- Tag names
- Comments
- HMI labels
- Function-block interfaces
- Alarm settings
- Data-transfer specifications
Alarm Thresholds Become Physically Wrong
Suppose a pressure alarm is configured at:
High alarm = 8 barIf the scaling is correct, the alarm activates at 8 bar.
If the PLC is under-reading by 20%, the actual process may reach 10 bar before the displayed value reaches 8 bar.
The comparison instruction is still correct:
Pressure_PV >= 8.0The problem is that Pressure_PV does not represent the true pressure.
The same risk applies to:
- High-high trips
- Low-pressure shutdowns
- Tank overflow alarms
- Temperature protection
- Flow permissives
- Motor-load monitoring
A small scaling error may create a large safety margin error when the process operates near its limits.
PID Control Becomes Unstable
PID controllers rely on the process value accurately representing the controlled condition.
Incorrect scaling can affect:
- Setpoint interpretation
- Controller gain
- Alarm limits
- Output response
- Tuning calculations
If the process range is configured too narrowly, small physical changes appear large to the controller. The PID may react too aggressively and oscillate.
If the range is too wide, large process changes appear small. The controller may react slowly and struggle to reach the setpoint.
Reversed scaling can make the control response move in the wrong direction entirely.
Before tuning a PID loop, verify the measurement at several known points.
PID tuning cannot correct a false process value.
Startup Permissives Become Unreliable
Analog values frequently create startup permissives.
Examples include:
- Pressure above 3 bar
- Temperature below 60°C
- Tank level above 20%
- Flow above 15 litres per minute
If scaling is wrong, equipment may:
- Start when the process is not ready
- Refuse to start when conditions are healthy
- Stop unexpectedly
- Oscillate around the permissive threshold
The HMI may show that the permissive is correct according to the scaled value. The physical process may tell a different story.
Use a calibrated reference instrument to verify the actual switching point.
Clamping Can Hide Scaling Errors
Programmers often clamp analog values to an expected range:
IF Pressure < 0 THEN
Pressure := 0;
END_IF;
IF Pressure > 10 THEN
Pressure := 10;
END_IF;This prevents impossible values from reaching the HMI, but it can also hide:
- Underflow
- Overflow
- Broken loops
- Incorrect scaling
- Transmitter overrange
- Calculation errors
A signal stuck at exactly 0 or 10 bar may look like a normal process limit rather than a fault.
Keep diagnostic status separate:
Pressure_Value
Pressure_Underflow
Pressure_Overflow
Pressure_Signal_ValidClamping may be useful for display or control protection, but it should not erase evidence of an invalid measurement.
HMI Scaling Conflicts
The PLC may scale a value correctly while the HMI applies another conversion.
For example:
- PLC tag already contains 0–100%
- HMI assumes the tag contains 0–1
- HMI multiplies it by 100 again
A PLC value of 50% becomes 5,000% on the display.
The opposite can also occur, with a correct 50% value displayed as 0.5%.
Check:
- HMI tag scaling
- Decimal-place configuration
- Unit conversion
- Tag data type
- Animation ranges
- Trend scaling
- Alarm thresholds
When the PLC and HMI disagree, compare the raw online tag with the displayed value before changing the PLC program.
Test the Complete Range
A scaling function should be tested at several known points.
For a 0–100% signal:
| Current | Expected value |
|---|---|
| 4 mA | 0% |
| 8 mA | 25% |
| 12 mA | 50% |
| 16 mA | 75% |
| 20 mA | 100% |
Testing only 4 mA and 20 mA may miss non-linear calculation errors or integer precision problems.
Also test:
- Below 4 mA
- Above 20 mA
- Open-circuit condition
- Negative engineering ranges
- Maximum and minimum data-type values
- Communication loss
- Power recovery
A loop calibrator makes these tests much easier and more repeatable.
Compare Three Levels of Information
During troubleshooting, compare:
1. Physical process
What is the actual pressure, temperature, flow or level according to an independent instrument?
2. Electrical signal
What current or voltage is present at the PLC input?
3. PLC value
What raw count and engineering value does the program calculate?
This comparison identifies the fault location.
- Physical value wrong and signal agrees: process or transmitter issue
- Physical value correct but signal wrong: transmitter or wiring issue
- Signal correct but raw count wrong: module or channel configuration issue
- Raw count correct but engineering value wrong: scaling issue
- PLC value correct but HMI wrong: HMI configuration issue
Build a Reusable Scaling Function
A reusable analog scaling block should include inputs such as:
Raw_Value
Raw_Minimum
Raw_Maximum
Engineering_Minimum
Engineering_MaximumUseful outputs may include:
Engineering_Value
Signal_Valid
Underflow
Overflow
Configuration_ErrorThe block should detect invalid configuration, such as:
Raw_Maximum = Raw_Minimumwhich would create division by zero.
It may also validate that the engineering and raw ranges are sensible before performing the calculation.
Centralized scaling reduces the chance of different programmers implementing slightly different formulas throughout the project.
Document Every Analog Channel
Each analog signal should have a clear record containing:
- Instrument tag
- Measurement type
- Signal type
- Transmitter range
- Engineering units
- PLC module and channel
- Raw input range
- Scaling parameters
- Filter settings
- Alarm limits
- Interlock limits
- Calibration date
- Fault-current configuration
This documentation should match the actual field transmitter—not only the original design drawing.
Transmitters are often re-ranged during maintenance. The PLC and HMI must be updated at the same time.
Recommended Troubleshooting Workflow
When a process value appears incorrect:
- Confirm the actual physical measurement.
- Verify the transmitter range and units.
- Measure the electrical signal.
- Check the analog channel configuration.
- Monitor the raw PLC count.
- Confirm raw minimum and maximum values.
- Review engineering minimum and maximum.
- Inspect variable data types.
- Check integer division and overflow risk.
- Confirm that scaling is applied only once.
- Check HMI scaling and units.
- Inject several known test values.
- Verify alarm and permissive thresholds physically.
- Document the final configuration.
Do not change alarm limits merely to compensate for an incorrect process value.
Fix the scaling first.
Final Thoughts
Analog scaling is not a cosmetic conversion used only to make an HMI easier to read.
It determines the value used by:
- Alarms
- Interlocks
- Startup permissives
- PID controllers
- Sequence logic
- Trends
- Production calculations
When the scaling is wrong, every downstream decision is built on false information.
The PLC may execute its logic correctly while the machine responds incorrectly.
Always verify the transmitter range, analog module configuration, raw counts, data types and engineering units across the full measurement range.
A scaling error may appear to be only a small numerical difference.
In the physical process, that difference can determine whether equipment starts, stops or continues operating beyond a safe limit.
