Wiring Siemens 6ES7331-7KF02-0AB0 SM331 for 2-Wire 4-20mA Inputs

David Krause16 min read
S7-300SiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Wiring Siemens 6ES7331-7KF02-0AB0 SM331 for 2-Wire 4-20mA Inputs

The SIMATIC S7-300 SM331 analog input module with order number 6ES7331-7KF02-0AB0 (AI8x12Bit) is one of the most widely deployed AI modules in S7-300 racks. Its flexibility comes from four plug-in measuring range modules on the side of the housing, one per channel group, that mechanically set the input type (voltage, current, RTD, or thermocouple) and the wiring topology (2-wire vs. 4-wire). Misconfiguring those switches is the single most common cause of an out-of-range, pegged, or dead channel when a field device is connected.

This article documents the correct wiring of a 2-wire, loop-powered 4-20 mA pressure transmitter to the SM331, including the rules that govern when you must use position C (4-wire) instead of position D (2-wire) and when an external signal isolator becomes mandatory.

Reference documentation: Siemens support entry ID 8859629, "6ES7331-7KF02-0AB0 – SIMATIC S7-300 / S7-300 Analog modules". Always cross-check the wiring diagram shipped with your specific module revision. See Siemens support ID 8859629.

1. Module Identification and Channel Topology

The 6ES7331-7KF02-0AB0 is the 8-channel, 12-bit resolution variant of the SM331 family. Its eight inputs are arranged in four channel groups of two channels each:

Channel Group Input Channels Measuring Range Module Slot Default Position (ex-factory)
Group 0 CH0, CH1 Slot A (left side of module) A (voltage, ±10 V)
Group 1 CH2, CH3 Slot B A (voltage, ±10 V)
Group 2 CH4, CH5 Slot C A (voltage, ±10 V)
Group 3 CH6, CH7 Slot D A (voltage, ±10 V)

Each measuring range module is a small PCB inserted into a guide slot on the left side of the module. It is keyed to four positions (A, B, C, D), and the same physical position selects both the measurement type and the wiring topology for both channels in that group. The setting is read by the module's microcontroller and the value is also reported to the CPU in the diagnostic buffer if it disagrees with the STEP 7 hardware configuration.

Keying rule: positions A and B are voltage / RTD / TC ranges, position C is 4-wire current (0/4-20 mA with external transmitter supply), and position D is 2-wire current (4-20 mA with module-supplied loop power).

2. Measuring Range Module Positions – Detailed Function

The mechanical position of the measuring range module is the source of truth at runtime. The setting you enter in STEP 7 / TIA Portal under "Measuring range" must match the physical switch, or the module will return a wire-break or overrange diagnostic and the analog value will read 7FFF16 (overflow) or 800016 (wire break in 4-20 mA mode).

Position Measurement Type Wiring Topology Input Impedance Loop Power Source
A Voltage ±10 V (also ±5 V, 0-10 V, 1-5 V via STEP 7 scaling) 2-, 3-, or 4-wire sensor passive to module ~100 kΩ Sensor / external
B Voltage ±1 V / ±500 mV / ±80 mV; RTD Pt100/Ni100; TC type J, K, etc. 2-, 3-, or 4-wire passive ~10 MΩ (TC) / RTD bridge Module supplies RTD excitation current
C Current 0-20 mA or 4-20 mA 4-wire transmitter (external powered) ~250 Ω sense resistor External 24 V DC supply on the field device
D Current 4-20 mA only (no 0-20 mA) 2-wire transmitter (loop powered) ~250 Ω sense + current source Module supplies 24 V DC loop power from the backplane / load voltage

Position D is the only setting that converts the SM331 into an active 4-20 mA current source and sinks the loop through its internal sense resistor. Position C is a strictly passive current sink at the input terminals; it does not energize the loop.

3. 2-Wire vs 4-Wire Transmitter Fundamentals

A 2-wire (loop-powered) transmitter uses the same pair of wires that carry the 4-20 mA signal to also receive its operating power. The current drawn by the transmitter is the measurement variable. A typical 2-wire pressure transmitter has only two terminals: + and -, and the loop is completed through the AI module's internal 24 V supply and sense resistor.

A 4-wire (externally powered) transmitter has separate pairs for power supply and signal output. It produces a regulated 4-20 mA output sourced by an internal amplifier; the AI module only needs to provide a low-impedance return path for the current. The transmitter is electrically independent of the analog input.

Property 2-Wire Transmitter 4-Wire Transmitter
Field-side power None required (loop-powered) Requires external 24 V DC (±10%) on dedicated terminals
Signal direction at output Modulates loop current Sourcing current output (active)
Required AI input type Active 2-wire input (SM331 position D) or passive 4-wire input (position C) Passive 4-wire input (SM331 position C)
Typical current draw at 24 V 3.5 to 22 mA total (signal + quiescent) 20 mA signal + separate 30-100 mA supply current
Voltage at transmitter terminals 12 to 30 V (must leave 12 V for headroom) Independent of signal loop
Wire count to field 2 conductors + shield 4 conductors (2 power, 2 signal) + shield

4. The Compatibility Rule – Why the Position Matters

The fundamental rule when interconnecting a transmitter and an AI module is that two active current sources cannot be placed in the same series loop. Doing so results in contention, out-of-range readings, possible damage to one or both devices, and is detected by the SM331 as a wire-break or overflow.

Transmitter Output AI Module Position Result Remediation
2-wire (passive, loop-powered) D (2-wire, module supplies loop) Works – correct configuration None
2-wire (passive, loop-powered) C (4-wire, passive sink) Works only if loop is closed through an external 24 V source in series with the input Use position D, or add external loop supply
4-wire (active, sourced output) D (2-wire, module is active source) Fails – two active sources in series Switch module to position C, or insert passive isolator
4-wire (active, sourced output) C (4-wire, passive sink) Works – correct configuration None

In short: a 2-wire transmitter can be connected to a 4-wire AI input, but a 4-wire transmitter cannot be connected to a 2-wire AI input without an isolator. This is the central rule that determines whether to move the measuring range module from position D to position C.

5. Prerequisites for Wiring a 2-Wire 4-20 mA Pressure Transmitter

  1. Confirm the transmitter type. Inspect the data sheet: 2-wire pressure switches and pressure transmitters list a single pair of signal terminals and a supply voltage of typically 12-30 V DC. If the device also lists dedicated power terminals (often labeled P+ / P- or V+ / V-), it is a 4-wire device.
  2. Verify the available conductors in the field cable. The user in the source case had only one free core carrying 4-20 mA. This is consistent with a 2-wire transmitter whose loop is already closed by a 24 V source elsewhere in the circuit (e.g., a barrier or another AI module). For a direct connection to the SM331, you need exactly two cores plus a shield drain.
  3. Set the measuring range module to position D for the channel group that will accept the 2-wire transmitter. Slot D corresponds to channels 6-7 on the 6ES7331-7KF02-0AB0.
  4. Verify the load voltage (L+) on the backplane. The SM331 draws loop power for 2-wire mode from the S7-300 backplane load voltage (terminals L+ / M on the power supply module, typically 24 V DC). Without this voltage, 2-wire transmitters read 0 mA.
  5. Configure STEP 7 / TIA Portal accordingly. In HW Config set the channel to "4-wire current" measurement type only if the measuring range module is in position C. If the module is in position D, set the channel to "2-wire current". A mismatch generates a parameter assignment error on the CPU diagnostic buffer.

6. Step-by-Step: Connecting a 2-Wire Transmitter (Position D)

  1. De-energize the S7-300 rack and remove the 20-pin front connector from the SM331. Note the connector keying (color code 1-20) to maintain polarity convention.
  2. Reposition the measuring range module for the appropriate channel group. The slot is on the left side of the module, accessible after the door is opened. Slide the small PCB out, rotate so the arrow points to "D", and re-insert until it clicks.
  3. Wire the field cable to the front connector terminals. On the 6ES7331-7KF02-0AB0, each channel group uses two terminal pairs. For channels 6-7 (group 3, position D):
    • Terminal 1 = M+ of CH0 (group 0) — not used here
    • Terminal 2 = M- of CH0 — not used here
    • ...continuing the standard pinout...
    • For a 2-wire transmitter connected to CH6, route the + wire of the transmitter to terminal 15 (CH6+ in position D) and the - wire to terminal 16 (CH6- / Mana).
  4. Connect the shield drain to the shield bar of the S7-300 subrack on at least one end, ideally both ends through a 1 nF / 1 MΩ parallel network for HF grounding while maintaining DC isolation.
  5. Reinstall the front connector and torque the mounting screws.
  6. Restore power and observe the channel in STEP 7 online: open the AI module's variable table and read PIW. A healthy 2-wire loop with the transmitter at 0% pressure should read approximately 4 mA, equivalent to a STEP 7 raw value of 0. At 100% pressure, the raw value should reach 27648 (0-20 mA scaled range) or 27648 (4-20 mA scaled range, with 0 mapped to 4 mA).
Important wiring convention: on the SM331 front connector, the terminal labeled Mana (analog ground of the channel group) is the negative return for the 4-20 mA signal in both position C and position D. The terminal labeled M+ or CH+ is the positive side, which the module internally ties to the backplane L+ in position D.

7. Step-by-Step: Using Position C (4-Wire Mode) Universally

If the panel mix includes both 2-wire and 4-wire transmitters and the channel groups cannot be re-keyed to match, the safer practice is to set all four measuring range modules to position C and provide loop power externally. In position C the SM331 input is a passive current sink (~250 Ω to internal ground), so it accepts the output of any 2-wire or 4-wire transmitter as long as a 24 V loop supply is wired in series.

  1. Set the measuring range module to position C for the affected group.
  2. Set the STEP 7 channel to measurement type 4-wire current, range 4-20 mA.
  3. Wire the loop: 24 V DC + → transmitter + → transmitter output + → SM331 channel M+ (terminal 13 for CH6, group 3) → SM331 channel Mana (terminal 14 for CH6) → 24 V DC - supply return.
  4. For a 2-wire transmitter, omit the separate power terminal pair and simply connect the two transmitter wires in series with the 24 V source and the SM331 input.

Position C is the recommended "safe" default because the module is purely passive at the input and will not conflict with any field device, regardless of whether the field side is active (4-wire) or passive (2-wire). The cost is one external 24 V supply or DC-DC isolator per loop.

8. When an Isolator is Mandatory

An isolator (also called a signal conditioner, loop isolator, or current repeater) is required in two cases:

  1. The transmitter is 4-wire (active output) and the SM331 group is keyed to position D. Two active sources would otherwise be in series. Insert a passive-input / passive-output isolator (e.g., Phoenix Contact MACX MCR-EX-SL, Wago 857-402, or Weidmüller ACT20X) in series. The isolator accepts the active 4-20 mA from the transmitter and produces a passive 4-20 mA output that the SM331 in position D can power and read.
  2. Galvanic isolation is required between the field and the S7-300 ground. A signal isolator breaks ground loops, protects against transients, and is often required in hazardous-area installations where the SM331 sits on the safe side of an intrinsic-safety barrier.
Isolator selection parameter: choose an isolator with at least 1.5× the worst-case loop voltage. For a 24 V supply, the isolator should be rated for ≥ 35 V continuous. The isolator's burden voltage is added to the loop and must be subtracted from the headroom budget of the transmitter.

9. Wiring Diagrams

9.1 2-Wire Transmitter to SM331 Position D (Module Supplies Loop)

SM331 (6ES7331-7KF02-0AB0) - Position D - 2-Wire 4-20 mA SM331 AI module MRM slot: D CH group 3 (CH6, CH7) 250 Ω sense +24 V loop source (L+) CH6+ (term 15) 2-Wire TX + --o - --o CH6- / Mana (term 16)

9.2 4-Wire Transmitter to SM331 Position C (External Loop Power)

SM331 (6ES7331-7KF02-0AB0) - Position C - 4-Wire 4-20 mA 4-Wire TX +24V in: P+ 0V in: P- Sig+: S+ 24 V DC field supply SM331 AI MRM slot: C Group 3, CH6 250 Ω sense S- to Mana P+ to 24V+ S+ to CH6+ CH6+ (term 15) CH6- (term 16)

9.3 4-Wire Transmitter to SM331 Position D via Passive Isolator

4-Wire TX -> Passive Isolator -> SM331 Position D 4-Wire TX S+ --o S- --o Passive Isolator Input: 4-20 mA Output: 4-20 mA Sink/Sink or Passive/Passive SM331 AI Position D Loop powered by module 250 Ω +24 V loop source (L+) S+ S- to CH6+ to CH6-/Mana

9.4 Measuring Range Module – Position Selector Detail

Measuring Range Module - Side Slot A B C D Voltage ±10 V (default) Voltage ±1 V / RTD / TC Current 0/4-20 mA (4-wire) Current 4-20 mA (2-wire, loop powered) Arrow on PCB points to selected position; both channels in the group share the same setting.

10. Commissioning and Verification Procedure

  1. Visual inspection. Confirm the front connector is keyed, screwed down, and the shield drain is bonded to the S7-300 shield bar.
  2. Check the load voltage. Use a multimeter at the SM331 L+ / M terminals. Expect 24 V DC ±5%.
  3. Apply a known current. Disconnect the field cable and inject a calibrated 4.000 mA, 12.000 mA, and 20.000 mA from a portable loop calibrator in series with the SM331 input. Verify the STEP 7 raw value reads 0, 13824, and 27648 (with the 4-20 mA range selected, normalized to 0-27648). Tolerance ±0.5% of full scale (138 LSB).
  4. Reconnect the field device and verify the live value tracks the process variable (e.g., pressurize the sensor with a hand pump and watch the PIW count increase monotonically).
  5. Force a wire-break test. Disconnect one wire at the field device. The SM331 should set the channel diagnostic bit (diagnostic interrupt enabled in STEP 7) and the raw value should fall to 0x8000 = -32768 in 4-20 mA mode. Reconnect and clear the diagnostic.

11. Troubleshooting Matrix

Observed Symptom Likely Cause Diagnostic Action Corrective Action
Raw value = 0x7FFF (overflow) at all times MRM position is D but transmitter is 4-wire (active) — two sources in series Measure loop voltage: if >28 V, both devices are sourcing Switch MRM to position C, or insert passive isolator
Raw value = 0x8000 (wire break) Open loop, no 24 V reaching transmitter, or MRM is in position C with no external supply Measure voltage at transmitter terminals Verify L+ on backplane, supply 24 V externally for 4-wire mode
Raw value stuck at 0 or near 0 with healthy loop voltage STEP 7 measurement type set to "voltage" while MRM is in C or D Compare HW Config with physical MRM position Re-download HW Config to match the physical switch
Raw value reads correctly at 4 mA but pegs at 20 mA STEP 7 range is "0-20 mA" while MRM is in D (4-20 mA only) Check the "Measurement type / range" in HW Config Change range to 4-20 mA, or move MRM to C if 0-20 mA is required
Reading drifts by several hundred LSB with cable length changes Shield not terminated, common-mode noise pickup Check shield bar bonding at subrack Bond shield at one end only (or both ends via RC network) and route away from VFD cables
Channel reads correctly on bench, fails in cabinet Loop voltage drop on long cable; transmitter headroom < 12 V Calculate V_drop = I × R_loop; verify ≥12 V at transmitter Use heavier gauge cable, or move to 4-wire position with local 24 V supply
Two channels in same group disagree by a fixed offset Wrong MRM position for the group's second channel Both channels share one MRM; verify sensor type matches Reassign channels to a group with the correct MRM setting

12. Loop Voltage and Cable-Length Budget

For long cable runs, the loop voltage at the transmitter terminals is:

V_terminal = V_supply - (I_loop × R_loop_total) - V_isolator_drop

where R_loop_total = 2 × R_cable (out and return) and V_isolator_drop is the burden of any in-line isolator. A typical 2-wire pressure transmitter needs at least 12 V (some models need 14 V) at its terminals to maintain 4 mA output. The SM331 in position D sources 24 V minus the internal drop, so the practical cable length is limited by:

L_max (m) = (V_supply - V_min_TX - V_isolator) / (2 × I_max × R_per_km)

For a 24 V supply, 14 V minimum at transmitter, 0 V isolator, 22 mA worst case, and a 0.5 mm² copper cable at 36 Ω/km: L_max = (24 - 14) / (2 × 0.022 × 36) ≈ 63 m. With 1.0 mm² cable (19 Ω/km), this rises to ~120 m. For longer runs, switch to position C with a local 24 V transmitter supply at the field end.

13. Documentation Trail and Reference Material

Always verify the wiring against the manual bound to your specific module revision. The terminal numbering convention, particularly for the 2-wire current terminal pair, has been preserved across all hardware revisions of the 6ES7331-7KF02-0AB0 but the diagnostic behavior has been refined in firmware 2.x and later.

14. Frequently Asked Questions

Can I wire a 2-wire 4-20 mA pressure transmitter to the SM331 6ES7331-7KF02-0AB0?

Yes. Set the measuring range module for the channel group to position D, configure the STEP 7 channel to "2-wire current / 4-20 mA", and connect the transmitter's + and - terminals to the channel's M+ and Mana inputs. The SM331 will source the loop current from the backplane L+ supply.

What happens if I connect a 4-wire (active) transmitter while the SM331 is keyed to position D?

Two active current sources end up in series. The reading is invalid (typically pegged at 0x7FFF or wildly oscillating) and one or both devices can be damaged. Either switch the measuring range module to position C, or install a passive-input / passive-output signal isolator in series with the loop.

My channel returns 0x8000 (wire break). Is the transmitter bad?

Not necessarily. 0x8000 in 4-20 mA mode indicates an open loop. Check (1) that the backplane L+ is present, (2) that the measuring range module is in position D for a 2-wire transmitter or position C with an external 24 V source for a 4-wire transmitter, (3) cable continuity end-to-end, and (4) the transmitter's minimum supply voltage (typically 12-14 V) is being met at its terminals.

Can I mix 2-wire and 4-wire transmitters on the same SM331 module?

Yes, by assigning them to different channel groups. Each group of two channels shares one measuring range module, so the transmitter types within a group must agree. Alternatively, set all four groups to position C (4-wire, passive) and provide loop power externally for every transmitter — this is the most flexible configuration when the field mix is heterogeneous.

Do I need an isolator if the field device sits in a hazardous area?

Yes. Use a Zener barrier or galvanic isolator rated for the hazardous-area classification. The SM331 itself is not intrinsically safe; the barrier or isolator provides the energy limitation required by the zone classification, and the SM331 sits on the safe side of the device. Verify the loop voltage, current, and entity parameters against the barrier's certificate before commissioning.

Back to blog