Wiring SM 1231 4AI 4-20mA 2-Wire and 3-Wire Transmitters

David Krause18 min read
S7-1200SiemensTutorial / 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 SM 1231 4AI 4-20mA 2-Wire and 3-Wire Transmitters

The Siemens SIMATIC SM 1231 analog input module is one of the most widely used signal modules on the S7-1200 platform, but its wiring documentation is a frequent source of confusion when commissioning 2-wire, 3-wire, and 4-wire 4-20 mA field transmitters. This article consolidates the official Siemens wiring guidance, the loop-powering rules for current loops, and the TIA Portal configuration steps required to read a stable process value from a passive loop-powered (2-wire) or actively powered (3-wire / 4-wire) 4-20 mA transmitter on the SM 1231 4AI.

Critical engineering fact: The SM 1231 analog input is a passive measuring device. It does NOT source 24 V DC to energize a 2-wire loop-powered transmitter. The 24 V DC loop supply must be provided by an external power supply, a separate SITOP power module, or the S7-1200 CPU's own 24 V DC sensor supply output. Field engineers often miss this requirement because the SM 1231 manual shows a generic "current source" symbol without depicting the loop supply.

1. SM 1231 4AI Module Identification

Before wiring, confirm the exact module variant in your S7-1200 rack. The SM 1231 family contains several analog input modules with different channel counts, resolutions, and signal-type support. The 4-channel current/voltage variant relevant to most 4-20 mA applications is the SM 1231 AI4.

MLFB / Order Number Description Resolution Channels
6ES7231-4HD32-0XB0 SM 1231 AI4 x 13 bit 13 bit 4 AI (U / I)
6ES7231-4HF32-0XB0 SM 1231 AI8 x 13 bit 13 bit 8 AI (U / I)
6ES7231-5ND32-0XB0 SM 1231 AI4 x 16 bit 16 bit 4 AI (U / I / RTD / TC)
6ES7231-5PD32-0XB0 SM 1231 AI8 x 16 bit 16 bit 8 AI (U / I / RTD / TC)

The 13-bit variants accept voltage (±10 V, 0-10 V, ±5 V, 0-5 V, ±2.5 V) and current (0-20 mA, 4-20 mA). The 16-bit variants add RTD and thermocouple support. For pure 4-20 mA transmitter applications, the 6ES7231-4HD32-0XB0 (4AI, 13 bit) is the most common selection, although the 16-bit modules deliver significantly better noise performance and are recommended for low-level pressure, flow, or analytical signals.

Firmware compatibility: The SM 1231 AI4 (6ES7231-4HD32-0XB0) requires the S7-1200 CPU firmware V4.0 or higher when used in a distributed ET 200SP configuration, and V2.0 or higher on the central rack. Verify compatibility in the S7-1200 System Manual, "Signal modules" chapter, before commissioning.

2. The Power Architecture of a 4-20 mA Current Loop

A 4-20 mA current loop is a series circuit. Current flows from a DC power supply through the transmitter, then through the receiver (the SM 1231 input), and back to the supply negative terminal. The transmitter regulates the current to a value proportional to the measured variable. Because the loop is a series circuit, the SM 1231 cannot act as a current source; it is the current-sensing element, not the loop supply.

The classic Ohm's-law check for any 4-20 mA loop is:

V_loop ≥ V_transmitter(min) + V_receiver + (I_max × R_wire_total)

For a 2-wire loop-powered transmitter with a typical 12 V minimum supply requirement, a ~250 Ω input burden on the SM 1231 (~5 V drop at 20 mA), and a wire loop resistance of 20 Ω:

V_loop ≥ 12 V + 5 V + (0.020 A × 20 Ω) = 17.4 V

A nominal 24 V DC supply leaves more than 6 V of headroom, which is the standard design margin. Anything below 18-20 V of total supply at the transmitter terminals will cause saturation or non-linearity at the top of the range.

Why the SM 1231 has no loop power

Each SM 1231 input channel contains a precision current-sensing resistor across the input terminals. The module's internal ADC measures the voltage developed across this resistor. The module does not contain a boost converter, current source, or any active driver that could push current out of the input pin toward the field device. Wiring diagrams in the S7-1200 System Manual show a generic current source or voltage source block; engineers must interpret that block as the field transmitter, not as something the module provides.

3. Transmitter Type Classification

Before touching a wire, identify which transmitter family the field instrument belongs to. The wire count dictates where the 24 V DC enters the loop.

Type Power Path Typical Field Devices SM 1231 Wiring Complexity
2-wire (loop-powered) Loop supply → transmitter → SM 1231 → back to supply Pressure, level, temperature, flow transmitters with low power draw External 24 V supply required
3-wire Two wires for power (V+, GND), one wire for signal sharing the same GND Some proximity sensors, photoelectric sensors, basic transmitters External 24 V supply, signal shares ground
4-wire (actively powered) Two wires for power, two isolated wires for signal Laboratory analyzers, high-power transmitters, magmeters External 24 V supply, signal is isolated from power

2-wire loop-powered transmitter

The transmitter draws all operating current from the loop. Typical current draw is 3.5-4 mA at the bottom of the range, leaving 4-20 mA for the signal. The total loop current is bounded by the transmitter's own minimum operating current plus the signal current, so a properly designed loop can detect a broken wire (0 mA) and an under-range (≤ 3.6 mA by NAMUR NE 43).

3-wire transmitter

The transmitter receives its operating power on two dedicated wires (V+ and GND) and produces the 4-20 mA signal on a third wire that returns to the same GND. The signal wire and the power negative are NOT isolated.

4-wire transmitter

The transmitter has a completely isolated power input and signal output. The signal output is typically a true floating current source that can drive 0-20 mA or 4-20 mA into a grounded load such as the SM 1231 input.

4. SM 1231 Terminal Layout (AI4 Variant)

The 4AI SM 1231 uses a removable terminal strip with 16 positions. The bottom row carries the analog inputs. The relevant terminal assignments for current inputs are:

Terminal Signal Function
2 AI0+ Channel 0 positive input
3 AI0- Channel 0 negative input (return)
5 AI1+ Channel 1 positive input
6 AI1- Channel 1 negative input (return)
8 AI2+ Channel 2 positive input
9 AI2- Channel 2 negative input (return)
11 AI3+ Channel 3 positive input
12 AI3- Channel 3 negative input (return)
Polarity is critical. The AIx+ terminal is the more positive side of the internal burden resistor. Reversing + and - on a current input does not damage the module (the input is reverse-polarity tolerant up to 40 mA continuous), but the measured value will read 0 mA and the broken-wire diagnostic may latch. Always land the wire that carries current INTO the channel on the + terminal.

5. Wiring Diagrams by Transmitter Type

5.1 Two-wire (loop-powered) 4-20 mA transmitter

The 2-wire loop is the most common configuration in process plants. The SM 1231 input sits in series with the transmitter and the 24 V DC supply.

        +24 V DC
           |
           +---- to transmitter V+ (loop +)
           |
   SITOP / CPU sensor supply
   or external 24 V supply
           |
           |      +-------------+
           |      | Transmitter |
           |      |  (2-wire)   |
           |      |             |
           |      |  V+ -- in   |
           |      |             |
           |      |  SIG -- out |
           |      +------+--------+
           |             |
           |             | signal wire
           |             |
           |      +------+--------+
           |      |   SM 1231    |
           |      |  AI0+ (T2)  |
           |      |  AI0- (T3)  |
           |      +------+--------+
           |             |
           |             | return wire
           |             |
           +-------------+
        24 V DC common (M / GND)

Step-by-step wiring procedure for channel 0:

  1. De-energize the field loop. The CPU and 24 V supply can remain powered.
  2. Land the transmitter's positive loop terminal on SM 1231 terminal AI0+ (terminal 2 on the 4AI module).
  3. Land SM 1231 terminal AI0- (terminal 3) on the 24 V DC common / M terminal at the supply.
  4. Verify the transmitter's V+ / loop+ terminal is tied to the 24 V DC + of the supply.
Single-point ground: Ground the 24 V supply negative (M) at one point only, typically the supply itself. The SM 1231 analog input common is internally tied to the CPU's M terminal; do not create a second ground path or a ground loop will inject 50/60 Hz noise into the measurement.

5.2 Three-wire 4-20 mA transmitter

For a 3-wire transmitter, the supply negative is shared with the signal return. The SM 1231 input sees the 4-20 mA flowing from the signal output of the transmitter back to the same 24 V common.

        +24 V DC -----+----- to transmitter V+ (terminal 1)
                       |
                       |      +-------------+
                       |      | Transmitter |
                       |      |  (3-wire)   |
                       |      |             |
                       |      | V+  -- in   |
                       |      | GND -- com  |
                       |      | SIG -- out  |
                       |      +--+-----+----+
                       |         |     |
                       |         |     +----- signal wire to SM 1231 AI0+
                       |         |
                       |         +----- to 24 V common (M) and to SM 1231 AI0-
                       |
        M -------------+----- to transmitter GND (terminal 2)

Step-by-step wiring procedure:

  1. Connect the 24 V supply positive to the transmitter's V+ (or PWR) terminal.
  2. Connect the transmitter's GND terminal both to the 24 V supply M and to the SM 1231 AI0- terminal (3).
  3. Connect the transmitter's signal output terminal to the SM 1231 AI0+ terminal (2).

Many 3-wire transmitters have the signal output internally referenced to GND; check the datasheet. If the signal output is a "sourcing" output (current flows out of the signal terminal and returns via GND), the wiring above is correct. If the signal output is "sinking" (current flows from GND into the signal terminal), the polarity of the SM 1231 input must be reversed.

5.3 Four-wire 4-20 mA transmitter

A 4-wire transmitter has fully isolated power and signal. The signal wires are a floating current source that drives 4-20 mA through the SM 1231 input. Polarity follows the 2-wire rule: the terminal carrying current INTO the SM 1231 goes to AI0+.

  1. Power the transmitter from a separate 24 V supply (or the same supply, but with a dedicated fuse and short pigtail).
  2. Connect the transmitter's SIG+ output to SM 1231 AI0+ (terminal 2).
  3. Connect the transmitter's SIG- output to SM 1231 AI0- (terminal 3).
  4. Do NOT bond the signal negative to the supply M at the transmitter end; the signal is already isolated internally.

6. Choosing the 24 V Loop Supply

The loop supply can be:

  • The S7-1200 CPU's own sensor supply output (terminals L+ and 1M on the CPU). Convenient because it is monitored and faulted by the CPU, but it is limited in current (typically 400 mA for the CPU 1214C, 1600 mA for the CPU 1217C) and shares the same ground as the analog inputs.
  • A dedicated SITOP power supply, e.g. 6EP1332-3BA10 (10 A) or 6EP1331-3BA10 (3 A). The preferred choice for noisy panels or long cable runs.
  • The existing 24 V distribution already powering other field devices. Always check polarity and ground referencing.

Use a fuse (typically 1 A slow-blow) on the loop supply rail. Run a separate neutral/return wire from each transmitter to the supply negative; do not daisy-chain return wires through terminal blocks, as the cumulative voltage drop will add error.

7. TIA Portal Configuration

After the physical wiring is complete, configure the analog channel in TIA Portal. The configuration is done in the Device view, selecting the SM 1231, then the Properties tab, then expanding Analog inputs → channel 0.

Parameter Setting for 4-20 mA Notes
Measurement type Current Disable "Voltage" if shown.
Measurement range 4...20 mA Not 0-20 mA, unless the application requires it.
Smoothing None / Weak / Medium / Strong Strong = heavy low-pass filter, increases cycle time.
Diagnostics: Overflow Enable Triggers if I > ~22.5 mA
Diagnostics: Underflow Enable Triggers if I < ~1.185 mA
Diagnostics: Wire break (4-20 mA only) Enable Triggers if I < ~3.6 mA on 4-20 mA range
Substitute value behavior on error Per project standard 0x7FFF or substitute value

The analog value is read from the process image input (PII) at the IW address assigned by the system, e.g. %IW64 for the first channel. The integer value is the raw ADC count. The scaling from raw to engineering units is performed in user code using the S7-1200 NORM_X and SCALE_X instructions, or with the legacy SCALE library block.

Raw-to-engineering conversion

For a 13-bit SM 1231 (6ES7231-4HD32-0XB0) the nominal range mapping for 4-20 mA is:

  • 4 mA → 0
  • 20 mA → 27648
  • Underrange (< 1.185 mA) → negative values down to -32768 (overflow / wire break)
  • Overrange (> 22.81 mA) → 32767

For a 16-bit SM 1231 (6ES7231-5ND32-0XB0) the range is 0 to 27648, with -32768 reserved for wire-break/underflow and 32767 for overflow. Confirm the exact mapping in the device documentation for the specific MLFB in use.

8. Handling Unused Channels

This is one of the most common commissioning oversights. The Siemens documentation for the SM 1231 wiring diagrams specifies two rules for unused channels:

  1. Unused voltage input channels should be shorted. Tie the + and - terminals together at the terminal block. A floating voltage input can pick up induced noise and generate random ADC values or trigger overflow diagnostics.
  2. Unused current input channels should be set to the 0 to 20 mA range and/or have broken-wire error reporting disabled. This prevents the channel from generating a permanent wire-break diagnostic alarm when no current is flowing.

Either rule may be applied; applying both provides the cleanest result. In TIA Portal, navigate to the unused channel's properties and uncheck "Wire break" under "Diagnostics" if the channel is intentionally left in 4-20 mA mode.

Reference: SM 1231 wiring diagrams and unused-channel rules are documented in the SIMATIC S7-1200 Programmable Controller System Manual, chapter "Signal modules". See the SM 1231 wiring diagrams section of the Siemens documentation cloud.

9. Verification and Commissioning Procedure

After wiring and configuration, perform the following checks in order before declaring the channel healthy:

  1. Power check. With the loop powered and the transmitter connected, measure the voltage at the transmitter terminals. It must be at least 2 V above the transmitter's published minimum operating voltage (typically 12 V for a loop-powered pressure transmitter).
  2. Current check. Clamp a multimeter (in mA mode) in series with the loop or use a current shunt. Confirm 4.00 mA at the low end of the process variable and 20.00 mA at the high end.
  3. Voltage check at the SM 1231 terminals. With the loop active, measure DC voltage between AIx+ and AIx-. For a 4-20 mA input, this should be approximately 1.0 V to 5.0 V (proportional to the current × ~250 Ω burden). A reading of 0 V indicates the loop is open.
  4. Raw value check in TIA Portal. Go online, open a watch table, and force a refresh of the input word (e.g. %IW64). At 4 mA the value should be 0 ± 5 counts; at 20 mA it should be 27648 ± 5 counts. Negative values or 32767 indicate a configuration or wiring fault.
  5. Diagnostic buffer check. Open the CPU's diagnostic buffer (Online → Diagnostics → Diagnostic buffer) and confirm no "Analog input wire break" or "Analog input overflow" entries.
  6. End-to-end calibration. Apply a known process input to the transmitter (e.g. a calibrated pressure source) and verify the engineering value in the HMI matches the expected scaled value within the instrument's accuracy spec.

10. Troubleshooting Matrix

Symptom Root Cause Diagnostic Step Resolution
Raw value = 0 constantly Loop not powered, or wire broken Measure voltage at transmitter terminals; measure DC voltage between AIx+ and AIx- Restore 24 V to the loop; repair the wire break
Raw value = -32768 (or near negative full scale) Underrange / wire break detected on 4-20 mA channel Check TIA Portal "Wire break" diagnostic; verify current at transmitter Disable wire-break diagnostic for the unused 0-20 mA configuration, or fix the missing current
Raw value = 32767 Overrange / overflow Check if transmitter output exceeds 20 mA (e.g. due to sensor overpressure) Reduce process variable, or recalibrate transmitter
Raw value pegged at 27648 but process variable is wrong Sensor saturated at top of range Verify scaling block parameters and instrument range Adjust SCALE_X MIN/MAX, or recalibrate sensor
Noisy / unstable raw value Ground loop, long cable, no shielding, or shared supply with switching loads Check shield termination, ground reference, separation from VFD cables Use shielded twisted pair; ground shield at one end; isolate the 24 V supply with a SITOP or DC/DC converter
Value reads ~5529 with 4 mA input (or any constant offset) Channel configured for 0-20 mA but transmitter is 4-20 mA Check channel configuration in TIA Portal Change measurement range to 4...20 mA
Value drifts with panel temperature Self-heating of power supplies, poor voltage regulation Measure supply voltage at transmitter under load Use a regulated SITOP supply; derate if the panel is hot
Two channels interact (reading on one changes when the other is energized) Insufficient loop supply or shared return path Measure voltage at the affected channel while energizing the other Use separate returns and increase supply capacity

11. Common Wiring Mistakes

The following errors appear repeatedly on commissioning sites:

  1. Assuming the SM 1231 provides loop power. It does not. The 2-wire transmitter will not work without an external 24 V source.
  2. Reversing polarity on the SM 1231 input. The module is reverse-polarity tolerant, but the ADC reads zero because the internal diode clamps the negative input.
  3. Mixing voltage and current ranges on the same channel. Each SM 1231 channel must be configured for either voltage or current in TIA Portal. Mixing hardware jumpers and software range selection leads to out-of-range readings.
  4. Leaving unused voltage channels floating. A floating voltage channel picks up noise and may latch overflow diagnostics, potentially blocking the diagnostic scan of the entire module.
  5. Configuring unused 4-20 mA channels with wire-break enabled. This floods the diagnostic buffer with spurious wire-break events.
  6. Sharing the 24 V supply return across multiple transmitters via a single daisy-chained wire. The accumulated IR drop and noise coupling cause cross-talk between channels.
  7. Routing analog signal cables in the same conduit as VFD output cables or three-phase power. Capacitive coupling induces common-mode noise that the SM 1231's ADC rejects poorly without proper shielding.

12. Shielding, Grounding, and EMC Best Practices

For installations in electrically noisy environments, apply the following:

  • Use shielded twisted pair cable, e.g. Belden 8761 or Lapp UNITRONIC LiYCY.
  • Ground the shield at one end only, typically at the panel entry, to avoid ground loops.
  • If the cable run exceeds 50 m, prefer the 16-bit SM 1231 (6ES7231-5ND32-0XB0) for better common-mode rejection.
  • Separate analog signal cables from power cables by at least 200 mm. Cross at 90° if intersection is unavoidable.
  • Bond the panel backplane to a clean ground bus, NOT to the building steel.

13. Example SCL Scale Block

The following Structured Control Language (SCL) snippet scales a raw SM 1231 input (channel 0, IW64) into a 0.0-100.0 % engineering range. Adjust the IW address and engineering range for the project.

// SCALE_X block: raw 0..27648 -> engineering 0.0..100.0
// Use NORM_X to convert the INT raw value to a REAL fraction 0.0..1.0,
// then SCALE_X to multiply by the engineering range.

"dbScale".rNormIn   := INT_TO_REAL("iwAI0");        // %IW64
"dbScale".rNormMin  := 0.0;
"dbScale".rNormMax  := 27648.0;
"dbScale".rNormOut  := "dbScale".rNormIn;          // re-used below

"dbScale".rScaleIn  := "dbScale".rNormOut;
"dbScale".rScaleMin := 0.0;
"dbScale".rScaleMax := 100.0;
"dbScale".rScaleOut := "dbScale".rScaleIn;        // result in %

// Optional: detect underrange/overrange before scaling
IF "iwAI0" < 0 THEN
    "dbScale".bWireBreak := TRUE;
ELSIF "iwAI0" > 27648 THEN
    "dbScale".bOverflow := TRUE;
ELSE
    "dbScale".bWireBreak := FALSE;
    "dbScale".bOverflow  := FALSE;
END_IF;

14. Extended Reference: Loop-Powering Topologies

Siemens support entry 40914972 consolidates wiring examples and answers common questions about 2-wire and 4-wire sensor connections to SIMATIC analog input modules. The same source confirms the principle that the SIMATIC analog input does not contain an internal 24 V supply and that the loop voltage must be provided externally, regardless of whether the field device is 2-wire, 3-wire, or 4-wire.

→ Siemens Support Entry 40914972 — Connecting 2-wire and 4-wire sensors to SIMATIC analog input modules

15. Frequently Asked Questions

Does the SM 1231 supply 24 V DC to power a 2-wire 4-20 mA transmitter?

No. The SM 1231 is a passive measuring device. You must provide an external 24 V DC source (the CPU's sensor supply, a SITOP power module, or a third-party 24 V supply) to energize the loop. The SM 1231 only measures the current flowing through its input burden resistor.

Can I connect a 3-wire transmitter to the SM 1231 without any external supply?

No. A 3-wire transmitter still requires an external 24 V DC source for its V+ and GND terminals. The signal output and the GND share the same return, so connect GND to both the supply negative and the SM 1231 AI- terminal.

What is the correct measurement range for a 4-20 mA transmitter on the SM 1231?

Set the channel's measurement type to "Current" and the measurement range to "4...20 mA" in TIA Portal. Use 0-20 mA only if the transmitter truly outputs 0 mA at the bottom of its range and you have disabled the wire-break diagnostic.

Why does my unused channel generate a wire-break error?

On a 4-20 mA channel, less than ~3.6 mA of current is interpreted as a broken wire. To suppress this on a channel that is intentionally unused, change its measurement range to 0-20 mA and/or disable the wire-break diagnostic in the channel properties.

What is the input burden of the SM 1231 current input?

Each current input on the SM 1231 presents approximately 250 Ω to the loop. At 20 mA, the voltage drop across the input is roughly 5 V, which must be included in the loop supply voltage budget per V_loop ≥ V_transmitter(min) + V_receiver + (I_max × R_wire).

Back to blog