The scaled mA value stays within its selected lower and upper limits after SCALE feeds CLAMP, or after the scaling logic is replaced with LERP. Keep the unclamped reading available for diagnostics so the production value cannot overrun its permitted range without hiding an input fault.
Stop patching SCALE with more comparisons
The usual quick fix adds comparisons, moves, and branches around every scaled analog value. It can restore production, but repeated custom logic creates more places for limits to disagree and more code to inspect during a night-shift fault.
Do not wait for a clamping checkbox in SCALE. The described implementation explicitly does not clamp its actual output. Use one of the instructions already intended for the job:
- Retain
SCALEand placeCLAMPafter it when the existing conversion is correct. - Replace the scaling and manual limiting logic with
LERPwhen scaling with built-in clamping fits the application.
Do not force the raw input to an endpoint before scaling merely to suppress an excessive engineering value. That destroys the distinction between a field signal outside its reference range and a valid signal sitting exactly at the limit.
Check whether SCALE is extrapolating
Read three values in the same scan: the raw analog value, the direct output from SCALE, and the final value consumed by the control logic. Also record the configured input and output reference endpoints.
A linear scale follows this relationship:
scaled = output_low + (input - input_low)
* (output_high - output_low)
/ (input_high - input_low)
When the input moves beyond either reference endpoint, the same line continues beyond the corresponding output endpoint. That is extrapolation, not a failed scaling calculation. Because SCALE does not clamp, an out-of-range current reading can produce an out-of-range engineering value.
If the raw value lies between its reference endpoints but the result is wrong, stop adding clamps. Check endpoint order, endpoint values, the source register feeding the instruction, and the destination used by downstream logic. A clamp can conceal a conversion or addressing error while leaving the process calculation wrong inside the range.
Choose the value that must be limited
Separate measurement evidence from the value allowed to influence control. Retain the raw input and, when useful, the direct scaled result for alarms and maintenance. Send only the clamped result to logic that must stay within defined engineering limits.
| Choice | Use it when | Diagnostic effect | Next action |
|---|---|---|---|
SCALE followed by CLAMP
|
The existing scale conversion is correct and only the final range needs limiting. | The pre-clamp result remains available to show extrapolation. | Insert CLAMP before the first control consumer. |
LERP |
You want scaling and clamping in one scaling function, or need its multi-step linear interpolation. | Keep the original input on a separate diagnostic path. | Replace the old scale and manual clamp logic, then retest every region. |
| No clamp | Downstream logic must see and handle values beyond the reference endpoints. | Full extrapolation remains visible. | Prove every consumer safely handles the extended range. |
A proposed change to SCALE could make lower and upper clamping optional, but that is not the current resolving path described here. Build against the instruction behavior present in the installed programming environment.
Follow the readings through the decision tree
| Check | Reading | Meaning | Go next |
|---|---|---|---|
| 1. Compare raw input with its reference span. | Inside the span | The source should interpolate between the output endpoints. | Check the configured references and destination path. |
| 1. Compare raw input with its reference span. | Outside the span |
SCALE can legitimately extrapolate beyond the output endpoints. |
Decide whether control requires a limited value. |
| 2. Compare the direct scaled result with the linear calculation. | They agree | The scaling stage is behaving as configured. | Add CLAMP or select LERP. |
| 2. Compare the direct scaled result with the linear calculation. | They disagree | The references, data source, destination, or numeric handling needs correction. | Repair the scaling path before clamping. |
| 3. Observe the raw signal while the result is out of range. | The raw signal is physically credible | The process can move beyond the chosen scaling references. | Retain diagnostics and limit only the control-facing value. |
| 3. Observe the raw signal while the result is out of range. | The raw signal is unstable or implausible | Wiring, the transmitter, input configuration, or signal integrity needs inspection. | Correct the measurement fault, then verify the clamp as protection. |
Stop here if the unclamped value could command unsafe motion, heating, pressure, or another hazardous response. Isolate that command path according to the machine procedure before forcing or simulating analog values.
Apply the production fix
- Record the current input references, output references, raw reading, direct scaled result, and required control limits.
- Preserve the raw input in the diagnostic path. Keep the direct
SCALEoutput visible if maintenance needs to identify extrapolation. - For the smallest logic change, connect the
SCALEresult toCLAMP. Configure the required lower and upper output limits in the clamp instruction. - For integrated scaling and clamping, replace the scale and manual limiting statements with
LERP. Enter the same validated reference relationship and configure its clamping behavior through the instruction editor. - Redirect control calculations, indications that require a bounded value, and commands to the final clamped result. Leave diagnostic alarms connected to the appropriate raw or pre-clamp value.
- Search the program for other consumers of the old destination. A correct clamp does nothing for logic that still reads the unclamped tag or register.
Diagnostic path: raw input -> SCALE result
Control path: raw input -> SCALE -> CLAMP -> consumer
Alternative: raw input -> LERP -> consumer
Verify both limits and the fault evidence
Test with an approved simulator, source, or controlled process condition. Do not judge the repair from one normal operating point.
- Apply a value between the input references. Confirm the final value follows the expected linear conversion and is not held at a limit.
- Move toward the lower reference, then beyond it. Confirm the diagnostic value can show the excursion while the control-facing value stops at the selected lower limit.
- Repeat the test at and beyond the upper reference. Confirm the control-facing value stops at the selected upper limit.
- Return to the valid span. Confirm the final value leaves the limit and resumes tracking without requiring a reset.
- Check alarms, trends, interlocks, displays, and control calculations separately. Confirm each one uses either the raw, scaled, or clamped value by design.
If a boundary differs by a small numeric increment, inspect the instruction data types and displayed precision before changing the limits. If the conversion is discontinuous, uses identical input reference points, or changes in the wrong direction, correct the reference configuration instead of masking it with a wider clamp.
FAQ
Can I enable output clamping inside DmD SCALE?
No. The described SCALE behavior does not clamp the actual output; add CLAMP afterward or use LERP for scaling with built-in clamping.
Can I put CLAMP directly after SCALE?
Yes. Route the SCALE result through CLAMP, then make the control logic consume the clamped destination while retaining the pre-clamp result for diagnostics.
Does LERP replace SCALE and manual clamping?
It can. LERP provides multi-step linear interpolation and built-in clamping, so verify its reference configuration across every operating region before removing the old logic.
Does clamping correct an out-of-range mA signal?
No. Clamping limits the value passed downstream; it does not repair a transmitter, wiring, input-configuration, or process-range problem. Diagnose the raw reading independently.
Can I continue if SCALE, CLAMP, or LERP behaves differently?
Stop if the live instruction result disagrees with the configured references or if testing could create an unsafe command. Capture the instruction configuration, raw and destination readings, and installed software version, then escalate through official support. Do not return the command path to service until the discrepancy has been explained and the boundary tests pass.