Configuring 4-20mA DC Signals on Siemens SM 1231 Analog Input

David Krause14 min read
S7-1200SiemensTechnical Reference
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

Configuring 4-20mA DC Signals on Siemens SM 1231 Analog Input

The 4-20 mA current loop is the dominant analog signaling standard in process instrumentation, but a frequent engineering question is whether the loop current itself can be alternating rather than direct. This reference clarifies the underlying physics, defines the DC-only convention enforced by industry standards, walks through Siemens SM 1231 analog input module configuration, and documents HART (Highway Addressable Remote Transducer) pass-through limitations specific to the S7-1200 platform. A practical AC-to-DC conversion circuit is included for cases where an AC-coupled sensor output must be adapted to a SM 1231 channel.

1. Why 4-20 mA Current Loops Are DC, Not AC

A 4-20 mA current loop is defined as a direct current (DC) signaling method. No major industrial standard—NAMUR NE 43, IEC 60381-1, or ANSI/ISA 50.00.01—recognizes a 4-20 mA alternating current (AC) variant. The reasons are physical and practical:

  • Direction of information: A 4 mA value corresponds to 0% of the calibrated range and 20 mA to 100%. A single, monotonic DC value unambiguously maps to a process variable. An AC waveform would oscillate around zero, making a static process reading impossible without rectification.
  • Live-zero fault detection: The 4 mA offset (the "live zero") allows the receiver to distinguish a broken wire (0 mA) from a legitimate 0% reading (4 mA). AC cannot preserve this offset without a bias.
  • Loop integrity: DC loops can be powered from a single polarity rail, allowing simple two-wire field devices and predictable common-mode behavior.
  • Noise rejection: Low-frequency DC loops integrate cleanly with shielded twisted pair and avoid the rectification artifacts that an AC loop would impose on the measurement chain.

If the source is genuinely AC (for example, the output of a current transformer or an AC-coupled transducer), the loop must be rectified and filtered before it can be interpreted by an analog input module. Section 8 of this document covers that conversion in detail.

Key takeaway: Treat "4-20 mA" as a DC-only convention. Any AC source presented at the SM 1231 terminals must be conditioned into a unipolar DC signal that falls within the module's input span.

2. SM 1231 Analog Input Module Family Overview

The SM 1231 signal module family extends an S7-1200 CPU with analog inputs. All catalog variants that accept current inputs cover 0-20 mA and 4-20 mA as standard ranges; voltage ranges (±10 V, ±5 V, ±2.5 V, 0-10 V) are also supported but selected per-channel in TIA Portal. The most commonly used catalog numbers are listed below.

Article Number Description Channels Resolution Notes
6ES7231-4HD32-0XB0 SM 1231 AI 4 x 13 bit 4 13 bit (12 bit + sign) Standard resolution, common on small PLCs
6ES7231-5ND32-0XB0 SM 1231 AI 4 x 16 bit 4 16 bit High-speed, improved accuracy
6ES7231-5PD32-0XB0 SM 1231 AI 8 x 16 bit 8 16 bit High-speed 8-channel variant
6ES7231-5QF32-0XB0 SM 1231 AI 8 x 13 bit 8 13 bit Compact 8-channel, basic accuracy
6ES7231-4HF32-0XB0 SM 1231 AI 8 x 13 bit (variant) 8 13 bit Cost-optimized 8-channel
6ES7231-5PA40-0XB0 SM 1231 AI 8 x RTD/TC 8 15 bit + sign Thermocouple / RTD only
6ES7231-5QA40-0XB0 SB 1231 AI 1 x 12 bit (signal board) 1 12 bit Plugs into CPU front

Source for module data: Siemens S7-1200 Programmable Controller Manual (entry ID 109751634).

The 13-bit variants quantize the bipolar voltage range into 27,648 counts. With a 0-20 mA input, each LSB is approximately 723 nA. With a 4-20 mA input, the module maps 4 mA to 0 counts (0%) and 20 mA to 27,648 counts (100%); values below 4 mA are still measured but produce negative scaled values, which can be useful for fault detection when wired to NAMUR-compliant transmitters.

3. Supported Input Ranges and Electrical Limits

The SM 1231 accepts the following input configurations per channel. Configuration is performed in TIA Portal under Device configuration → Properties → Analog inputs → Channel.

Measurement Type Range Engineering Scaling in TIA Portal
Voltage, bipolar ±10 V, ±5 V, ±2.5 V -10 V → 0, +10 V → 27648
Voltage, unipolar 0-10 V 0 V → 0, 10 V → 27648
Current 0-20 mA 0 mA → 0, 20 mA → 27648
Current 4-20 mA 4 mA → 0, 20 mA → 27648
Thermocouple / RTD Type J, K, T, E, R, S, B, N, C, TXK/L; Pt100, Pt200, Ni100, etc. Engineering units (°C / °F)

Critical electrical limits on the AI channels of the standard SM 1231 (13-bit and 16-bit variants):

  • Maximum input voltage on a current-configured channel: ±30 V sustained, ±35 V transient. Exceeding this damages the input stage.
  • Maximum input current on a voltage-configured channel: limited by internal shunt; sustained currents above ~30 mA trip the protective fuse on certain 16-bit modules.
  • Common-mode voltage between channels and to PE: 12 V DC typical, 35 V transient.
  • Loop burden voltage at 20 mA: typically 2.5 V across the input (including internal shunt), so the transmitter must still see at least its minimum compliance voltage.
Loop power budget: A typical two-wire transmitter needs 12 V at the device terminals to operate. With the SM 1231 dropping ~2.5 V at 20 mA, the loop supply must therefore be at least 14.5 V DC. A 24 V DC supply is standard and recommended. Fluke Process Calibration — 4-20 mA current loop overview notes 9 V, 12 V, and 24 V DC as the most common loop supply voltages in industrial installations.

4. Wiring Topologies: 2-Wire, 3-Wire, and 4-Wire Transmitters

The SM 1231 can interface with all three common transmitter wiring schemes. The selection depends on whether the transmitter is loop-powered or self-powered.

4.1 Two-Wire (Loop-Powered) Transmitter

The transmitter receives both power and signal over the same pair. The SM 1231 channel terminals supply the loop current return path. A separate 24 V DC source feeds the loop through the transmitter.

       +24 V DC
         |
         |
    +----[ Field TX ]----- AI+ (CH0)
    |       (loop-powered)  |
    |                       AI- (CH0)
    |                         |
    +-------------------------+
         (return to 24V GND)

This is the most common arrangement for pressure, level, temperature, and flow transmitters in hazardous-area or field installations.

4.2 Four-Wire (Self-Powered) Transmitter

The transmitter has separate power terminals (often 110/230 V AC or 24 V DC) and an isolated 4-20 mA output. Only the output wires connect to the SM 1231.

    TX POWER    TX SIGNAL
   +--[AC/DC]---+--- AI+
        |           |
        GND      [4-20 mA out]--- AI-
                    |
                  (returns to TX GND)

The SM 1231 input is differential, so the analog ground reference is taken at AI-. No shield-to-ground bond is required at the module side; bond the shield at the panel entry only.

4.3 Three-Wire Transmitter

Three-wire devices share a common ground between power and signal. Connect power +V to the loop supply, GND to the common terminal, and mA+ to the SM 1231 AI+ input. The SM 1231 AI- terminal ties to the same common ground.

5. TIA Portal Configuration Walk-Through

5.1 Enable the Channel

  1. Open the project in TIA Portal V17 or later and load the device configuration.
  2. Select the SM 1231 module in the device view.
  3. In Properties → Analog inputs, click each channel you intend to use and check Enable.
  4. Set Measurement type = Current.
  5. Set Range = 4 to 20 mA.
  6. Confirm the integration time (typically 50 Hz or 60 Hz mains rejection; 60 Hz default for North America).

5.2 Scaling and Code Interpretation

The SM 1231 returns an integer in the range -27648 to +27648, plus overflow flags at +32767 and underflow at -32768. For 4-20 mA:

Input current Raw value Status
< 1.185 mA -32768 (underflow) Wire break / sensor disconnected
3.999 mA (live zero) 0 0% of range
12.000 mA 13824 50% of range
20.000 mA 27648 100% of range
> 22.81 mA +32767 (overflow) Sensor above range / loop fault

5.3 STEP 7 Code Example (SCL)

Convert the raw integer to engineering units:

// Raw value from %IW64 (channel 0 of first SM 1231)
#iRaw := %IW64;
IF #iRaw > 27648 THEN
    #bOverflow := TRUE;
    #rPercent := 100.0;
ELSIF #iRaw < 0 THEN
    #bUnderflow := TRUE;
    #rPercent := 0.0;
ELSE
    #rPercent := INT_TO_REAL(#iRaw) / 27648.0 * 100.0;
END_IF;

6. HART Pass-Through and SM 1231 Compatibility

HART (Highway Addressable Remote Transducer) is a bidirectional protocol that superimposes a 1200/2200 Hz Frequency-Shift Keying (FSK) signal onto a 4-20 mA DC loop. The average value of the FSK signal is zero, so it does not disturb the analog measurement.

The standard SM 1231 modules listed in Section 2 do not implement HART pass-through. They low-pass filter the input to reject the HART FSK tones and pass only the average DC current to the analog-to-digital converter. The PLC sees a clean 4-20 mA signal but cannot communicate with the HART device to read PV, range, tag, calibration date, or diagnostics.

6.1 Why the HART Signal Is Lost

The SM 1231 analog front-end includes an integrator that effectively averages out the ±0.5 mA HART FSK modulation. The digital-to-analog result is a single, steady DC value. Without a dedicated HART modem in the input stage and a buffered pass-through to the backplane, the FSK data is discarded.

6.2 HART-Enabled Alternatives on the S7-1200 Platform

To retain HART communication, choose one of the following options:

Approach Hardware HART Access
ET 200SP HA remote I/O with HART AI 6ES7531-7RD00-0AB0 (AI 4 x HART) + IM 155-6 Full PV / variable / diagnostics via TIA Portal
ET 200SP analog input with HART 6ES7131-6KF00-0CA1 (AI 4 x HART) + IM 155-6 Full HART access over PROFINET
External HART multiplexer P+F KFD2-HMM or Phoenix HART Mux HART over Modbus TCP / serial to CPU
HART-to-Modbus gateway Moore Industries HMG or similar HART variables exposed as Modbus registers

Refer to the SIMATIC ET 200SP HA Manual for wiring and configuration of the HART-capable AI modules. For the legacy S7-1200 + SM 1231 topology, plan for a separate gateway if HART variables are required.

Misconception to correct: Some field practices describe "HART current loops" as if the HART signal were AC. It is not. HART is a 1200/2200 Hz AC FSK modulation superimposed on a DC loop. The DC component is mandatory for the 4-20 mA measurement; the AC modulation is digital data.

7. Loop Power Supply Sizing

A correctly designed 4-20 mA loop requires the transmitter to see at least its specified minimum terminal voltage while delivering 20 mA. The loop supply voltage VS must satisfy:

VS ≥ VTX_min + (Imax × Rloop_total) + Vburden

where VTX_min is the transmitter minimum compliance (typically 12 V for loop-powered smart devices), Rloop_total is the sum of the wire resistance plus any added sense resistor, and Vburden is the voltage drop across the SM 1231 input (~2.5 V at 20 mA).

Example calculation:

  • Transmitter compliance: 12 V minimum
  • Wire resistance (1000 m of 18 AWG copper, ~21 Ω/km): 21 Ω round-trip
  • SM 1231 burden at 20 mA: 2.5 V
  • Required supply: 12 + (0.020 × 21) + 2.5 = 14.92 V

A 24 V DC regulated supply therefore provides a healthy 9 V margin to accommodate temperature drift, additional resistance, and surge transients.

8. AC-to-DC Conversion for Non-Standard Sensors

If a sensor produces a true AC current that must be presented to the SM 1231, use a precision rectifier (also called an absolute-value circuit) rather than a passive bridge. A passive diode bridge has two problems at the low mA range typical of instrumentation loops:

  • Diode forward drop (~0.6-0.7 V each, ~1.4 V total for a bridge) is comparable to the loop voltage and distorts the signal at low currents.
  • Dead-zone near zero crossings produces distortion that cannot be filtered out without slowing the response.

8.1 Recommended Precision Rectifier

Use a single-supply op-amp absolute-value circuit with a unity-gain buffer followed by a low-pass filter. Example with an MCP6021 or TL072:

       AC_in
         |
         |
   +----[ R1 10k ]----+--- |+\
   |                   |     \
   |                   |      >----+---- DC_out (0-Vref)
   |                   |     /
   |                   +--- |-/
   |                       |
   |                   [ Rf 10k ]
   |                       |
   |                       +--- (feedback)
   |                   [ D1 (signal) ]
   |                       |
   |                   GND_REF
   |
   [ R2 10k ]
   |
  GND

Follow the precision rectifier with a second-order active low-pass filter (cutoff ~10 Hz) to remove residual ripple. The DC output must be biased into the 4-20 mA current range using a voltage-to-current converter (e.g., a Howland current pump) if the SM 1231 expects a current input.

8.2 Bridge Rectifier Approach (When Precision Is Not Critical)

For non-critical applications with signals well above 5 mA RMS, a passive bridge with a filter capacitor is acceptable:

  • Bridge: four 1N4148 or 1N4007 diodes
  • Filter capacitor: 10-100 µF electrolytic, sized to limit ripple to < 1% of full-scale
  • Sense resistor: 250 Ω, 0.1%, to convert 4-20 mA target to 1-5 V input for a voltage-configured SM 1231 channel
Caveat: A passive bridge is not suitable when the source impedance is high or when the signal is below ~5 mA RMS. Use the precision op-amp topology in those cases. Always verify the rectified DC value with a calibrated multimeter before connecting to the SM 1231.

9. Calibration, Verification, and Troubleshooting Matrix

9.1 Pre-Commissioning Verification

  1. Disconnect the field wiring from the SM 1231 channel.
  2. Connect a precision mA source (Fluke 789, Beamex MC6, or similar) in series with a 24 V DC loop supply.
  3. Force 4.000 mA and confirm the raw integer reads 0 ±4 counts.
  4. Force 12.000 mA and confirm 13824 ±8 counts.
  5. Force 20.000 mA and confirm 27648 ±8 counts.
  6. Force 2.000 mA and confirm underflow flag is set (raw value clamped at -32768).
  7. Force 22.000 mA and confirm overflow flag is set (raw value clamped at +32767).

9.2 Field Troubleshooting Matrix

Symptom Probable Cause Remediation
Raw value stuck at -32768 (0 mA) Open loop / broken wire / transmitter unpowered Check loop supply, polarity, and field wiring continuity
Raw value stuck at +32767 (over-range) Short circuit or current > 22.81 mA Disconnect field side, verify transmitter output with multimeter
Reading fluctuates heavily EMI coupling, no shield, or ground loop Use shielded twisted pair, bond shield at panel end only, separate from VFD cables
Reading 4 mA but transmitter says 8 mA Burden voltage too high / loop compliance exceeded Increase supply voltage or reduce wire length
Reading correct but HART communication fails SM 1231 filters HART tones Switch to ET 200SP HA AI 4 x HART module or add external multiplexer
Reading inverted (20 mA = 0%, 4 mA = 100%) Channel scaling misconfigured Change range from 0-20 mA to 4-20 mA in TIA Portal
Negative value above 4 mA Bipolar scaling selected accidentally Confirm "unipolar" 4-20 mA range, not ±20 mA

10. Compliance With Industry Standards

  • NAMUR NE 43: defines standardized fault currents: < 3.6 mA = sensor failure, > 21 mA = sensor over-range. SM 1231's underflow/overflow flags align with NE 43 limits.
  • IEC 61131-2: covers PLC analog input signal levels and immunity; SM 1231 is type-tested to this standard.
  • ANSI/ISA 50.00.01: compatibility of analog signals with digital communication techniques (HART reference).
  • IEC 60529 (IP rating): SM 1231 must be installed in an enclosure rated to the operating environment. The bare module has no inherent IP protection.

Verify the latest revision of any standard against your project specification; values cited here reflect publicly available revisions at the time of writing.

11. Frequently Asked Questions

Is there a 4-20 mA AC standard?

No. 4-20 mA is a DC current-loop standard defined by IEC 60381-1 and refined by NAMUR NE 43. AC is not used for measurement signaling because the live-zero (4 mA) and direction-of-flow semantics require a unipolar DC value. If your sensor output is AC, rectify and filter it before wiring to the SM 1231.

Can the SM 1231 read HART signals from a field transmitter?

No. The standard SM 1231 (article numbers 6ES7231-4HD32-0XB0, -5ND32-0XB0, -5PD32-0XB0, -5QF32-0XB0, and -4HF32-0XB0) filters out the HART FSK modulation and only passes the DC loop current. For HART variable access, deploy an ET 200SP HA AI 4 x HART module (6ES7531-7RD00-0AB0) on a PROFINET network, or use an external HART-to-Modbus gateway.

What is the minimum SM 1231 supply voltage for a 4-20 mA loop?

Calculate VS ≥ VTX_min + (0.020 × Rloop) + 2.5 V. With a 12 V transmitter minimum and typical field wiring, 14.5-15 V is the absolute floor. A 24 V DC regulated supply is recommended to provide margin against temperature drift, surge events, and additional burden.

How do I scale a 4-20 mA signal in TIA Portal?

Enable the channel, set Measurement type = Current, set Range = 4 to 20 mA. The PLC returns 0 at 4 mA and 27648 at 20 mA. Apply the formula %Process = (raw / 27648) × 100 in your user program, or use the SCALE_X and NORM_X blocks from the standard library for direct engineering-unit scaling.

What fault indication does the SM 1231 give for a broken wire?

The raw integer drops to -32768 (underflow) when the loop current falls below ~1.185 mA. Combine this with the channel status word (Quality = BAD) to generate a wire-break alarm in your HMI or alarm subsystem. The exact threshold depends on the SM 1231 firmware revision; consult the device manual for the precise diagnostic current level.

Back to blog