Table of Contents
TogglePLC · Analog Scaling · 4-20 mA · Raw Count
PLC Analog Scaling and Raw Count Explained: Formula, Calculator and PLC Brand Reference
A complete plain-English guide to PLC analog input scaling: what raw counts are and why they exist, the linear scaling formula derived step by step, the reverse formula, resolution calculation, raw count ranges for Siemens S7-1200/1500 and Allen-Bradley, NAMUR NE43 fault zones in raw counts, and a bidirectional interactive calculator with PLC presets.
When a pressure transmitter sends 12 mA to a PLC analog input card, the PLC does not receive the number 12. It receives a number like 13824. That number is the raw count: the output of the analog-to-digital converter (ADC) inside the analog input module. Every 4-20 mA signal, every 0-10 V signal and every thermocouple millivolt input arrives in the PLC as a raw count first. Everything you see on an HMI (4.5 bar, 250 m³/h, 82°C) was originally a raw count that was scaled into engineering units by the PLC program.
Wrong scaling is one of the most common and most expensive errors in PLC commissioning. A technician who confuses the raw count range of a Siemens S7-1200 (where the low end starts at 5530, not 0) with an Allen-Bradley ControlLogix (where it starts at 0) will get a process reading that is wrong by up to 20% at low signal values, even though every wire in the system is correct. Understanding raw counts from first principles prevents this class of error entirely.
This guide explains analog scaling from the ground up: what an ADC is, why different PLC brands produce different raw count ranges, the complete linear scaling formula with derivation and worked examples in both directions, how to calculate the resolution of a scaling in engineering units per count, the NAMUR NE43 fault zones translated into raw counts for each major PLC platform, and an interactive bidirectional calculator with one-click presets for Siemens S7-1200, S7-1500 and Allen-Bradley. For context on the 4-20 mA signal that feeds the PLC input, see our guide on the 4-20 mA current loop explained.
What Is a Raw Count and Why Does a PLC Use One?
A 4-20 mA current loop carries an analog electrical signal. The PLC's analog input module contains an analog-to-digital converter (ADC) that samples this current many times per second and converts each sample into a binary digital number. This binary number is called the raw count.
The reason PLCs use raw counts instead of directly storing the mA value is straightforward. Processors work with integers. An ADC with 16-bit resolution produces integers from 0 to 65535 (2¹⁶ = 65536 possible values). A 12-bit ADC produces integers from 0 to 4095. These integers are the native language of the processor. Converting them to a floating-point mA value before the PLC program even sees them would waste CPU time and add an unnecessary intermediate conversion step. Instead, the PLC stores the raw integer and lets the programmer scale it to whatever engineering unit the application requires.
Figure 1: Complete signal chain from field transmitter to HMI display. The ADC inside the AI module converts the 4-20 mA current into a raw integer count. The PLC scaling formula then converts that raw count into the engineering unit value that appears on the HMI and drives control logic.
Raw Count Ranges by PLC Brand: Why They Are Different
Different PLC manufacturers chose different ADC resolutions and different conventions for mapping the 4-20 mA signal range to raw counts. This means the same 12 mA signal produces a completely different raw count number depending on which PLC you are using. Getting this wrong is the single most common cause of scaling errors in multi-brand plants or when technicians work across different PLC families.
| PLC Platform | Signal type | Raw Min (0% / 4 mA) | Raw Max (100% / 20 mA) | Usable span | ADC bits used |
|---|---|---|---|---|---|
| Siemens S7-1200 | 4-20 mA (AI module) | 5530 | 27648 | 22118 counts | 15-bit effective (0-27648 range) |
| Siemens S7-1500 | 4-20 mA (AI module) | 0 | 27648 | 27648 counts | 15-bit effective (0-27648 range) |
| Siemens S7-300/400 | 4-20 mA (AI module) | 0 | 27648 | 27648 counts | 15-bit effective (0-27648 range) |
| Allen-Bradley ControlLogix / CompactLogix | 4-20 mA (1756-IF16) | 0 | 32767 | 32767 counts | 15-bit (0 to 32767) |
| Allen-Bradley Micro820 / MicroLogix | 4-20 mA | 0 | 4095 | 4095 counts | 12-bit (0 to 4095) |
| Siemens all platforms (over-range diagnostic) | 4-20 mA extended | -6912 | 32511 | Includes under-range and over-range diagnostic zones | Extended range |
The Linear Scaling Formula: Derivation and Use
PLC analog scaling uses a simple linear (proportional) relationship between the raw count range and the engineering unit range. The formula comes directly from the equation of a straight line (y = mx + c) applied to the two coordinate pairs (RawMin, EngMin) and (RawMax, EngMax).
Where:
Raw = current raw count from PLC AI register
RawMin = raw count at 0% of range (4 mA for 4-20 mA)
RawMax = raw count at 100% of range (20 mA for 4-20 mA)
EngMin = engineering value at 0% (LRV of transmitter)
EngMax = engineering value at 100% (URV of transmitter)
EU = calculated engineering unit value
Simplified form: EU = (Raw - RawMin) x Span_EU / Span_Raw + EngMin
Where:
Span_EU = EngMax - EngMin
Span_Raw = RawMax - RawMin
Or equivalently:
Raw = (EU - EngMin) x Span_Raw / Span_EU + RawMin
Use the reverse formula when:
- You need to write a raw count to an AO module to output a specific mA signal
- You need to verify: given a known process value, what raw count should the AI be showing?
- You are testing DCS/PLC software with simulated raw count inputs
Example: Siemens S7-1500, pressure transmitter 0-10 bar
Resolution = (10 - 0) / (27648 - 0) = 10 / 27648
Resolution = 0.000362 bar per count (0.362 mbar per count)
This means the PLC can distinguish pressure differences as small as 0.362 mbar. A 12-bit ADC (AB Micro820, Raw 0-4095) gives: Resolution = 10 / 4095 = 0.00244 bar per count (2.44 mbar per count) The S7-1500 is 6.75 times more precise at this pressure range.
PLC Analog Scaling Calculator: Bidirectional with PLC Presets
Select a PLC preset to load the correct raw count range automatically, then enter your process engineering range and either a raw count or an engineering value to convert in either direction.
PLC Preset (loads raw count range)
Worked Examples: Three Common Applications
Example 1: Pressure Transmitter on Siemens S7-1500
EU = 5.000 bar (exactly 50% of range, equivalent to 12.00 mA)
Verification: 4 + (13824/27648) x 16 = 4 + 8.000 = 12.000 mA. Correct.
Resolution = 10 / 27648 = 0.000362 bar per count (0.362 mbar)
Example 2: Flow Transmitter on Allen-Bradley ControlLogix
EU = 125.0 m³/h (25.0% of range, equivalent to 8.00 mA)
Resolution = 500 / 32767 = 0.01526 m³/h per count (15.3 litres/h per count)
Example 3: Temperature Transmitter on Siemens S7-1200 (the tricky one)
EU = 99.99°C (approximately 50.0% of range, equivalent to 12.00 mA)
WRONG result if Raw Min = 0 used by mistake: EU = (16589 / 27648) x 200 = 120.0°C (20°C too high!)
This is the exact error that occurs when a technician uses S7-1500 parameters on an S7-1200 installation. Always confirm Raw Min = 5530 for S7-1200 4-20 mA inputs before scaling.
Example 4: Reverse scaling: writing to an AO module (EU to Raw)
Raw = 20736 (write this integer to the AO DAC register)
Verification: EU = (20736 / 27648) x 100 = 75.00%. Correct.
Equivalent mA = 4 + 0.75 x 16 = 16.00 mA. Correct.
NAMUR NE43 Fault Zones Translated to Raw Counts
The NAMUR NE43 standard defines the signal ranges that indicate fault conditions in 4-20 mA loops. These correspond to specific mA values: below 3.6 mA is a hard fault (wire break or sensor failure) and above 21.0 mA is an over-range fault. The table below converts these mA boundaries into raw counts for each major PLC platform, so you know exactly which raw count values should trigger fault alarms in your PLC program.
| NAMUR NE43 zone | mA range | S7-1200 raw counts | S7-1500 raw counts | AB ControlLogix raw counts | Meaning |
|---|---|---|---|---|---|
| Hard fault / wire break | Below 3.6 mA | Below 4529 | Below -1104 | Below -1229 | Transmitter failure, broken wire or loss of loop power |
| Low alarm saturation | 3.6 to 3.8 mA | 4529 to 5082 | -1104 to -552 | -1229 to -614 | Measurement below LRV or sensor burnout (downscale) |
| Normal operating range | 4.0 to 20.0 mA | 5530 to 27648 | 0 to 27648 | 0 to 32767 | Valid process measurement. PLC scaling applies normally. |
| High alarm saturation | 20.0 to 21.0 mA | 27648 to 29325 | 27648 to 29325 | 32767 to 34714 | Measurement above URV or sensor burnout (upscale) |
| Hard fault over-range | Above 21.0 mA | Above 29325 | Above 29325 | Above 34714 | Transmitter failure, short circuit in loop or sensor damage |
PLC Internal Scaling vs External Raw Count Calculator
| Aspect | PLC Internal Scaling Blocks (NORM_X/SCALE_X, SCP) | External Raw Count Calculator |
|---|---|---|
| Where it runs | Inside PLC CPU, every scan cycle | Outside PLC, on engineer's laptop or phone |
| Purpose | Real-time conversion during plant operation | Verification, commissioning checks, training and troubleshooting |
| Requires PLC connection | Yes: needs online access to read live values | No: works offline with any raw count value |
| Formula visibility | Hidden inside instruction block. Parameters must be opened to see. | Fully visible. Every step of the calculation is shown. |
| Fault detection | Possible but requires additional logic blocks | Built-in NAMUR status check on every conversion |
| Reverse scaling | Requires separate instruction or custom code | Direct, same interface |
| Multi-brand | Each brand has its own instruction set | One calculator handles all brands via preset selection |
| When to use | Production operation: always | Design, commissioning, FAT, troubleshooting: always |
Common Scaling Mistakes and How to Avoid Them
| Mistake | What goes wrong | How to prevent it |
|---|---|---|
| Using Raw Min = 0 on Siemens S7-1200 | At 4 mA (empty tank, zero pressure), the EU value shows negative instead of zero. The error grows at low signal levels and can be 20% wrong at 5 mA. | Always use Raw Min = 5530 for 4-20 mA inputs on S7-1200. Confirm the raw count range from the module manual (ET200SP AI module datasheet). |
| Confusing AB 15-bit (32767) with Siemens (27648) | Using AB parameters on a Siemens system (or vice versa) introduces a constant ratio error of 32767/27648 = 18.5%. At 50% signal, the reading will be 9.25% wrong. | Always confirm the PLC brand and specific module used. Create a site engineering standard that lists Raw Min and Raw Max for every AI/AO module type used on site. |
| Not checking fault zones before scaling | A broken wire gives a raw count of 0 on S7-1500. The scaling formula converts this to a negative pressure value. The DCS displays -0.36 bar. Operator assumes transmitter is working at slightly below zero rather than recognising a wire break. | Add raw count range checks before every scaling block. If raw is outside [Raw Min, Raw Max], set a fault bit and hold the last good value or substitute a fail-safe value. |
| Applying the wrong formula for AO modules | The raw-to-EU formula is used to write to an AO register instead of the EU-to-raw formula. The AO output is completely wrong. | Remember: AI modules produce raw counts (read with raw-to-EU formula). AO modules accept raw counts (write with EU-to-raw formula). They are inverses of each other. |
| Ignoring transmitter suppressed zero ranges | A flow transmitter with LRV = 100 m³/h (not zero) has EngMin = 100, not 0. Using EngMin = 0 makes the display read 0 when the actual flow is 100 m³/h. | Always read the instrument datasheet or HART configuration for the actual LRV and URV. Do not assume LRV = 0. |
Further Reading and External Resources
- Siemens Industry Online Support: Analog Input Module Representation of Measured Values. Official Siemens documentation covering the raw count range (0 to 27648), diagnostic ranges and NORM_X/SCALE_X instruction use for S7-1200 and S7-1500.
- Rockwell Automation: ControlLogix Analog I/O Modules User Manual. Official Allen-Bradley documentation for 1756-IF16 and related AI modules covering the 0 to 32767 raw count convention and SCP instruction.
- NAMUR NE43: Standardisation of the Signal Level for the Failure Information of Digital Transmitters. The international standard that defines the 3.6 mA and 21.0 mA fault signal limits in 4-20 mA loops.
- AutomationForum: PLC Raw Count Calculator and Scaling Guide. The reference article that inspired this guide, with additional examples from a respected industrial automation knowledge base.
Frequently Asked Questions: PLC Analog Scaling and Raw Counts
- 4-20 mA Signal Conversion: Percentage to mA Calculator and Formula
- 4-20 mA Current Loop Explained: How It Works, Wiring and Troubleshooting
- Analog vs Digital Signals in Instrumentation: A Complete Guide
- Modbus Protocol Explained: RTU vs TCP
- Instrument Loop Checking: A Complete Step-by-Step Procedure
- HART Protocol: How It Works and How to Use a HART Communicator
What we learn today
- A raw count is the integer output of the ADC inside a PLC AI module. The scaling formula EU = ((Raw - RawMin) / (RawMax - RawMin)) x (EngMax - EngMin) + EngMin converts raw counts to engineering units. The reverse formula Raw = ((EU - EngMin) / (EngMax - EngMin)) x (RawMax - RawMin) + RawMin converts engineering values to raw counts for AO modules and verification.
- Raw count ranges differ by PLC brand: Siemens S7-1500 uses 0 to 27648 for 4-20 mA. Siemens S7-1200 uses 5530 to 27648 (4 mA = 5530, NOT 0). Allen-Bradley ControlLogix uses 0 to 32767. Using the wrong Raw Min is the single most common cause of scaling errors at the low end of the signal range.
- Resolution = (EngMax - EngMin) / (RawMax - RawMin). Siemens (27648 counts) and Allen-Bradley (32767 counts) both provide fine resolution. 12-bit modules (4095 counts) are six times coarser. Always calculate resolution for your application to confirm the module can resolve small process changes that matter for control or alarm purposes.
- NAMUR NE43 defines 3.6 mA (under-range fault) and 21.0 mA (over-range fault) as boundaries. Always add raw count range checks in the PLC program BEFORE the scaling block. If raw count is outside the normal range, set a fault flag and hold the last good value rather than scaling a fault condition into a false engineering unit reading.
