Resolving S7-300 SM 331 4-20mA Overrange Errors on AI 2x12 bit
1. Problem Description
A field installation using a Siemens SIMATIC S7-300 SM 331 analog input module, part number 6ES7 331-7KB02-0AB0, exhibits an apparent scaling fault on its 4-20 mA current inputs. The module is configured as a 2-wire transducer (2DMU) input and the measuring range sub-module is physically set to position "D" (the 4-20 mA / ±20 mA range).
The two input channels appear at process input words PEW 200 and PEW 202. With a 2-wire vacuum transmitter (0-1100 mbar) connected to channel 0, the following readings are observed in online mode of STEP 7:
| Measured Loop Current | Observed Value (PEW) | Expected Nominal Value | Status |
|---|---|---|---|
| 4.0 mA | ~0 (unverified, channel appears live) | 0 | Within nominal range |
| 12.0 mA | 13824 (interpolated) | 13824 | Nominal |
| 17.1 mA | 29276 | ~22662 | Overrange, 6% above expected |
| 17.2 mA | 32000 | ~22818 | High overrange, near overflow |
| > 23.5 mA (calculated) | 32767 | N/A | Overflow / wire-break / out-of-range marker |
The reading crosses the 27648 nominal maximum well before the loop current actually reaches 20 mA. The S7-300 status convention treats 27649-32511 as the legal overrange and 32512-32767 as an error/overflow band. A value of 32000 is therefore not random: it indicates that the input is being measured in the overrange window with a significant positive offset introduced by the analog front end itself, almost always caused by a floating or improperly bonded reference (MANA / M-) at the module.
2. Module Identification: 6ES7 331-7KB02-0AB0
The SM 331 analog input module in question is a 2-channel, 12-bit resolution module from the S7-300 family. Its salient specifications for this troubleshooting case are summarized below. Refer to the S7-300 Automation System Module Data manual on SiePortal for the complete specification.
| Parameter | Value |
|---|---|
| Order number (MLFB) | 6ES7 331-7KB02-0AB0 |
| Function | SM 331, Analog Input, isolated |
| Number of inputs | 2 (CH0, CH1) |
| Resolution | 12 bits + sign (default 12-bit mode) |
| Configurable ranges | ±10 V, 0-10 V, ±5 V, 0-2 V, ±1 V, 0-20 mA, ±20 mA, 4-20 mA, RTD Pt100/Ni100, TC type J/K/N/E/R/S |
| Galvanic isolation | Yes (between channels and backplane) |
| Measuring range sub-module | 4 plug positions (A, B, C, D) - must match HW config |
| Position "D" meaning | 4-20 mA / ±20 mA (current mode) |
| Update time (per channel) | ~ 25 ms (4-wire) / 85 ms (2-wire with compensation) |
| Diagnostic | Group fault LED, channel-level diagnostic not supported on this variant |
The 7KB02 revision added improved isolation and a faster conversion core versus the older 7KB01, but the front-end terminal layout for the 2-wire transducer (2DMU) is identical to previous variants: the +24 V loop supply and sense resistor are multiplexed based on the sub-module position.
3. Expected S7-300 4-20 mA Scaling
For every Siemens S7 analog input configured in unipolar current mode (0-20 mA or 4-20 mA), STEP 7 maps the input range to a normalized 16-bit signed integer using the following table:
| Real Current | Decimal Value | Status Description |
|---|---|---|
| -∞ to < 0 mA (or < 4 mA in 4-20 mA mode) | -32768 (0x8000) | Underrange / open wire |
| 0 mA (0-20 mA mode only) | 0 | Nominal zero |
| 4 mA (4-20 mA mode) | 0 | Nominal zero (live zero) |
| 20 mA | 27648 | Nominal end |
| 22.96 mA (overrange, 4-20 mA mode) | 32511 | Overrange end |
| > 22.96 mA or open wire | 32767 | Overflow / error |
The linear transfer function for the 4-20 mA range is therefore:
PEW = ((I_loop - 4) / 16) × 27648
I_loop = (PEW / 27648) × 16 + 4
Worked example: at 17.1 mA, the expected PEW = ((17.1 - 4) / 16) × 27648 = 0.8188 × 27648 = 22,641. The field reading of 29,276 is therefore 29.3% above the expected value, which cannot be attributed to tolerance, RTD self-heating, or 12-bit quantization (the LSB step at 20 mA is 4.4 µA, so quantization error is < 0.1% of span).
4. Root Cause: Floating MANA Reference (Ground Loop at the Front End)
The most common reason an S7-300 SM 331 returns readings above 27648 at sub-nominal current is that the analog reference, the MANA terminal (terminal 11 on the front connector), is not bonded to the system ground at the same potential as the 2-wire transmitter's return path. When MANA floats, the input op-amp at the module's front end sees an undefined common-mode voltage. This voltage is added in series with the sense resistor, and the resulting offset is amplified through the same 12-bit ADC used for the signal itself.
The mathematical effect of a floating MANA is:
PEW_measured = (I_loop + I_offset(V_CM,R_Leakage,C_Parasitic)) × 27648 / 16 + 4
Where V_CM is the un-bonded common-mode voltage between the transmitter's loop return and the chassis ground of the SM 331, typically induced by capacitive coupling from adjacent 400 V cables, VFD output conductors, or ungrounded cable shields. The displacement current I_offset is in the order of 0.1 to 5 mA, which matches the field observation of 29276 at 17.1 mA (an apparent extra 1.6 mA / 105% of reading) and 32000 at 17.2 mA (an apparent extra 3.4 mA / 119% of reading).
Two further failure modes present the same symptom and must be ruled out before assuming a floating MANA:
- Sub-module position mismatch: If the measuring range sub-module (the small insert on the left side of the module) is set to position A/B/C (voltage) but the HW Config in STEP 7 reports the channel as 4-20 mA, the module drives the wrong front-end path and may report 30,000+ for any positive current. Always verify that the sub-module letter matches the HW Config measurement type and range.
- 4-wire transmitter wired to 2-wire terminal pair: If a 4-wire active sensor (separate +24 V supply and signal output) is connected to the 2DMU terminals (terminals 2/3 on CH0), the module's internal 24 V source fights the sensor's own loop supply, producing a current that exceeds the nominal 20 mA and the reading will saturate to 32767. Per the S7-300 Module Data manual, the 2-wire transducer (2DMU) is the only configuration that expects terminals 2(+) and 3(-) of the channel in question.
5. Hardware Configuration: The Measuring Range Sub-Module
The SM 331 uses a small insertable sub-module (often called the "measuring range module") on the left side of the module body. This sub-module selects the input front-end gain, filter, and terminal routing. For the 6ES7 331-7KB02-0AB0 the four positions are:
| Position | Type | Use |
|---|---|---|
| A | Voltage / RTD / TC | All voltage, thermocouple, and 4-wire RTD ranges |
| B | Voltage (low) | ±1 V, ±5 V, 0-1 V, etc. |
| C | Current (passive) | 4-20 mA from an externally powered sensor (4-wire sensor) |
| D | Current (active loop) | 4-20 mA from a 2-wire sensor, loop-powered by module |
If the sub-module is set to C instead of D, the module does not source the 24 V loop supply, the 2-wire sensor does not power up, the current stays at or below 4 mA, and the value will read close to 0 (or 32767 if open-circuit). If the sub-module is set to A or B and the channel is misconfigured to "4-20 mA" in HW Config, the front-end network presents a high impedance to a current source, and small leakage on the ungrounded input can produce 28000-32000 readings on an open terminal.
D. The HW Config in STEP 7 must also show 2DMU (2-wire transducer) under Properties > Inputs > Measurement type for that channel.6. Wiring Correction for the 2-DMU 2-Wire Sensor
For a 2-wire, loop-powered 4-20 mA sensor (the vacuum transmitter in this case), the SM 331 manual specifies the following terminal assignment on the 20-pin front connector. This is the authoritative wiring for the 6ES7 331-7KB02-0AB0 with sub-module in position D, channel CH0:
| Front Connector Terminal | Function (CH0) | Connection |
|---|---|---|
| 1 | CH1 + | Sensor 2 + (if used) |
| 2 | CH0 + (loop supply +24 V out) | Sensor 1 + (transmitter +) |
| 3 | CH0 - (sense return) | Sensor 1 - (transmitter -) |
| 4 | CH1 - (sense return) | Sensor 2 - (if used) |
| 5 | M (chassis / shield bond point) | Cable shield, ONE end only |
| 10 | Comp+ (internal compensation, leave NC for 4-20 mA) | Not connected for current |
| 11 | Comp- / MANA (analog ground reference) | MUST be bonded to M (terminal 5) |
For a 2DMU loop, the only two terminals that carry signal are 2 (+) and 3 (-). Terminal 11 is the analog ground and must be bonded to terminal 5 (chassis / shield bond). If terminal 11 is left floating, the input op-amp has no defined common-mode reference, and the symptom described in the field report (readings above 27648 with sub-nominal loop current) appears.
7. Step-by-Step Resolution Procedure
Execute the following steps in order. Each step is independently verifiable and isolates one layer of the fault path.
Step 1 - Lock out and de-energize
- Place the S7-300 in STOP mode from the programming device, or use the mode selector to RUN-to-STOP.
- Isolate the 24 VDC supply feeding the analog input loop and the module's L+ terminal.
- Verify zero energy with a calibrated multimeter at the front connector.
Step 2 - Verify the sub-module position
- Unclip the front connector from the SM 331.
- Slide the module out of the rack by ~ 5 cm.
- Read the sub-module letter on the left side of the module. It must be
Dfor 4-20 mA, 2-wire. - If the sub-module is not in D, reposition it, and re-seat the module.
Step 3 - Rebuild the wiring per the manual
- Strip and re-terminate the sensor cable on a NEW 20-pin front connector (do not reuse the suspect one).
- Connect terminal 2 to the transmitter + (red lead).
- Connect terminal 3 to the transmitter - (black lead).
- Connect terminal 11 (MANA) directly to terminal 5 (M / shield bond).
- Leave terminal 10 (Comp+) unconnected for current mode.
- Bond the cable shield at the panel gland, do not bond at the sensor end (avoids shield ground loops).
Step 4 - Re-verify HW Config in STEP 7
- Open HW Config in STEP 7 (V5.x or TIA Portal, depending on the project).
- Double-click the SM 331 entry in slot 4 (or wherever it is placed).
- Open Properties > Inputs.
- Confirm
Measurement type = 2DMU(2-wire transducer). - Confirm
Measuring range = 4 - 20 mA. - Save, recompile, and download the HW Config to the CPU.
Step 5 - Power up and verify loop current
- Re-energize the 24 VDC supply to L+ and the analog loop.
- Switch the CPU to RUN.
- Place a calibrated multimeter in SERIES in the loop (break the wire at terminal 3 and insert the meter in mA mode).
- Read the actual loop current. For a 0-1100 mbar transmitter at atmospheric pressure, expect ~ 4 mA. For full vacuum, expect ~ 20 mA.
- Go online and monitor
PEW 200. It should now scale as 0 to 27648 across the 4-20 mA range.
Step 6 - Add a normalization check in the PLC program (optional)
Add a sanity check that flags any PEW value above 27648 and below 0 as a wiring or sensor fault. Use a simple comparator:
// STL / SCL example for S7-300
L PEW 200 // Load the analog input
L 27648 // Compare against nominal max
>I // Greater than? (CC1 = 1 if yes)
= M 100.0 // Set "overrange" marker bit
L PEW 200
L 0
<I // Less than zero?
= M 100.1 // Set "underrange" marker bit
L PEW 200
L 0
==I // Equals zero? (could be 4 mA or wire break)
= M 100.2 // Set "live zero / wire break" marker bit
Wire these markers to the HMI or to the SCADA alarm log so a similar fault in the future is reported in seconds, not at the next calibration visit.
8. Verification Procedure
After applying the correction, perform the following calibration verification to confirm the module is in spec. Use a precision mA source (e.g., Beamex MC6, WIKA CPB5000, or a Fluke 754 with the appropriate module) or a 24 V loop supply with a high-precision decade resistor. Do not rely on the field transmitter for verification - the sensor itself can drift, and you want to verify the module first.
| Injected Current (mA) | Expected PEW | Acceptable Range (PEW) |
|---|---|---|
| 4.000 | 0 | -50 to +50 |
| 8.000 | 6912 | 6850 to 6974 |
| 12.000 | 13824 | 13750 to 13898 |
| 16.000 | 20736 | 20650 to 20822 |
| 20.000 | 27648 | 27550 to 27746 |
| 22.960 (overrange) | 32511 | 32511 to 32511 (must read full overrange) |
If any reading falls outside the acceptable range, the module is faulty and should be replaced with a new 6ES7 331-7KB02-0AB0. The diagnostic event log will also record a "channel fault" for the affected channel. To view this in STEP 7, open the CPU's diagnostic buffer (PLC > Module Information > Diagnostic Buffer) and look for event ID 0x0502 or 0x0503 shortly after power-up.
9. Related Failure Modes on Other SIMATIC Platforms
The floating-reference symptom is not unique to the S7-300. The same physical phenomenon appears on S7-1200 and S7-1500 systems when the analog common (M on the SM 1231, or the M terminal on the AQ module) is not bonded to the supply 24 V return, or when two analog sensors are powered from different supplies (for example, one from the PLC's 24 VDC sensor supply and one from an external 12 VDC wall adapter). The two rails then develop a few hundred millivolts of potential difference, which the analog front end treats as an offset current.
Symptom signature on S7-1200/S7-1500:
- One or more channels read negative when no signal is applied, or read 32000-32767 at low signal.
- The diagnostic event log records "Analog input wire break" or "Overrange" on channels that are physically intact.
- Replacing the analog module does not resolve the issue; the issue follows the field wiring.
Field-proven fix: tie all analog commons (MANA, M, sensor 0 V, transmitter 0 V) to a single point, the panel-side 24 V return, and only at one point. Do not bond analog common to earth, do not bond to chassis at multiple points, and do not let cable shields carry the return current.
10. Field Commissioning Checklist
Use this checklist on every SM 331 installation that exhibits out-of-range readings. Each item is a single-pass test.
- Sub-module letter matches the HW Config measurement type (D for 4-20 mA 2DMU).
- Terminal 11 (MANA) is bonded to terminal 5 (M / shield bond) on the front connector.
- Terminal 10 (Comp+) is left unconnected for current ranges.
- Sensor + is on terminal 2 (CH0) or 1 (CH1).
- Sensor - is on terminal 3 (CH0) or 4 (CH1).
- Loop current verified with a series ammeter at 4 mA, 12 mA, and 20 mA points.
- PEW value tracks loop current within ± 0.3% of span.
- Diagnostic buffer is free of
0x0502,0x0503, or wire-break events. - Cable shield is bonded at the panel gland only, not at the sensor end.
- PLC program includes an overrange and underrange alarm on the analog word.
11. Frequently Asked Questions
What does a PEW value of 32767 on a Siemens S7-300 AI mean?
It indicates an overflow condition, usually caused by an open wire, a current > 22.96 mA, or a faulty input stage. Check the wiring, the sub-module position, and the loop current. A value of 32767 is not a valid measurement; the real input is out of range.
Is it normal for the SM 331 to report values above 27648?
Yes, the legal overrange is 27649 to 32511. Values in this band indicate the loop current is between 20 mA and 22.96 mA. Any value above 32511 is an error (overflow) and should be treated as a fault.
Do I need to bond terminal 10 (Comp+) for 4-20 mA inputs?
No. Terminal 10 is used for thermocouple cold-junction compensation and RTD 4-wire compensation. For current ranges (4-20 mA, 0-20 mA), terminal 10 should be left unconnected.
Can I use a 4-wire active sensor with the 6ES7 331-7KB02-0AB0 in 2DMU mode?
No. The 2DMU mode assumes a 2-wire loop-powered sensor. For 4-wire sensors, use the 4DMU configuration, which expects the sensor's +24 V to come from an external supply and the signal return to come in on the channel's M terminal. Wire a 4-wire sensor to a 2DMU input and you will either read 0 mA (sensor not powered) or damage the module's internal loop supply.
Why does the field report show 32000 at 17.2 mA?
32000 is in the overrange band (27649-32511). It indicates the input is being measured as if it were above 20 mA, with a positive offset of ~ 3.4 mA. The offset is the leakage/displacement current induced by a floating MANA reference. Bonding terminal 11 to terminal 5 brings the reference to the correct potential and the reading returns to ~ 22,818 for 17.2 mA, which is the correct nominal value.
Does this apply to the newer 6ES7 331-7KF02-0AB0 (8-channel) version?
The terminal layout differs (the 8-channel variant uses a 40-pin connector), but the floating-MANA fault mode is identical. Bonding the analog common terminal to chassis ground at one point is mandatory on every SM 331 variant that supports 2DMU current input.