The panel shows a pressure, temperature, level, or percentage that is pinned, offset, reversed, or plainly wrong even though the input current changes. Start here: match the configured electrical input range and engineering-unit endpoints, then apply one linear transform. Put the scaling in the input module or in PLC logic—not both—and verify both endpoints before changing the HMI.
Read the symptom before changing the scale
Watch the live electrical value, the scaled PLC value, and the displayed HMI value at the same time. That separates an instrument or wiring problem from a scaling problem.
| Symptom | Likely cause or first check |
|---|---|
| Input current changes, but the engineering value stays fixed | Check whether the logic reads the correct channel tag and whether an overwrite, clamp, or simulation value is active. |
| Engineering value changes but has the wrong span | Compare the configured lower and upper engineering limits with the instrument range. |
| Value is correct at one endpoint but wrong at the other | Check both spans in the scaling equation. A correct offset cannot compensate for a wrong range. |
| Value moves in the opposite direction | Check for reversed engineering endpoints or an intentionally reverse-acting instrument range. |
| PLC value is correct but the panel is wrong | Inspect HMI-side scaling and tag selection. That is not an analog input fault. |
| Value is scaled twice | Check whether the input module already returns engineering units before applying PLC logic. |
Confirm what the PLC tag represents. It may contain current in milliamps, a module-specific raw count, a normalized value, or engineering units. Read the channel configuration and module data definition; the tag name alone does not prove its units.
Follow the linear conversion
A 4-20 mA measurement is a linear mapping between the electrical range and the configured field range. Use x for the input value, x_min and x_max for its endpoints, and m_min and m_max for the engineering-unit endpoints.
n = (x - x_min) / (x_max - x_min)
m = n * (m_max - m_min) + m_min
The first line normalizes the input to a fraction of span. The second maps that fraction onto the engineering range. Combined, the calculation is:
m = ((x - x_min) / (x_max - x_min)) * (m_max - m_min) + m_min
For a tag expressed directly in milliamps, set x_min = 4 and x_max = 20. If the input tag contains raw counts, use the raw values assigned to the 4 mA and 20 mA endpoints by the module configuration; retrieve those values from the module profile or datasheet rather than substituting 4 and 20.
This is the inverse of the transmitter's transformation. The transmitter converts the field measurement into current; the PLC converts current or raw counts back into the field measurement. Siemens-style normalize-then-scale processing expresses the same affine transform as two operations rather than one long equation.
Choose one scaling location
Use module scaling when the installed input module supports the required engineering range and the project benefits from receiving a ready-to-use floating-point value. It reduces repeated arithmetic in the program, but it also moves important configuration out of the visible control logic.
Use PLC logic when ranges change frequently, several I/O families must share one interface, or reusable HMI faceplates expose lower and upper scaling values. A common routine or AOI can give every channel the same diagnostics, substitution behavior, and operator interface.
Legacy code may retain logic scaling because older PLC-5 applications lacked built-in analog scaling. A ControlLogix migration can move scaling into capable hardware, but that changes tag meaning and may require edits throughout the program and HMI. Keeping the existing transform can be the lower-risk choice when compatibility matters.
On an SLC application, the SCP instruction is an available scaling pattern. In other platforms, use the native normalize and scale functions or implement the formula directly. For Point I/O, an L16ER CompactLogix system, or any mixed architecture, inspect the exact module profile before deciding that card-level scaling is available; controller family alone does not answer the question.
Configure the conversion in order
- Identify the source units. Monitor the input tag and inspect the channel configuration. Record whether the value is milliamps, counts, normalized units, or engineering units.
- Record the electrical endpoints. For a value already expressed as current, use 4 mA and 20 mA. For counts, record the module-defined endpoint values.
- Record the instrument range. Read the lower and upper engineering values from the instrument configuration or approved data sheet. Include the unit with each value.
- Select one owner. Disable or remove any second transform in the module, PLC, or HMI. Preserve diagnostic handling separately from the scale calculation.
-
Implement normalization. Calculate
(x - x_min) / (x_max - x_min)using floating-point arithmetic. Reject a configuration wherex_maxequalsx_minbecause it causes division by zero. -
Map to engineering units. Multiply by
(m_max - m_min), then addm_min. - Expose configuration deliberately. If operators or remote support personnel may change a replacement sensor range, provide controlled lower and upper parameters and record the resulting values with the equipment configuration.
Do not add a separate offset before understanding the existing equation. The lower-end subtraction and final addition already handle offset. Extra correction terms often make one test point look right while increasing error across the span.
Verify endpoints and direction
-
Test the lower endpoint. At
x = x_min, the normalized result must be0and the output must equalm_min. -
Test the upper endpoint. At
x = x_max, the normalized result must be1and the output must equalm_max. - Test an interior point. Use a known applied input and calculate the expected value independently with a spreadsheet or calculator. This catches integer division, endpoint transcription, and double-scaling errors.
- Compare every layer. Trend or monitor the source input, normalized fraction, engineering value, and HMI tag. Find the first layer where the value diverges.
- Check replacement behavior. If the sensor range can be changed, enter the replacement endpoints and repeat the lower, upper, and interior tests.
A correct calculation does not prove the measurement chain is healthy. If the electrical value itself is unstable or fails to follow the applied test signal, return to instrument power, loop wiring, channel selection, and input diagnostics.
Avoid the fixes that waste time
- Do not rescale the HMI until you prove the PLC engineering value is wrong. HMI scaling can hide the actual defect and create a second transform.
- Do not enter
4and20when the PLC receives raw counts. Use the count endpoints assigned by the input module. - Do not use integer arithmetic for the normalized fraction. Truncation can collapse most of the range to zero before the final multiplication.
- Do not change module scaling during a migration without tracing every consumer of the tag. Logic, alarms, trends, and faceplates may expect the old raw representation.
- Do not treat scaling as calibration. Scaling converts units; calibration checks the instrument and input channel against a known reference.
- Do not clamp the value before recording diagnostic information. A clamp may be useful for control behavior, but it can conceal an out-of-range or failed-loop condition from maintenance.
FAQ
Can I scale 4-20 mA directly in PLC logic?
Yes. Use m = ((x - x_min) / (x_max - x_min)) * (m_max - m_min) + m_min with floating-point arithmetic and the actual units delivered by the input channel.
Does 4 mA always equal zero engineering units?
No. 4 mA equals the instrument's configured lower engineering value, which may be zero, negative, or another process value. Read the instrument range.
Can I use 4 and 20 when my analog tag contains counts?
No. Use the raw-count endpoints that the module maps to 4 mA and 20 mA. Find them in the channel configuration or module documentation.
Does card-level scaling remove the need for PLC scaling?
Yes, when the module already returns the required engineering units. Applying the formula again causes double scaling, so verify the input tag's representation first.
Can I keep troubleshooting after the input ignores a known test signal?
Stop changing the scaling when a known applied signal does not produce the expected channel input, module diagnostics remain active, or the exact data representation cannot be identified. Record the module catalog information, controller and module diagnostics, channel configuration, applied signal, and observed tag value, then escalate to the manufacturer's official support channel.