Siemens S7 Analog Input Calibration with FC105 SCALE Function

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

Overview: Why Calibrate Analog Inputs in a Siemens S7 System

Every Siemens S7 analog input card converts a continuously variable transmitter signal (typically 4-20 mA, 0-10 V, or a thermocouple/RTD millivolt level) into a 16-bit signed integer that the CPU stores in the process image. The relationship between the electrical signal and the engineering value (°C, bar, kg/h, m, etc.) is not hard-coded; it is reconstructed by the application program using a scaling function. In STEP 7 classic (S7-300/400), that function is FC105 "SCALE". In TIA Portal (S7-1200/1500), the equivalent is the pair NORM_X and SCALE_X.

"Calibrating" an analog input in a Siemens S7 system therefore has two distinct meanings that engineers frequently conflate:

  1. Field calibration of the transmitter. Inject a known physical stimulus (e.g. a dead-weight tester on a pressure transmitter), trim the transmitter zero and span, and verify the current loop reads 4 mA at LRV and 20 mA at URV.
  2. Application-level scaling. In the PLC, convert the integer returned by the analog module into the engineering unit the operator must see on the HMI. This is what FC105 / SCALE_X does and is the focus of this article.

Both layers are required. A perfectly trimmed transmitter feeding a wrongly scaled FC105 block will still display the wrong engineering value, and a perfectly scaled FC105 cannot fix a transmitter whose 4 mA is actually 4.12 mA.

Critical concept: FC105 is a software scaling function. It does not adjust the module's hardware. The module's A/D converter is factory-calibrated; the only field-level hardware calibration Siemens permits is the "user calibration" of the analog module (storing zero/gain trim values in the module's EEPROM), which is reserved for SM331/SM332 modules and is performed in HW Config. See the Siemens Support article "User calibration of analog modules" for the procedure.

Prerequisites

Before you start, confirm the following are available. Skipping any of these is the single most common cause of an FC105 that "does not work".

Item Specification Why it matters
Siemens MLFB of the analog input card e.g. 6ES7331-7KF02-0AB0 Identifies the resolution, supported ranges, and channel grouping. Without the MLFB, you cannot know the integer range (0-27648 vs. 0-32000 vs. ±27648) or the wiring method (2-wire vs. 4-wire transmitter).
Transmitter data sheet LRV/URV in engineering units; output type (2-wire/4-wire; passive/active) Provides the two physical values FC105 maps to its LO_LIM and HI_LIM inputs.
Calibration signal source Multi-function calibrator (Beamex MC6, Fluke 754, Transmation 1040, WIKA CPH7000) or at minimum a decade box and a stable 24 V supply for loop excitation Inject 4.000 mA, 12.000 mA and 20.000 mA to validate the scaled reading at 0%, 50% and 100% of range.
STEP 7 V5.5 / V5.6 (classic) or TIA Portal V15-V18 Project matching the CPU firmware FC105 lives in the "Standard Library → TI-S7 Converting Blocks" or in "Libraries → Standard Library".
STEP 7 hardware catalog (HW Config) Must contain the exact MLFB You must have configured the module with the correct measuring range at every channel group, otherwise the integer returned to the program is meaningless.
PLC in STOP or the channel disabled — Re-parameterising a live analog channel can drive the input to an undefined value for one scan.
Read the request carefully: if the only information you have is "I have a Siemens S7 and a 4-20 mA transmitter", you do not have enough information to calibrate. The original request that prompted this article asked for the card type, the measured variable, the software version and the sensor type. Provide these and the procedure becomes mechanical.

Identifying the Siemens Analog Input Card: MLFB Decode

Siemens uses the MLFB ("Machine-Readable Product Designation") on every analog module. The first three groups (digits 1-7) identify the product family. The following groups encode the channel count, resolution, galvanic isolation, and diagnostic level. Decoding the MLFB is mandatory because two SM331 variants with the same slot width can have very different resolutions and ranges.

Common S7-300 SM331 MLFBs

MLFB Channels Resolution Galvanic isolation Common use
6ES7331-1KF02-0AB0 8 AI (4 in 4-wire RTD mode) 13-bit + sign No General-purpose voltage / current / RTD
6ES7331-7HF01-0AB0 8 AI 14-bit Yes High-accuracy voltage / current / TC / RTD
6ES7331-7KF02-0AB0 8 AI 12/13/14-bit (depending on integration time) Yes The "default" SM331; most greenfield installations use this one
6ES7331-7KB02-0AB0 2 AI 9/12/14-bit No Cost-optimised for thermocouples
6ES7331-1KF01-0AB0 8 AI 12-bit No Legacy / spare replacement only

For the 6ES7331-7KF02-0AB0, the analog-to-digital resolution is selectable per channel group through HW Config (50 Hz interference suppression, integration time 20 ms → 15-bit + sign; 60 Hz → 15-bit + sign; 400 Hz → 12-bit + sign; 1000 Hz → 12-bit). The integer scale 0-27648 (unipolar) or ±27648 (bipolar) is independent of this integration time.

Common S7-400 and ET 200M SM331 / SM332 MLFBs

MLFB Family Notes
6ES7331-7NF00-0AB0 S7-300 / ET 200M 8 AI, 16-bit, isolated, with diagnostics
6ES7331-7NF10-0AB0 S7-300 / ET 200M 8 AI, 16-bit, isolated, extended diagnostics, supports HART
6ES7332-5HF00-0AB0 S7-300 / ET 200M 8 AO, 12-bit, isolated
6ES7331-7PE10-0AB0 S7-300 / ET 200M 6 AI for Ex area, intrinsically safe
6ES7331-7RD00-0AB0 S7-300 / ET 200M 4 AI, 16-bit, isolated, with diagnostics

For S7-1500, the equivalents are the AI 8×U/I/RTD/TC ST (6ES7531-7KF00-0AB0) and AI 8×U/I/R/RTD/TC HF (6ES7531-7PF00-0AB0), programmed with the TIA Portal NORM_X / SCALE_X block pair. For S7-1200, the SB and SM analogue modules (e.g. 6ES7231-4HF32-0XB0) are scaled the same way. For the older S7-200, FC105 is not available; S7-200 uses the S_R and S_RTI instructions in Micro/WIN to perform an equivalent scaling.

Understanding the 4-20 mA Signal and the PLC Integer Range

A 4-20 mA current loop is preferred over 0-20 mA in process plants because 4 mA is "live zero": a wire break reads 0 mA, which is below the 4 mA LRV, allowing the PLC to detect a broken loop. The Siemens SM331 digitises this current into one of three integer ranges depending on the measuring range configured in HW Config:

Engineering signal PLC integer (unipolar, nominal) Overflow Underflow
0-20 mA 0 to 27648 >23.515 mA → 32767 —
4-20 mA 0 to 27648 >22.81 mA → 32767 <1.185 mA → -32768 (or 0 in overrange-masked firmware)
±20 mA -27648 to +27648 — —
±10 V -27648 to +27648 — —
0-10 V 0 to 27648 >11.76 V → 32767 —
±5 V -27648 to +27648 — —
0-5 V 0 to 27648 >5.88 V → 32767 —

For an S7-300 SM331 in the 4-20 mA range, the linear relationship is:

I (mA) = 4 + (16 / 27648) × N

N = (I - 4) × 27648 / 16

where N is the integer stored in the process image. A typical input word for channel 0 of an SM331 starts at PIW 256 for a 16-slot S7-300, but the actual address depends on slot and configuration. The simplest way to find it is to open HW Config, click the analogue module, and read the "I address" column. The default value of an unconnected input is 0x7FFF (32767), and a wire break in 4-20 mA range is reported as 0x8000 (-32768) by newer SM331 firmware; check the module's diagnostic buffer before assuming wiring is correct.

Resolution and integration time

The SM331 offers four integration times per channel group. Longer integration times give higher A/D resolution and better mains-frequency rejection at the cost of a slower update rate:

Interference suppression Integration time Effective resolution Channel update time (8-ch group)
50 Hz 20 ms 15 bits + sign 160 ms (8 × 20 ms)
60 Hz 16.67 ms 15 bits + sign 133 ms
400 Hz 2.5 ms 12 bits + sign 20 ms
1000 Hz 1 ms 12 bits + sign 8 ms

For European process plants (50 Hz mains), choose 50 Hz interference suppression. The 20 ms integration time is the correct default for 99 % of process measurements. The 1000 Hz setting is reserved for fast signals such as dynamic pressure or vibration monitoring.

FC105 "SCALE" Function: Parameter Reference

FC105 lives in the STEP 7 standard library. It converts the integer from the analog input into a REAL value in engineering units, clipping the result to the high and low limits and indicating overflow.

Call interface

CALL  FC  105
  IN     :=   MW 100        // INT   - raw integer from PIW
  HI_LIM :=   MD 110        // REAL  - upper engineering value (e.g. 100.0 for 100 °C)
  LO_LIM :=   MD 114        // REAL  - lower engineering value (e.g. 0.0 for 0 °C)
  BIPOLAR:=   M 10.0        // BOOL  - FALSE for unipolar 4-20 mA; TRUE for ±10 V / ±20 mA
  RET_VAL:=   MW 120        // WORD  - return value; 0 = no error
  OUT    :=   MD 130        // REAL  - scaled output, clipped to [LO_LIM, HI_LIM]

Parameter table

Parameter Type Input/Output Meaning Typical value for 4-20 mA → 0-100 °C
IN INT Input Raw integer from the analog input (process image word). PIW 304 (channel 0 of an SM331 in slot 4)
HI_LIM REAL Input Engineering value that corresponds to the upper end of the integer range. The function uses the integer 27648 (unipolar) or 27648 (bipolar high side). 1.000000e+002 (= 100.0 °C)
LO_LIM REAL Input Engineering value that corresponds to the lower end of the integer range. The function uses the integer 0 (unipolar) or -27648 (bipolar low side). 0.000000e+000 (= 0.0 °C)
BIPOLAR BOOL Input FALSE = unipolar (IN range 0 to 27648). TRUE = bipolar (IN range -27648 to +27648). FALSE (for 4-20 mA)
RET_VAL WORD Output Return value. Always 0 for FC105; FC105 does not flag errors. Use it as a word tag and watch for non-zero values only if you have wrapped FC105 in a custom FB that does. W#16#0000
OUT REAL Output Scaled engineering value. Clipped to [LO_LIM, HI_LIM]. Above-range inputs above 27648 saturate to HI_LIM (unipolar) or are read as the overflow integer; below-range inputs similarly saturate to LO_LIM. MD 130 (e.g. 73.5 °C)

Internal scaling formula

FC105 implements:

OUT = [ (IN - IN_lo) / (IN_hi - IN_lo) ] × (HI_LIM - LO_LIM) + LO_LIM

For unipolar: IN_lo = 0, IN_hi = 27648. For bipolar: IN_lo = -27648, IN_hi = +27648.

For 4-20 mA → 0-100 °C with BIPOLAR = FALSE and an input of 13824 (50% of range):

OUT = (13824 - 0) / 27648 × (100.0 - 0.0) + 0.0 = 50.0

Common mistake: programmers who do not realise FC105 internally anchors to 0 and 27648 will pass 4 and 20 in HI_LIM/LO_LIM "because the signal is 4-20 mA". This produces an output of 4 to 20 (the same number as the current). The correct LO_LIM/HI_LIM are the engineering units, e.g. 0.0 and 100.0 °C.

Overflow and underflow behaviour

FC105 saturates. If IN is greater than 27648 (unipolar), OUT is clamped to HI_LIM and the overflow is not reported in RET_VAL. To detect overflow you must examine IN directly. A typical pattern is:

// Detect overflow on channel 0
// PIW 304 holds the raw integer for the channel

L     PIW 304          // load raw input
L     27648            // compare to nominal max
>I                      // 304 > 27648 ?
=     M 10.1            // M 10.1 = overflow flag

// Detect wire break on 4-20 mA
L     PIW 304
L     0
<I                      // 304 < 0  ?
=     M 10.2            // M 10.2 = underflow / wire-break flag

Many newer SM331 modules report wire break in the diagnostic buffer instead of as a negative integer. The exact behaviour depends on firmware; consult the module's manual at Siemens Industry Online Support for the firmware version installed.

RET_VAL semantics and word-mapped status

FC105 does not have detailed error codes like SFB / SFC blocks (e.g. SFC51 returns W#16#8xxx on parameter error). The RET_VAL of FC105 is documented as always W#16#0000 in normal operation. If a programmer is reading a non-zero value, the most common root causes are:

RET_VAL observed Hex interpretation Likely cause
0 W#16#0000 Normal operation.
32640 (decimal) 0x7F80 Floating-point overflow during scaling (HI_LIM or LO_LIM is infinite / out of REAL range).
-32768 (decimal) 0x8000 Underflow; the scaled REAL is below LO_LIM (rare; usually HI_LIM/LO_LIM are reversed).
0x7FFF 32767 The CALL is reading the raw PIW, not the FC105 return, due to a tag assignment mistake.

Step-by-Step FC105 Implementation in STEP 7 V5.x

Assume a S7-300 CPU315-2 PN/DP with an SM331 (6ES7331-7KF02-0AB0) in slot 4. The transmitter is a 2-wire 4-20 mA pressure transducer, 0-10 bar, powered from the module's 24 V sensor supply. Channel 0 is wired to the transmitter.

Step 1 — Open HW Config and configure the analog channel

  1. In SIMATIC Manager, open the S7 project, then HW Config.
  2. Click the SM331 in slot 4.
  3. Double-click the module to open the properties dialog.
  4. Select Inputs tab → click ... for channel group 0 (channels 0-1).
  5. Set Measuring range to "I (current), 4DMU" → "4-20 mA".
  6. Set Integration time to "50 Hz (20 ms)" for mains-frequency-rejection in EU plants. This selects 15-bit + sign resolution.
  7. Under Diagnostics, enable Wire break and Overflow / underflow.
  8. Click OK → OK → save and compile (Station → Save and Compile).
  9. Read the input address for channel 0 in the "I address" column. Typical value: PIW 304.

Step 2 — Copy FC105 from the standard library

  1. In SIMATIC Manager, expand the Libraries tree.
  2. Open Standard Library → TI-S7 Converting Blocks.
  3. Drag FC105 into your Blocks container in the S7 program.
  4. Open the FC105 instance (the icon) and inspect the interface declaration. Do not modify the FC; it is write-protected.

Step 3 — Declare instance tags

In the symbol table or in the DB used for the call, declare the following tags. The defaults are written here for a 0-10 bar transmitter:

// Symbol table
PIW_304       PIW 304        // raw input from channel 0
RAW_INPUT     MW 100         // copy of PIW 304 in INT form
PHYS_HIGH     MD 110         // REAL  10.0   (bar @ 20 mA)
PHYS_LOW      MD 114         // REAL   0.0   (bar @ 4  mA)
BIPOLAR_FLAG  M 10.0         // FALSE for 4-20 mA unipolar
FC105_RET     MW 120         // FC105 return value (always 0)
PRESS_BAR     MD 130         // scaled pressure in bar
OVER_RANGE    M 10.1         // overflow flag
UNDER_RANGE   M 10.2         // wire-break / underflow flag

Step 4 — Implement the call in OB1 (or a periodic OB)

// Copy raw input word into a memory word (some CPUs do not allow
// direct PIW access at FC inputs in older STEP 7 versions; copy
// is always safe).
L     PIW 304
T     MW 100

// Detect overflow (input > 27648 means > 20 mA, i.e. out of range)
L     MW 100
L     27648
>I
=     M 10.1

// Detect underflow / wire break (input < 0 in 4-20 mA mode)
L     MW 100
L     0
<I
=     M 10.2

// Call the SCALE function
CALL  FC   105
  IN     :=   MW 100
  HI_LIM :=   MD 110
  LO_LIM :=   MD 114
  BIPOLAR:=   M 10.0
  RET_VAL:=   MW 120
  OUT    :=   MD 130

Step 5 — Download and verify in online mode

  1. Connect to the CPU (PLC → Download).
  2. Switch the CPU to RUN-P.
  3. Open Monitor / Modify on OB1.
  4. Force a known signal at the transmitter: with the calibrator in "source" mode, inject 4.000 mA, 12.000 mA and 20.000 mA.
  5. Watch MW 100 (raw), MD 130 (scaled) and the overflow / underflow flags.

Wiring the 2-Wire 4-20 mA Transmitter to SM331

The SM331 has removable front connectors with screw or spring terminals. For a 2-wire transmitter (most pressure, level, and temperature transmitters in process plants), the SM331's 24 V sensor supply can power the loop. Pin numbering varies by SM331 variant; for the 6ES7331-7KF02-0AB0, the standard wiring of channel 0 is:

SM331 front connector Pin 2 : +24V (sensor supply) Pin 3 : M (sensor ground) Pin 4 : AI0+ (channel 0 +) Pin 5 : AI0- (channel 0 -) Pin 6..10 : not used (ch1) Shield clamp at cable entry 2-wire 4-20 mA TX + : loop + (powered) - : loop - (return) [ IN process connection ] LRV / URV per data sheet Tension: 11-30 V at terminals +24 V (from sensor supply) 4-20 mA loop return (AI0+)

For a 4-wire (actively powered) transmitter, the transmitter has its own 230 V / 24 V supply and outputs the current on two separate wires that are connected to AI0+ and AI0-. In that case pins 2 and 3 are not used. The 4-wire configuration is the most common for high-accuracy Coriolis flowmeters and magmeters.

Grounding: never bond both ends of the shield to ground. Ground one end at the cabinet entry, leave the other end floating. Use a cable with an overall shield and a dedicated drain wire; the SM331 connector has a shield clamp for this purpose.

Loop resistance budget

The 4-20 mA loop must be sized so the total loop resistance does not exceed the transmitter's compliance. For a 2-wire loop powered by the SM331 24 V sensor supply:

V_loop = V_supply - V_transmitter_min - (I × R_total)

For 24 V supply, 12 V transmitter minimum, 20 mA, and 50 Ω SM331 input:

R_wire_max = (24 - 12) / 0.020 - 50 = 550 Ω

Beyond 550 Ω of cable resistance the transmitter saturates and the loop reading becomes non-linear. With Belden 8760 (38 Ω/km) this is good for runs up to ~14 km, but most plants are far below this. For long runs use a 4-wire transmitter.

Verification and Acceptance Test

The instrument loop must be validated at five test points. A pass on all five is required by most plant commissioning procedures (see also the routine described in "Implementing a PLC Calibration Routine to Ensure Accurate Instrument Readings" from AutomationDirect's library).

Step Inject Expected raw (MW 100) Expected scaled (MD 130) Tolerance
1 4.000 mA 0 ± 1 LSB 0.000 bar ± 0.005 ±0.1 % of span
2 8.000 mA 6912 ± 1 LSB 2.500 bar ± 0.005 ±0.1 % of span
3 12.000 mA 13824 ± 1 LSB 5.000 bar ± 0.005 ±0.1 % of span
4 16.000 mA 20736 ± 1 LSB 7.500 bar ± 0.005 ±0.1 % of span
5 20.000 mA 27648 ± 1 LSB 10.000 bar ± 0.005 ±0.1 % of span

The tolerance depends on the loop components. For a typical industrial pressure transmitter and an SM331 at 20 ms integration, expect 0.1 % of span. For a precision lab transmitter and an SM331 with 100 ms integration, 0.05 % is achievable. If the loop fails, walk through the troubleshooting matrix below before adjusting the transmitter's zero or span.

Troubleshooting Matrix: FC105 and the Analog Channel

Symptom Most likely cause Diagnostic step Fix
OUT always equals HI_LIM BIPOLAR flag wrong, or HI_LIM/LO_LIM inverted, or signal is being driven by a faulty transmitter Monitor MW 100 raw; if 32767, the input is in overflow. Check field wiring and transmitter. Correct BIPOLAR flag, swap HI_LIM and LO_LIM if the range is descending, or repair the transmitter.
OUT always equals LO_LIM Wire break, open circuit, or transmitter in safe state Measure current in the loop with a clamp meter. Expect 4 mA minimum. Re-seat the front connector; check polarity; check the 24 V sensor supply fuse on the SM331.
OUT drifts by a few % of span EMI / no shield, or 50/60 Hz interference Check shield bonding; switch integration time from 2.5 ms to 20 ms in HW Config. Improve shield bonding; set integration time to match the mains frequency.
OUT is correct at 4 mA and 20 mA but wrong at mid-scale Transmitter non-linearity; or FC105 high/low limits are wrong Re-read transmitter data sheet; verify HI_LIM/LO_LIM are in engineering units, not in mA. Set HI_LIM/LO_LIM to the LRV/URV from the data sheet.
OUT jumps by 100 LSBs every cycle Cross-talk from a digital output or a VFD on the same cable tray Measure the loop with an oscilloscope. Route the analogue cable in a separate tray; use twisted pair with overall shield; add 24 V DC ripple filter on the transmitter supply.
RET_VAL ≠ 0 FC105 is being called with mismatched parameter types Check the data types of IN, HI_LIM, LO_LIM and OUT in the caller. Re-declare the tags with correct types (INT for IN, REAL for the limits, REAL for OUT, BOOL for BIPOLAR).
MW 100 reads 32767 with nothing connected Open input; SM331 6ES7331-7KF02 returns 7FFF when nothing is wired (default value) Check the wiring; check HW Config for "open input" handling. Wire the transmitter; if intentionally unused, configure that channel as "disabled" in HW Config.
MW 100 reads -32768 on 4-20 mA wire break Newer SM331 firmware maps wire break to underflow Check the diagnostic buffer: PLC → Module Information → Diagnostic Buffer. Trap M 10.2 in the program and surface a "wire break" alarm on the HMI.
FC105 OUT is correct at the HMI but the field device is wrong Loop powered from the wrong supply (e.g. the panel 24 V rather than the SM331 sensor supply) and the two grounds differ Measure the voltage at the transmitter terminals; check that the panel 24 V and the SM331 24 V share a ground reference. Move the loop to the SM331 sensor supply, or bridge the grounds at one point only.
OUT reads 0 regardless of signal Wrong PIW address used (e.g. PIW 256 instead of PIW 304) Cross-check HW Config "I address" against the symbol used in OB1. Correct the PIW address in the call and in the copy statement.
OUT is the wrong unit (e.g. °F instead of °C) Transmitter LRV/URV in °F, FC105 limits set in °C, no conversion block Compare the data sheet to the LO_LIM/HI_LIM constants. Insert a conversion FB (F = C × 9/5 + 32) on the FC105 output.
FC105 OUT floats and never settles AI channel group is configured as voltage but wired as current, or vice versa Open HW Config → Inputs → check measuring range. Set the channel group to "4DMU" (current 4-20 mA).

TIA Portal Equivalent: NORM_X and SCALE_X

In TIA Portal V14+ (S7-1200 / S7-1500), FC105 is replaced by the function pair NORM_X and SCALE_X, found in "Instructions → Basic Instructions → Converter operations". NORM_X normalises the integer to a 0.0-1.0 REAL (or -1.0 to +1.0 for bipolar), and SCALE_X maps that normalised value into engineering units. The split has one practical advantage: you can clamp the normalised value before scaling.

NORM_X call

NORM_X(
  TAG   := PIW_304,        // INT
  MIN   := 0,              // INT - low end of input range
  VALUE := 27648,          // INT - high end of input range
  // RET_VAL not used on TIA NORM_X
  OUT   := "DB1".NORM_OUT  // REAL 0.0 to 1.0
);

SCALE_X call

SCALE_X(
  MIN   := 0.0,            // REAL - engineering low (e.g. 0 bar)
  TAG   := "DB1".NORM_OUT, // REAL 0.0 to 1.0
  MAX   := 10.0,           // REAL - engineering high (e.g. 10 bar)
  OUT   := "DB1".PRESS_BAR // REAL scaled value
);

For bipolar signals set the MIN of NORM_X to -27648 and the VALUE to 27648; SCALE_X then expects a normalised input in the -1.0 to +1.0 range.

The S7-1500 analogue modules (e.g. AI 8×U/I/RTD/TC ST 6ES7531-7KF00-0AB0) and the AI 8×U/I/R/RTD/TC HF (6ES7531-7PF00-0AB0) support value status; the LSB of the input word carries quality information. With value status enabled, the HMI can distinguish "value is good" from "value is bad" without inspecting the diagnostic buffer. See the S7-1500 analog module manual at Siemens Industry Online Support for the value-status bit positions.

Program flow for the SCALE_X pair

PIW 304 NORM_X → 0.0..1.0 SCALE_X → 0.0..10.0 bar HMI

Field Calibration Best Practices

  1. Always start with HW Config. Most "FC105 does not work" tickets are resolved by correcting the measuring range in HW Config. Open the module's properties → Inputs and verify the per-channel range matches the wired signal.
  2. Use 50 Hz integration time in 50 Hz countries, 60 Hz in 60 Hz countries. 1000 Hz (the fastest integration time) gives the lowest noise rejection and is rarely correct for a process measurement.
  3. Wire break check. Before scaling, verify the transmitter can be disconnected. With a 4-20 mA loop the PLC should report underflow (-32768 on newer firmware) within 200 ms.
  4. Loop resistance budget. A 4-20 mA loop is 24 V minus the transmitter's minimum voltage minus the loop resistance. At 24 V, the SM331 6ES7331-7KF02-0AB0 sensor supply can deliver approximately 200 mA total across all channels; total loop resistance must stay below 600 Ω to maintain compliance. The receiver input is 50 Ω.
  5. Document the FC105 instance in the loop sheet: MLFB, slot, channel, input address, transmitter tag, LRV, URV, engineering unit, FC105 instance DB, output tag, calibration date and technician initials.
  6. Use a 5-point test, not just 2 points. Many problems (non-linearity, EMI, ground loops) only show up between 4 mA and 20 mA.
  7. Calibrate in RUN-P with the HMI in operator mode. An accidental write to the FC105 HI_LIM from the HMI can corrupt the scaling for a shift. Lock FC105 parameter tags against operator writes.
  8. One FC105 per channel. Do not call FC105 twice with different HI_LIM/LO_LIM on the same PIW in the same OB; the second call will overwrite the first.
  9. For HART transmitters, do not scale with FC105 alone. The HART PV is not the same as the analogue current. Either use the HART data block from the HART module (ET 200SP HART AI, 6ES7134-6TD00-0CA1) or scale the analogue current with FC105 and reconcile the HART PV on the HMI.
  10. Periodically re-verify with a calibrator (annually in process plants, semi-annually in SIS / safety-instrumented applications). The SM331 has a documented long-term drift of 0.1 % of span / 12 months for the 4-20 mA range at 25 °C; transmitters usually drift more.

Alternate Platforms: S7-200 / S7-1200 / S7-1500

Platform Function Library path Notes
S7-200 (Micro/WIN) S_R, S_RTI Standard instructions Integer scaling, no REAL; uses math library.
S7-300/400 (STEP 7 V5.x) FC105, FC106 Standard Library → TI-S7 Converting Blocks Classic implementation; INT in, REAL out.
S7-1200 (TIA Portal) NORM_X / SCALE_X Basic Instructions → Converter operations Two-block pair, REAL arithmetic.
S7-1500 (TIA Portal) NORM_X / SCALE_X Basic Instructions → Converter operations Same as S7-1200, with value status support.
ET 200SP (TIA Portal) NORM_X / SCALE_X on AI 4×U/I/RTD/TC (6ES7134-6GD00-0BA1) or AI 4×I 2-/4-wire (6ES7134-6HD00-0BA1) Basic Instructions Module-level scaling is also available; FC105-style scaling can be turned off in the module's properties.

For a brownfield migration from S7-300 to S7-1500, the S7-300 FC105 call can be replaced mechanically with a NORM_X → SCALE_X block pair in the TIA Portal library "S7-300 migration → FC105 replacement". The conversion is one-to-one; the integer 0/27648 anchors to the NORM_X MIN/VALUE pair.

Safety: if the analogue input is part of a safety function (SIL 2 / SIL 3 per IEC 61508), the module must be a Failsafe variant (e.g. SM336 6ES7336-1HE00-0AB0 or the S7-1500 F-AI modules). The FC105 is not a safety function; it is a converter. Do not use the scaled value for a safety trip without an additional safety barrier and a separate voted analogue input.

What is the difference between FC105 and FC106?

FC105 ("SCALE") scales an analog input integer to a REAL engineering value. FC106 ("UNSCALE") does the reverse: it takes a REAL engineering value and converts it to the integer that the analog output card expects. They are inverses. Use FC105 when reading PIW from an SM331, and FC106 when writing to a PQW on an SM332.

Why does FC105 always return 0 in RET_VAL even when something is wrong?

FC105 does not have detailed error codes. It only reports through RET_VAL that the call itself succeeded; the function does not validate that HI_LIM and LO_LIM make sense, that the raw integer is in range, or that the signal type matches the BIPOLAR flag. To detect overflow or underflow you must inspect the raw input (PIW) directly and compare it to 0 and 27648.

What integer range should I use for a 4-20 mA signal?

For an S7-300 SM331 (6ES7331-7KF02-0AB0) configured for 4-20 mA, the integer range is 0 to 27648 nominal. Inputs above 22.81 mA read 32767 (overflow), and inputs below 1.185 mA read -32768 (wire break / underflow). BIPOLAR is FALSE.

Can I use FC105 on an S7-1200 or S7-1500?

No. FC105 only exists in STEP 7 V5.x and is tied to the S7-300 / S7-400 libraries. On S7-1200 / S7-1500 use the TIA Portal blocks NORM_X and SCALE_X, which perform the same conversion with a clearer parameter list.

Do I still need to calibrate the module hardware?

No, not in most plants. The SM331 is factory-calibrated; the field does not need to re-trim the A/D. A "user calibration" (storing custom zero/gain values in the module's EEPROM) is available for SM331 / SM332 modules and is documented in Siemens Support article 109768094. It is reserved for high-accuracy applications (e.g. metrology labs) and requires a more accurate reference than the field calibrator.

Back to blog