What this article answers
Article summary
To scale a 4-20mA analog signal in ladder logic, engineers map raw PLC input counts to engineering units using linear interpolation. Safe implementation also requires fault detection, because values below 3.6mA or above 21.0mA indicate diagnostic failure conditions under NAMUR NE 43, not valid process measurements.
A PLC does not read “tank level,” “flow,” or “pressure.” It reads an integer derived from current at an input card, and the rest is your math and your fault logic. That distinction matters because a broken wire can look deceptively like a valid low process value if the program is careless.
During recent baseline assessments using OLLA Lab’s analog signal simulation workflow, 68% of junior engineers failed to latch a sensor fault when a simulated 4-20mA transmitter dropped to 3.2mA instead of treating it as a valid minimum reading. Methodology: n=41 learner submissions; task definition = scale a simulated 4-20mA pressure signal and implement fault handling for under-range current; baseline comparator = correct handling defined as alarm/fault latch plus interlock response rather than scaled 0% process value; time window = internal Ampergon Vallis Lab assessments conducted January-March 2026. This is an internal Ampergon Vallis benchmark, not an industry-wide failure rate. It supports one narrow claim: syntax competence does not reliably imply fault-aware deployability.
Why is the 4-20mA standard used in industrial analog scaling?
The 4-20mA loop remains standard because it gives control systems a live zero. In practical terms, 4mA represents the minimum valid process value while still proving that the instrument and loop are energized.
A valid zero reading should not be electrically indistinguishable from a dead transmitter.
Current loops also tolerate cable distance and electrical noise better than many voltage-based schemes because the signal is represented as loop current rather than local voltage magnitude. This is one reason 4-20mA remains common across process industries even in systems that include digital overlays, smart diagnostics, or fieldbus integration.
What is the critical distinction between 0mA and 4mA?
The distinction is operational:
- 4mA = the transmitter is powered, communicating a valid minimum process value, and the loop is intact.
- 0mA = the loop is likely broken, unpowered, shorted incorrectly, or the transmitter has failed catastrophically.
- Values slightly below 4mA may indicate under-range or diagnostic fault behavior, depending on transmitter configuration and plant standard.
- Values above 20mA may indicate over-range or diagnostic fault behavior, again depending on configuration.
This is why “just scale it” is incomplete advice. Scaling without diagnostics is incomplete control logic.
Why not use 0-10V for the same job?
0-10V can be serviceable in short-run, controlled environments, but it does not provide the same live-zero diagnostic behavior as 4-20mA. Voltage signals are also more sensitive to voltage drop, grounding issues, and noise over distance. In a cabinet, that may be manageable. Across a plant, the loop current standard is often more robust.
What is the mathematical formula for PLC analog scaling?
PLC analog scaling is linear interpolation. Whether the instruction is called `SCP`, `SCL`, or implemented manually, the controller is mapping one range into another.
The standard formula is:
Scaled_Value := (((Raw_Input - Raw_Min) * (EU_Max - EU_Min)) / (Raw_Max - Raw_Min)) + EU_Min;
This is the engineering form of `y = mx + b`, expressed for raw counts and engineering units.
How do the variables in y = mx + b map to PLC analog scaling?
| Mathematical Term | PLC Scaling Meaning | Example | |---|---|---| | `y` | Scaled output in engineering units | 0-100 PSI | | `x` | Raw input from analog card | 0-32767 | | `m` | Slope = EU span / raw span | 100 / 32767 | | `b` | Offset applied after span conversion | EU minimum |
For a 4-20mA signal, the important detail is that the valid measurement range does not begin at electrical zero. Your raw minimum for scaling must match the card count that corresponds to the configured low end of the transmitter range, not simply the lowest integer the module can represent.
What are Raw Min/Max and EU Min/Max?
They are different domains and should not be mixed.
- Raw Min/Max = the integer counts produced by the analog input card
- EU Min/Max = the engineering units used by the process or operator
- Example Raw Range = 0 to 32767 on a 16-bit style representation
- Example EU Range = 0 to 100 PSI
If the transmitter is ranged 0-100 PSI and outputs 4-20mA, then:
- 4mA should map to 0 PSI
- 20mA should map to 100 PSI
The exact raw counts for 4mA and 20mA depend on module type, vendor representation, and configuration. That is a significant implementation detail.
How do 12-bit and 16-bit analog representations affect scaling?
Resolution affects granularity, not the underlying method.
| Input Representation | Typical Raw Span Example | Engineering Implication | |---|---|---| | 12-bit | 0-4095 | Larger step size, less resolution | | 15/16-bit style integer representation | 0-32767 | Finer step size, common in many PLC environments |
The scaling logic is identical in both cases:
- Identify the raw count for the low valid signal.
- Identify the raw count for the high valid signal.
- Map that span to engineering units.
- Handle fault bands separately.
A common mistake is to scale the full card range and assume the result is process-valid. It may be mathematically correct and operationally wrong.
How do you calculate a 4-20mA signal into engineering units?
You calculate it by mapping the valid current span to the process span. For a 0-100 PSI transmitter, 4mA is 0 PSI and 20mA is 100 PSI.
If your module presents raw counts, use the raw counts corresponding to those two current values. If your simulator or software exposes current directly, the math is easier to see:
Scaled_PSI = ((Current_mA - 4.0) * (100.0 - 0.0) / (20.0 - 4.0)) + 0.0
Examples:
- 4.0mA -> 0 PSI
- 12.0mA -> 50 PSI
- 20.0mA -> 100 PSI
That is the ideal linear case. Real systems often add filtering, alarming, clamping, and fault handling around it.
Should you clamp out-of-range values?
Yes, but only after you decide how diagnostics are handled. A value below the valid process range may need to:
- trigger a fault,
- inhibit control action,
- alarm the operator,
- and only then be clamped or substituted for display purposes.
Clamping alone can hide a fault.
How do you program broken wire detection for 4-20mA sensors?
Broken wire detection is implemented by treating certain current values as diagnostic states, not process values.
For 4-20mA loops, a common strategy is:
- scale only the valid signal range,
- compare the incoming signal against fault thresholds,
- latch a fault bit if the signal enters a diagnostic band,
- interlock downstream equipment or control modes accordingly.
What does NAMUR NE 43 require for analog fault handling?
NAMUR NE 43 defines standardized fault signaling bands for analog transmitters. In common use, it establishes that:
- below 3.6mA indicates a low fault condition,
- above 21.0mA indicates a high fault condition.
A practical interpretation is:
- valid process region is typically inside the normal operating band,
- diagnostic region exists below or above that band,
- the PLC should not treat those diagnostic values as legitimate process measurements.
Many implementations also recognize a narrower normal measurement band such as approximately 3.8mA to 20.5mA, depending on device behavior and site standards. The exact configured thresholds should match the transmitter, module, and control philosophy.
How do you implement NAMUR NE 43 logic in ladder?
A typical ladder approach uses:
- a `LES` comparator for under-range fault,
- a `GRT` comparator for over-range fault,
- an `OTL` or equivalent latch for `Sensor_Fault`,
- a manual or supervised reset path,
- and an interlock that blocks automatic control when the fault is active.
Conceptually:
If Raw_Input < Raw_Equivalent_Of_3_6mA Then Sensor_Fault := TRUE End_If
If Raw_Input > Raw_Equivalent_Of_21_0mA Then Sensor_Fault := TRUE End_If
If Sensor_Fault = TRUE Then Pump_Auto_Enable := FALSE PID_Enable := FALSE End_If
The key operational point is this: a 3.2mA signal should not quietly become 0 PSI. It should become a faulted instrument state with a defined control response.
What does “Simulation-Ready” mean in this context?
In this context, “Simulation-Ready” means the engineer can show that the control logic behaves correctly under both valid and failed analog conditions before it reaches a live process.
Operationally, that means the learner can:
- scale a 4-20mA input into engineering units,
- detect an under-range fault at a threshold such as the 3.6mA equivalent,
- latch the fault,
- interlock the affected equipment,
- and verify the response when the signal is forced to a failed state such as 3.2mA.
That is a useful dividing line between syntax and deployability.
How do you build analog fault logic in OLLA Lab?
OLLA Lab provides a bounded environment to test analog behavior, observe tag state, and inject failure conditions without touching live equipment.
A practical workflow in OLLA Lab looks like this:
- Create or open a ladder project in the web-based ladder editor.
- Define the analog input tag for the simulated transmitter.
- Implement scaling logic using the appropriate raw range and engineering-unit range.
- Add comparator logic for under-range and over-range fault thresholds.
- Latch a `Sensor_Fault` bit when the signal enters a diagnostic band.
- Use that fault bit in permissive logic to inhibit pump start, disable PID, or force a safe state.
- Observe the tag behavior in the Variables Panel while the signal changes.
This is where OLLA Lab becomes practically useful. You are not only drawing rungs; you are checking whether ladder state, I/O state, and simulated equipment behavior agree.
Which OLLA Lab features matter most for analog scaling practice?
The most relevant features are:
Build scaling, comparison, latching, and interlock logic directly in the browser.
- Ladder Logic Editor
Run the logic without hardware and observe cause-and-effect safely.
- Simulation Mode
Monitor raw values, scaled values, booleans, analog states, and control responses in one place.
- Variables Panel and I/O Visibility
Practice analog signal handling and see how bad input quality affects control behavior.
- Analog and PID Learning Tools
Place the signal inside a realistic process context such as a pump, tank, or process skid.
- Scenario-Based Exercises
The product is not a substitute for site commissioning. It is a place to rehearse parts of commissioning that may be too risky, too disruptive, or too expensive to hand to a novice on a live process.
How does OLLA Lab simulate analog signal drift and over-range faults?
Fault logic should be validated by injecting the fault, not only by reviewing the rung.
In OLLA Lab, the simulation workflow can be used to force analog conditions such as:
- 2mA for a severe under-range or broken-wire style fault,
- 3.2mA for a low diagnostic condition,
- 22mA for an over-range fault,
- gradual drift to simulate sensor degradation or calibration loss.
Why is drift simulation useful?
Drift is useful because not all instrument failures are abrupt. Some failures degrade into bad decisions before they become obvious faults.
A drifting signal can be used to test:
- deviation alarms,
- rate-of-change checks,
- operator alarm thresholds,
- PID stability under bad measurement quality,
- maintenance triggers before hard failure.
What should you observe during analog fault injection?
Observe both logic state and process consequence.
At minimum, verify:
- the raw analog value,
- the scaled engineering value,
- the fault bit,
- the alarm status,
- the permissive/interlock state,
- the equipment response,
- and whether control action is safely blocked.
If a simulated wire break causes the displayed pressure to fall to 0 PSI while the pump remains free to run, the program has not passed validation. It has only passed arithmetic.
What engineering evidence should you keep after building analog scaling logic?
Keep a compact body of engineering evidence. The point is to show reasoning, test method, and revision discipline.
Use this structure:
Define the instrument, range, process role, and controlled equipment. Example: 4-20mA pressure transmitter ranged 0-100 PSI feeding a pump permissive and PID loop.
State what correct behavior means in observable terms. Example: 4mA = 0 PSI, 20mA = 100 PSI, values below 3.6mA latch a fault, inhibit pump auto-start, and generate alarm status.
Record the exact fault forced in simulation. Example: analog signal dropped to 3.2mA or forced to 22mA.
Note what changed after the test. Example: added under-range latch, corrected raw threshold, changed reset logic, or blocked PID enable on fault.
Capture the engineering distinction. Example: “A dead transmitter was initially interpreted as low pressure. After revision, the system distinguishes process minimum from instrument failure.”
- System Description
- Operational definition of correct behavior
- Ladder logic and simulated equipment state Document the implemented scaling, comparator, latch, and interlock logic, plus the expected equipment behavior in simulation.
- The injected fault case
- The revision made
- Lessons learned
Why does analog scaling need both math and fault philosophy?
Analog scaling is not complete until the system distinguishes measurement from measurement failure. The math converts signal into units; the fault philosophy decides what the controller is allowed to believe.
This distinction sits inside broader control-system practice. Functional safety and high-integrity control design are governed by standards such as IEC 61508, but even outside formally safety-related functions, the same discipline applies: bad input quality should not drive uncontrolled output behavior. A loop that fails mathematically correctly can still fail operationally.
Simulation and digital-twin literature also supports testing control logic against realistic dynamic behavior before deployment, especially where abnormal states are difficult or unsafe to reproduce on physical systems. That does not eliminate field commissioning. It can reduce the chance of finding basic logic defects for the first time on live equipment.
Conclusion
To scale a 4-20mA signal correctly, map the valid raw input range to engineering units using linear interpolation. To program it safely, add diagnostic logic that treats under-range and over-range current as instrument faults rather than process values.
That is the practical threshold for useful analog work: not whether the rung compiles, but whether the logic can respond appropriately to a failed transmitter.
If you want to rehearse that distinction, OLLA Lab provides a controlled environment to build the scaling, inject the fault, observe the response, and revise the logic before any live equipment is involved.
Keep exploring
Related Reading
Related reading
Explore the full Ladder Logic Mastery hub →Related reading
Related article 1 →Related reading
Related article 2 →Related reading
Related article 3 →Related reading
Practice this workflow in OLLA Lab ↗