PLC Analog Scaling Calculator
Raw counts ↔ engineering units with verified vendor presets.
preset source: spec/vendor-analog-ranges.md
This tool converts raw PLC analog counts into engineering units and back. Pick a verified module preset or enter any custom raw range, set your engineering range, and the conversion — with percent of span — updates live in both directions.
How it works
Analog input modules digitize their electrical input into an integer raw range; your program then maps counts onto physical units with a straight line: eng = engMin + (raw − rawMin) × span ÷ rawSpan. The calculation is symmetric, so the same tool converts a target engineering value back into the raw count to expect — useful when forcing test values or checking a transmitter against a live PLC tag.
Vendor presets here are gated: a raw range ships only once its manual reference is recorded in the project's spec gate, each citing the module manual it came from. Modules that have not been checked are absent rather than guessed — use the custom range fields for those.
Worked example
raw 13824 → 50.0 (exactly half of 27648)
raw 27648 → 100 · raw 0 → 0
Parameters
| Parameter | Value | Notes |
|---|---|---|
| Siemens S7 | 0 … 27648 | rated analogue range |
| Mitsubishi R60AD4 | 0 … 32000 | 0–10V / 4–20mA · SH-081232ENG |
| Mitsubishi R60AD4 extended | −8000 … 32000 | 4–20mA extended mode |
| AB SLC 1746-NI4 | 3277 … 16384 | 4–20mA input · 1746-UM005B-EN-P |
| LS XGF-AD4S precise | 4000 … 20000 | 4–20mA · XGF-AD4S V1.4 |
| Allen-Bradley | — | pending manual verification |
| Mitsubishi | — | pending manual verification |
| LS ELECTRIC | — | pending manual verification |
| Custom | any raw range | same linear formula |
C implementation
/* Raw PLC counts -> engineering units (linear) */
float plc_scale(long raw, long raw_min, long raw_max,
float eng_min, float eng_max)
{
return eng_min + (float)(raw - raw_min)
* (eng_max - eng_min) / (float)(raw_max - raw_min);
}
/* S7: plc_scale(13824, 0, 27648, 0.0f, 100.0f) -> 50.0f */FAQ
▸What is the Siemens S7 raw range?
S7 analog input modules deliver 0 to 27648 counts for a nominal 0–100 % input signal. Raw 13824 — exactly half of 27648 — therefore scales to 50.0 on a 0–100 range.
▸Why is a preset named after a module rather than a vendor?
Because a raw range belongs to a module and an input range, not to a maker. Mitsubishi's R60AD4 gives 0 to 32000 on a normal 4–20mA range but −8000 to 32000 in extended mode; the SLC 1746-NI4 gives 3277 to 16384 on 4–20mA; and the LS XGF-AD4S lets you pick signed, percentile or precise output per channel, each with its own range. A single number per vendor would be wrong more often than right.
▸What formula does the scaling use?
Plain linear interpolation: eng = engMin + (raw − rawMin) × (engMax − engMin) / (rawMax − rawMin). The reverse direction inverts it and rounds to the nearest integer count.
▸What happens if my raw value is outside the configured range?
The calculator extrapolates linearly and shows a warning. Real modules clip or signal overflow instead, so an out-of-range result usually means the wrong raw range is configured.
▸Is my data uploaded?
No. All scaling runs locally in your browser.