Wiring S7-300 SM331 Potentiometer: Fix SF LED, Control ACS880

David Krause13 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

1. Overview

This reference walks through the full signal chain for a college / pilot build: panel-mounted push-buttons and a 10 kΩ potentiometer -> Siemens SIMATIC S7-300 analog input module SM331 (6ES7 331-7KF01-0AB0) -> SIMATIC S7-300 analog output module SM332 (6ES7 332-5HD01-0AB0) -> ABB ACS880 industrial drive -> three-phase asynchronous motor. The most common failure on first commissioning is the SM331 SF (group fault) LED lighting red and the CPU going to STOP, caused by a mismatch between the physical measuring range module on the side of the SM331 and the channel configuration in STEP 7 HW Config. Resolving the SF LED and producing a clean 0-10 V speed reference for the ACS880 is the focus of this article.

Important: The SF LED on a 6ES7 331-7KF01-0AB0 is almost never caused by the wiring itself. The default position from the factory is typically D (RTD / thermocouple) and must be physically moved to B for ±10 V voltage measurement on channel 0. STEP 7 cannot change the physical position of the range module; the module must be removed from the rail.

2. Prerequisites

  • SIMATIC S7-300 CPU 31x (e.g., 6ES7 314-1AG14-0AB0) with STEP 7 V5.5 or TIA Portal V15 and later.
  • SM331 AI8x12Bit, order number 6ES7 331-7KF01-0AB0 (8 channels, 12-bit resolution, isolated).
  • SM332 AO4x12Bit, order number 6ES7 332-5HD01-0AB0 (4 channels, 12-bit resolution).
  • 10 kΩ panel-mount potentiometer, linear taper, 0.5 W minimum.
  • 2 kΩ series resistor on the 24 V feed to the potentiometer (acts as a current limiter and produces a clean 0-10 V sweep across the wiper).
  • ABB ACS880-01 drive with firmware ASCI2 v2.32 or later (compat-checked against the analog reference chain in this article).
  • Three-phase asynchronous induction motor (e.g., 400 V Δ / 690 V Y, IE2 / IE3).
  • STEP 7 library "Standard Library -> TI-S7 Converting Blocks" containing FC105 (SCALE) and FC106 (UNSCALE).

3. Hardware: SM331 (6ES7 331-7KF01-0AB0) Channel Map

The module occupies 16 bytes of input area beginning at the configured start address. With the source project using PEW 288-303, the byte map for channels 0-7 is:

Channel Address (Word) Address (Byte) Range Module Pos.
CH0 PEW 288 PEB 288 / 289 B (10 V)
CH1 PEW 290 PEB 290 / 291 A (10 V)
CH2 PEW 292 PEB 292 / 293 A
CH3 PEW 294 PEB 294 / 295 A
CH4 PEW 296 PEB 296 / 297 A
CH5 PEW 298 PEB 298 / 299 A
CH6 PEW 300 PEB 300 / 301 A
CH7 PEW 302 PEB 302 / 303 A
Channel 0 has its own physical range module independent of channels 1-7. Channels 1-7 share a second range module on the same side of the housing.

4. Resolving the SF LED: Measuring Range Module Position

The SM331 6ES7 331-7KF01-0AB0 has a physical 4-position rotary selector (the "measuring range module") on the left side of the card. The factory default is position D which enables RTD / thermocouple measurement on all channels. If HW Config is set to "Voltage ±10 V" but the physical selector is on D, the module raises an module / channel fault, the SF LED turns red, and the diagnostic interrupt places the CPU in STOP with OB122 (I/O access error) or OB82 (diagnostic interrupt) pending.

Position Channel 0 type Channels 1-7 type
A Voltage ±10 V / 0-10 V Voltage ±10 V
B Voltage ±10 V (4-wire) Voltage ±10 V
C Current 4-20 mA Current 4-20 mA
D RTD / TC (default) RTD / TC

Procedure

  1. Power down the S7-300 rack. Remove the 24 V supply from the analog module.
  2. Unlatch the SM331 by depressing the top release tab and swing the module off the DIN rail. The module remains wired via the front connector if you leave the connector attached; it is easier to remove the front connector first.
  3. Locate the small black rotary selector on the left side of the module housing (when looking at the label).
  4. Use a small flat-blade screwdriver to rotate the selector so the arrow points to B for the CH0 potentiometer input. If you also use channels 1-7 for voltage, set the second selector (also visible on the same side) to A or B as required.
  5. Re-seat the module on the rail, restore the front connector, re-apply 24 V.
  6. Open HW Config, double-click the SM331, click Properties -> Inputs on channel 0, set: Measurement type = V, Range = +/-10 V, Integration = 50 Hz rejection (or 60 Hz if your mains is 60 Hz).
  7. Save & compile (Station -> Save and Compile) and download HW Config to the CPU.
  8. Switch the CPU from STOP to RUN. The SF LED should extinguish within 2-3 s.

For the official device manual covering the measuring range module, see the Siemens product page: SIMATIC S7-300 SM331 Manual.

5. Potentiometer Wiring (4-Wire Voltage Mode)

The wiring described in the source is the standard 4-wire voltage measurement topology for an external potentiometer fed from the SM331's 24 V sensor supply (terminal L+) through a 2 kΩ series resistor. The 4-wire approach uses the M terminal at the wiper end as a sense reference, eliminating voltage drop on the ground conductor.

Wire SM331 terminal Function
1 L+ (pin 1 of front connector, top row) +24 V sensor supply, in series with 2 kΩ resistor
2 Ch0+ pin 2 (terminal M+ on channel 0) Wiper signal, 0-10 V analog
3 Ch0- pin 3 (terminal M- on channel 0) Sense ground reference, ties back to M
4 M (pin 19 / pin 20 common) Bottom of potentiometer + chassis ground return
24V Supply +24V 0V (M) 2 kΩ 10 kΩ Pot SM331 CH0 Pin 1 L+ Pin 2 Ch0+ Pin 3 Ch0- Pin 20 M

Figure 1 — 4-wire potentiometer wiring to SM331 channel 0

Wiring notes
  • The 2 kΩ resistor is the upper leg of a 12 kΩ / 10 kΩ divider, giving a maximum wiper voltage of 24 V * 10 kΩ / 12 kΩ = 20 V if the pot fails open. To stay inside the SM331's ±10 V common-mode range, use a 10 kΩ pot with a 2 kΩ resistor and feed from the module's regulated L+ (typically 23.5-24 V). A common alternative is to feed from a 10 V reference and use a 5 kΩ pot, eliminating the resistor. Verify the resulting wiper voltage with a multimeter before applying to the module.
  • Twist the four wires as a single shielded cable; ground the shield at the cabinet entry only.
  • Pin 3 (Ch0-) MUST be tied back to M at the SM331 terminal block to establish the 4-wire sense reference. Floating Ch0- will produce a noisy / drifting reading and may trigger an over-range diagnostic.

6. SM332 Analog Output (6ES7 332-5HD01-0AB0) Configuration

The SM332 is mapped at PQW 304-311. Channel 0 (PQW 304) drives the ACS880 analog speed reference input (typically AI1 on the drive). Configure channel 0 as Voltage 0-10 V in HW Config; this matches the ACS880 default AI1 scaling and avoids bipolar noise on the wiper signal.

Channel Address (Word) Range
CH0 PQW 304 0-10 V (speed ref out)
CH1 PQW 306 0-10 V (torque ref, optional)
CH2 PQW 308 4-20 mA (process ref, optional)
CH3 PQW 310 4-20 mA (process ref, optional)

7. STEP 7 Programming: FC105 (SCALE) for the Wiper Input

FC105 converts the 12-bit raw input word (0-27648 for unipolar, -27648 to 27648 for bipolar) into an engineering range. With the SM331 configured for ±10 V, FC105 in bipolar mode is appropriate so that a small negative wiper offset (e.g., -0.2 V from thermal drift) maps cleanly to 0 rpm rather than producing a sign-extension glitch.

// FB100 / OB1 - wiper input scaling
CALL  "SCALE"  // FC105
     IN     := PEW288              // Raw 12-bit input from CH0
     HI_LIM := 1.0E+002            // Engineering max = 100.0 %
     LO_LIM := 0.0E+000            // Engineering min = 0.0 %
     BIPOLAR:= TRUE                // Bipolar for noise headroom
     RET_VAL:= MW100               // Return value (error code)
     OUT    := MD104               // LREAL scaled 0.0 - 100.0 %

// Clamp to physical ACS880 limit (e.g. 1500 rpm / 50 Hz)
L     MD104
LIMIT 0.0, 100.0                  // Clamp 0-100 %
T     MD112                        // Clamped speed demand %

FC105 error codes are written to RET_VAL:

RET_VAL (W#16#) Meaning
0000 No error
0007 HI_LIM == LO_LIM (divide by zero)
0008 LO_LIM > HI_LIM
0006 Raw value out of range and OUT clamped to LO_LIM

8. Mapping to the ACS880 Speed Reference

Two paths exist: (a) write the scaled value into PQW 304 so the SM332 generates 0-10 V to the drive, or (b) skip the SM332 and feed PEW 288 directly through PROFINET to the ACS880. Path (a) is the one used in the source and is the most portable for a college panel.

// Linear mapping 0.0 - 100.0 % to 0 - 27648 raw at SM332 CH0
L     MD112                       // 0.0 - 100.0 %
L     2.764800e+004               // 100.0 % = 27648 raw
*R    
RND
T     PQW304                      // SM332 channel 0 output

Equivalent STL without floating point (suitable for older 312 / 314 CPUs without real-time math):

// Integer scaling: 0-100 % in MW120, output 0-27648 in PQW304
L     MW120                       // 0 - 100
L     276                         // 27648 / 100
*D    
T     MW124
L     MW124
L     27648
>I    
T     PQW304

9. ABB ACS880 Parameter Configuration

With the SM332 output wired to ACS880 terminal block XAI (AI1+ = pin 2, AI1- = pin 3 on the BMIO-01 board), the drive must be told to interpret the 0-10 V input as a speed reference. Default values are shown; the full manual is at the ACS880 Firmware Manual.

Parameter Name Value Comment
10.24 AO1 source Motor speed rpm (103) Mirror speed to analog out for HMI
11.05 AI1 HI 10.000 V Upper trim
11.06 AI1 LO 0.000 V Lower trim
12.15 AI1 min 0.0 % Min scaled ref
12.16 AI1 max 100.0 % Full scale ref
12.25 AI1 scale 100.0 % Additional gain
22.11 Speed ref1 source AI1 scaled (6) Main reference
22.21 Constant speed function Disabled (0) Use analog ref only
23.01 Speed ref ramp input = 22.11 Wire ref to ramp
99.04 Motor ctrl mode DTC (0) Direct torque control
99.06 Motor nom current Nameplate A From motor plate
99.07 Motor nom voltage Nameplate V 400 / 690
99.08 Motor nom frequency 50 / 60 Hz From motor plate
99.09 Motor nom speed Nameplate rpm From motor plate
99.10 Motor nom power Nameplate kW From motor plate
Always run the ID run (99.13 = Standard or Reduced) before first motor movement. With the wiper at zero and start commands wired through safe push-buttons, the motor will command 0 rpm and the drive should show "Ready" in parameter 06.25.

10. Push-Button Logic (Direction + Start/Stop)

The wiper sets the speed setpoint; the push-buttons gate the run command and direction. A minimal logic block in LAD/ST is shown in ST:

// Latching start / stop (edge-triggered)
A     I 0.0                       // Start NO pushbutton
AN    I 0.1                       // Stop NC pushbutton
O     M 50.0                      // Latched run
=     M 50.0

// Direction select (1 = forward, 0 = reverse)
A     I 0.2                       // FWD pushbutton
S     M 50.1
AN    I 0.2
A     I 0.3                       // REV pushbutton
S     M 50.2
A     I 0.1                       // Stop clears direction
R     M 50.1
R     M 50.2

// Scale 0-100 % to ACS880 speed; inhibit when wiper < 5 % to avoid creep
L     MD112
L     5.0
>R    
JCN   NOOUT
L     MD112
T     PQW304
NOOUT: NOP 0

11. End-to-End Signal Flow

Pot (0-10V) SM331 AI PEW 288 S7 CPU FC105 SM332 AO PQW 304 ACS880

Figure 2 — End-to-end analog reference path

12. Troubleshooting Matrix

Symptom Likely Cause Action
SM331 SF LED red, CPU in STOP Range module in D (RTD) and HW Config set to Voltage Pull module, set left side selector to B, re-seat
SF LED red after idle period Wire break on 4-20 mA channel, or Ch0- floating Verify pin 3 tied to M; for current loops, check sensor loop
PEW 288 reads -32768 / 7FFF Over-range of ±10 V; wiper beyond end of travel Verify pot resistance and 24 V supply; trim with 2 kΩ series resistor
PEW 288 reads ~13824 (half scale) at zero wiper BIPOLAR=FALSE with negative offset Set BIPOLAR=TRUE on FC105 or use 0-10 V unipolar
Motor runs at half speed at full wiper SM332 channel configured 4-20 mA instead of 0-10 V HW Config -> AO0 -> set Voltage 0-10 V
ACS880 shows FAULT 0081 (AI loss) Wiper open-circuit, AI1 below 4 mA threshold Disable AI supervision (12.04) or set min voltage to 0.0 V
ACS880 speed hunts ±5 rpm SM332 output is being updated faster than drive scan time Cycle OB1 to 50 ms, or smooth MD112 with PT1 filter T#200ms
FC105 RET_VAL = 0007 HI_LIM == LO_LIM Verify 0.0E+000 / 1.0E+002 in instance DB
Drive does not respond to PQW 304 Drive in local mode (HMI control) Press LOC/REM on the ACS panel to select Remote

13. Verification Procedure

  1. With the drive in Ready and the wiper at minimum, verify PEW 288 = 0 and PQW 304 = 0 V with a multimeter on the SM332 terminals.
  2. Move the wiper to mid-scale. PEW 288 should read ~13824 (unipolar 0-10 V) or 0 (bipolar ±10 V). PQW 304 should read 5.00 V ±0.05 V.
  3. Move the wiper to full scale. PEW 288 should read 27648. PQW 304 should read 10.00 V ±0.05 V.
  4. On the ACS880 keypad, navigate to Group 01 and confirm 01.01 (Motor speed rpm) tracks 0 -> ~1500 -> 3000 rpm (depending on motor and parameter 12.16).
  5. Release the wiper to zero. The drive should ramp to 0 rpm along the deceleration ramp (23.02) and not fault.
  6. Toggle the FWD/REV push-buttons. The drive should respond within 50-100 ms (DTC cycle) and reverse without overcurrent trip (verify 01.10 = Motor torque stays below 150 % during reversal).

14. Frequently Asked Questions

Why does the SM331 SF LED stay red even though HW Config shows Voltage ±10 V?

The hardware configuration in STEP 7 only configures the firmware interpretation of the channel; the actual signal conditioning is selected by the physical rotary "measuring range module" on the left side of the SM331 housing. Default is position D (RTD). Power down, pull the module, rotate the selector to B for ±10 V, re-seat and re-apply 24 V.

Can I use a 5 kΩ potentiometer instead of 10 kΩ with the 2 kΩ series resistor?

Yes, but the divider ratio changes. With 5 kΩ pot and 2 kΩ series the max wiper voltage becomes 24 V * 5 kΩ / 7 kΩ = 17.1 V, which exceeds the SM331 input range. Either use a 10 V reference rail and a 5 kΩ pot without a series resistor, or stay with 10 kΩ + 2 kΩ on 24 V and verify the wiper voltage on the bench.

Do I need the SM332 at all if I can send the scaled value to the ACS880 over PROFINET?

No. ACS880 supports PROFINET IO and you can map a 16-bit word to parameter 22.11 directly using a PZD slot. The SM332 path is preferred only when the panel layout is hardwired (no fieldbus) or when you need galvanic isolation between the control cabinet and the drive.

The motor runs at exactly half the commanded speed regardless of wiper position - why?

Either parameter 12.16 (AI1 max) is set to 50.0 % instead of 100.0 %, or the SM332 channel is configured for ±10 V while the drive is configured for 0-10 V (the negative half of the SM332 range is producing a small drive command, but the drive interprets the same 0-10 V window twice). Set the SM332 channel to 0-10 V unipolar in HW Config.

Can the same 10 V wiper be shared between the SM331 input and an HMI speed indicator?

Not directly — the SM331 input is high-impedance but it does load the wiper slightly. For an HMI tap, buffer the wiper with an LM358 follower or use the SM332 AO as the HMI source. Parameter 10.24 on the ACS880 (Motor speed) can be wired to the SM332 AO1 (if your drive is wired back to the PLC) for a 0-10 V speed mirror without disturbing the wiper signal.

Back to blog