Troubleshooting Siemens FC105 SCALE Fix S7-300 CPU STOP on Enable

David Krause17 min read
HMI ProgrammingSiemensTroubleshooting
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

Problem Description

Calling Siemens FC105 "SCALE" in a STEP 7 Classic v5.x project for an S7-300 or S7-400 CPU causes the CPU to drop into STOP the instant the EN input of the block is driven to logic 1. The block is wired with the following parameters in the LAD/FBD editor:

  • IN = PIW752 (process input word from a 4-20 mA analog-input module)
  • HI_LIM = 5.000000e+001 (50.0 engineering units)
  • LO_LIM = 1.000000e+000 (1.0 engineering units)
  • BIPOLAR = 0 (unipolar raw range 0…27648)
  • RET_VAL = MW100
  • OUT = MD110 (REAL storage location)
  • Called from FB4 (with associated instance DB)

ENO appears as a straight pass-through line; no comparator, no F-network, no additional logic. The user has already verified that PIW752 increments when the 4-20 mA loop current is raised (confirmed in a VAT). Despite this, the CPU will not stay in RUN once EN transitions to TRUE.

The behavior is consistent across all FC105 calls in the project, including test calls placed directly in OB1. The diagnostic buffer on the CPU records an event related to a missing block at the moment the call site is executed.

Root Cause Analysis

FC105 is a Siemens-supplied function, not a user-authored block. It is part of the Standard Library > TI-S7 Converting Blocks shipping set in STEP 7 Classic v5.x. Like every other block referenced by a user program, the FC105 code object must exist in load memory and work memory of the CPU and be downloaded as part of the active S7 program. If the online program does not contain a runnable copy of FC105, the CPU raises OB121 (programming error) when execution attempts to fetch the missing block, and falls into STOP if OB121 is not loaded as the error handler.

The diagnostic buffer almost always reports "Block not found" or "Block FC105 not loaded" in this scenario, which is the symptom observed in the source case.

Other root causes, in order of likelihood when the symptom is "CPU STOP on first EN=1":

  1. FC105 not downloaded to the CPU — most common. Offline Blocks container shows FC105, but online container is missing it.
  2. Instance DB for FB4 not downloaded — the call from FB4 has no DB to instantiate, and the CPU raises OB121 on the call site.
  3. PIW752 not configured in HW Config — the slot is empty, wrong module type, or the input range is set to a type that does not match the field wiring (e.g., ±10 V when the loop is 4-20 mA).
  4. OUT (MD110) overlaps reserved memory — a system data block, an instance DB, or a bit-memory range reserved by STEP 7 maps to the same byte offset.
  5. Module mismatch — the analog-input module is configured for a bipolar range but the user passes BIPOLAR=0, or vice versa; FC105 itself accepts the parameter but RET_VAL is non-zero and ENO goes FALSE on every cycle.
  6. OB121 not loaded — the CPU therefore falls to STOP instead of just lighting the SF LED. This compounds the visibility of any latent programming error.
Critical: An error message referencing "OB101" in the diagnostic buffer is a red herring. OB101 is a restart OB, not an error handler. The error OBs are OB121 (programming error) and OB122 (I/O access error). Confirm the OB number carefully before acting on the buffer entry.

Diagnostic Procedure: Reading the Diagnostic Buffer

The diagnostic buffer is the single fastest source of truth for "why is the CPU in STOP." Open the buffer in STEP 7 with the project online:

  1. In SIMATIC Manager, expand the S7 program and select the "Blocks" folder.
  2. From the menu, choose PLC > Module Information (or right-click the CPU in the project tree and select "Module Information").
  3. Click the Diagnostic Buffer tab.
  4. Read the topmost event first; it is the most recent. Note the OB that was triggered and the block number the CPU tried to load.
  5. Click "Open Block" on the event to jump to the offending call site, when STEP 7 can resolve the offline/online mismatch.
  6. Click "Help on Event" to read the Siemens description of the event code.

Typical events seen in this fault mode:

  • "Block FC105 not found" / "Stop due to missing block" — FC105 not downloaded. Direct match for this article.
  • "OB not loaded" — usually OB121. The error occurred but the error handler is absent, so the CPU fell to STOP. Add OB121 to the S7 program.
  • "Area length error reading" followed by a PIW address — the input word is not assigned to any module in HW Config.
  • "I/O access error" (OB122) — same as above, classified differently by the CPU firmware.

Validate the input address independently:

  1. Open or create a VAT (Variable Table) — menu PLC > Monitor/Modify.
  2. Add PIW752 in INT format.
  3. Toggle "Monitor" (the spectacles icon). The raw integer should sweep 0 to 27648 as the 4-20 mA loop current is raised across its full span.
  4. If the value is pinned at 0 or 32767, the wiring or HW Config slot assignment is wrong; FC105 is not the problem.

Verify the block inventory on the CPU versus the offline project:

  1. In SIMATIC Manager, select the S7 program.
  2. Right-click and choose PLC > Compare Blocks (Online/Offline).
  3. STEP 7 lists any blocks that exist offline but are missing online, or vice versa. FC105 and the FB4 instance DB will be flagged here if they have not been downloaded.

Step-by-Step Recovery Solution

Apply the corrective actions in the order they appear. Test after each step. Each step is independent of the others and can be applied in isolation if a root cause is already known.

Step 1 — Confirm FC105 exists in the offline program

In the offline Blocks container of the S7 program, look for "FC105" with the standard yellow FC icon. If the icon is missing, FC105 was never inserted into the project. To add it:

  1. Open the Libraries task pane in SIMATIC Manager (View > Library if it is hidden).
  2. Browse to Standard Library > TI-S7 Converting Blocks.
  3. Drag FC105 "SCALE" into the offline Blocks container of the S7 program.

Reference: SiePortal — How can I add FC105 in program?

Step 2 — Download the missing blocks to the CPU

  1. In SIMATIC Manager, select the S7 program's Blocks folder.
  2. Choose menu PLC > Download, or right-click and choose "Download to Target Station".
  3. In the download dialog, enable "Overwrite all" to force a clean download of FC105, OB121 (if added), and the FB4 instance DB.
  4. Wait for the download progress dialog to complete; the CPU momentarily goes to STOP and returns to RUN.
Caution: If "Overwrite all" is unchecked, STEP 7 may skip FC105 because the offline timestamp equals the online timestamp of an empty placeholder. Always force the overwrite when a system block is suspected missing.

Step 3 — Load OB121 (recommended for production)

OB121 is the programming-error OB. Loading it allows the CPU to stay in RUN if FC105 is ever called with bad parameters; the SF LED lights and the diagnostic buffer records the event, but the process keeps running. Pair OB121 with OB122 (I/O access error) for a complete error-handling OB set.

  1. Drag OB121 from Standard Library > System Blocks into the S7 program.
  2. Leave the body empty (the default). The presence of the OB is what matters; STEP 7 enters it automatically.
  3. Download OB121 to the CPU along with the rest of the program.

Step 4 — Eliminate the FB4 dependency for baseline testing

If the call to FB4 introduces an unknown (for example, the instance DB for FB4 is wrong or absent), place FC105 directly in OB1 for a controlled test:

  1. Open OB1.
  2. Insert a new network. From the program elements catalog, navigate to Libraries > Standard Library > TI-S7 Converting Blocks > FC105 SCALE.
  3. Wire the same parameters (PIW752, HI_LIM=50.0, LO_LIM=1.0, BIPOLAR=0, RET_VAL=MW100, OUT=MD110).
  4. Save, download, and toggle EN=1. If the CPU stays in RUN, the FB4 path was the problem. Restore the production call structure once validated.

FC105 Parameter Reference

FC105 has a fixed interface. The pinout below is the only call signature STEP 7 will accept; deviating from the parameter types (e.g., passing a WORD to OUT) raises an offline compile error before the program ever reaches the CPU.

Parameter Direction Type Description Source Case Value
EN Input BOOL Enable input. Must be TRUE to execute the conversion. Tag or hard-wired TRUE
IN Input INT Analog raw value at the input module (PIW address). PIW752
HI_LIM Input REAL Engineering-unit value corresponding to the upper raw limit. 50.0
LO_LIM Input REAL Engineering-unit value corresponding to the lower raw limit. 1.0
BIPOLAR Input BOOL TRUE = bipolar (-27648…+27648). FALSE = unipolar (0…27648). FALSE (0)
RET_VAL Output WORD Return code; non-zero indicates a parameter range error or out-of-range IN. MW100
OUT Output REAL Scaled engineering-unit output. MD110
ENO Output BOOL Enable output. FALSE if RET_VAL is non-zero or IN is outside ±27648.

The ladder body of FC105 is read-only; the user cannot edit it. To customise the scaling behaviour, build a new FC in the user's project (or use the TIA Portal SCALE_X / NORM_X instructions in migrated projects).

RET_VAL Return-Code Mapping

RET_VAL is the only diagnostic output FC105 produces. Always monitor it during commissioning.

RET_VAL (hex) RET_VAL (decimal, signed) Meaning OUT state
0000 0 No error. IN is within ±27648; OUT is in range. Calculated
0001…7FFF +1…+32767 IN is above the upper raw limit. OUT is clamped to HI_LIM. HI_LIM (e.g., 50.0)
FFFF…8001 -1…-32767 IN is below the lower raw limit. OUT is clamped to LO_LIM. LO_LIM (e.g., 1.0)
8080 -32640 Configuration error: HI_LIM = LO_LIM (division by zero suppressed). 0.0

If RET_VAL is non-zero, ENO is driven FALSE on the same cycle. The OUT value is still written, but the caller must check ENO/RET_VAL before using OUT for control purposes.

Scaling Formula and Worked Example

FC105 implements the linear conversion:

OUT = LO_LIM + ((IN - K1) / (K2 - K1)) × (HI_LIM - LO_LIM)

Where K1 and K2 depend on the BIPOLAR flag:

  • BIPOLAR = 0 (unipolar): K1 = 0, K2 = 27648
  • BIPOLAR = 1 (bipolar): K1 = -27648, K2 = 27648

For the source case (BIPOLAR = 0, LO_LIM = 1.0, HI_LIM = 50.0):

OUT = 1.0 + (IN / 27648) × 49.0

Loop current PIW752 (IN) OUT (engineering units) RET_VAL
4 mA (low end) 0 1.0 0x0000
8 mA 6912 13.25 0x0000
12 mA (mid) 13824 25.5 0x0000
16 mA 20736 37.75 0x0000
20 mA (high end) 27648 50.0 0x0000
22 mA (over-range) 30370 50.0 (clamped) 0x0001…0x7FFF
0 mA (wire break) -32768 or 0 1.0 (clamped) 0x8001…0xFFFF

Use this table as the acceptance test during commissioning. If OUT does not track the table within one engineering unit, the analog module's HW Config range is mismatched to the field wiring.

HW Config, Module Selection, and Wiring

FC105's range of valid raw values is fixed by Siemens analog-module conventions:

  • Unipolar (BIPOLAR = 0): 0…27648 (over-range up to 32511 for diagnostic purposes)
  • Bipolar (BIPOLAR = 1): -27648…+27648 (over-range up to ±32511)

For a 4-20 mA loop, set BIPOLAR = 0; the module's HW Config "Measuring Range" must be set to "4DMU" (4-wire current, 0-20 mA) or "4DMS" (2-wire current, 4-20 mA), as appropriate. If the module is set to ±10 V but the field wiring is current, the raw value saturates and FC105 clips OUT to the nearest limit.

Common S7-300 analog-input modules used with FC105 include the SM331 family (for example, 6ES7 331-7KF02-0AB0 with 8 AI, 13-bit resolution, configurable per channel). Always confirm the specific MLFB against the project's HW Config. The SM331 provides 0-27648 counts over 0-20 mA, or -27648 to +27648 over ±20 mA, by channel.

Wiring best practices for a 4-20 mA loop into an SM331 channel configured for 4-wire current:

  1. Connect the loop supply positive to the channel's I+ terminal.
  2. Connect the loop return to the channel's I- terminal.
  3. Verify the shield is grounded at the cabinet entry only (one end) to prevent ground loops.
  4. Confirm the channel's HW Config "Measuring Range" matches the physical wiring (2-wire vs 4-wire, voltage vs current).
  5. If the transmitter is 2-wire (loop-powered), use the 4DMS range and wire to the channel's 2-wire terminals; if 4-wire, use 4DMU and the I+/I- terminals.

Reference: SiePortal — FC105 & FC106 SCALE blocks

Verification Procedure

After downloading FC105 and OB121, validate the system end-to-end:

  1. Open a VAT and add PIW752 (INT) and MD110 (REAL) to the watch table.
  2. Toggle EN=1 and confirm the CPU remains in RUN; the SF LED must be off.
  3. Drive the 4-20 mA source to 4 mA; OUT must read 1.0 (±0.1 due to ADC quantisation).
  4. Drive to 20 mA; OUT must read 50.0 (±0.1).
  5. Mid-range (12 mA): OUT must read approximately 25.5.
  6. Check MW100 (RET_VAL). It must be 0x0000 for every in-range input; if non-zero, the input is out of range or the HW Config is wrong.
  7. Open PLC > Module Information > Diagnostic Buffer; the buffer must not contain "Block not found" events for FC105 or OB121.
  8. Force a wire break (disconnect the loop). OUT must clamp to LO_LIM and RET_VAL must go negative (0x8001…0xFFFF).
  9. Reconnect the loop and confirm RET_VAL returns to 0x0000 within one scan.

Common Error Matrix

Symptom Diagnostic Buffer Event Likely Cause Corrective Action
CPU STOP on first EN=1 "Block FC105 not found" / "OB not loaded" FC105 not downloaded to CPU Insert FC105 from Standard Library; download with "Overwrite all"
CPU STOP, SF LED on "Area length error reading" PIW752 Slot not configured or wrong module type in HW Config Re-check HW Config slot; download HW Config to CPU
OUT stuck at HI_LIM, RET_VAL positive No error event Loop current > 20 mA, or bipolar flag set on a unipolar module Verify loop current with a multimeter; set BIPOLAR = 0 if the module is 4-20 mA
OUT stuck at LO_LIM, RET_VAL negative No error event Loop current < 4 mA, wire break, or module set to 0-20 mA range Check loop and HW Config measurement range
ENO always FALSE, no STOP No OB121 event; SF not lit RET_VAL non-zero (out-of-range IN or HI_LIM=LO_LIM) Inspect MW100; correct input source or LO_LIM/HI_LIM parameters
CPU STOP with "I/O access error" (OB122) "I/O access error" PIW address not assigned to any module Confirm slot in HW Config; download HW Config
OUT is correct in OB1, wrong in FB4 No error event FB4 instance DB overlaps MD110 Reassign FB4 instance DB or OUT address
OUT is always 0, ENO TRUE, RET_VAL = 0x8080 No error event LO_LIM = HI_LIM (configuration error) Set LO_LIM < HI_LIM

FB4 and Instance-DB Considerations

Calling FC105 from FB4 is fully supported. Two preconditions must hold for the call site to execute without an OB121:

  1. FB4 must have a generated instance DB (e.g., DB4) and that instance DB must be downloaded. Without the instance DB, the CPU cannot allocate FB4's static variables and the call site raises OB121. STEP 7 auto-generates the instance DB on the first download of FB4 if "Generate instance DB automatically" is enabled in the project's settings.
  2. The instance DB must not overlap MD110 (the OUT of FC105). STEP 7 detects direct DB/M-area overlap on download and refuses the write; an indirect overlap (e.g., FB4's TEMP variables aliasing the same byte offset as a multi-word OUT) can still cause subtle corruption that mimics a FC105 fault.

If FB4 is only being used as a thin wrapper for FC105, drop the wrapper: call FC105 directly in OB1, OB35, or the cyclic interrupt OB that suits the application. Eliminating the FB layer removes one DB, one block-call overhead per scan, and one class of instance-DB debugging. The same advice applies to wrapping FC105 inside FCs — wrappers add no functional value because the FC105 interface is already user-facing.

Migration to TIA Portal

FC105 does not exist in the S7-300/S7-400 program editor of TIA Portal; the equivalent is the SCALE and SCALE_X / NORM_X instructions in the "Scaling" folder of the Instructions task card. The interface differs from FC105:

  • IN becomes the raw INT input wired to the instruction's input pin.
  • HI_LIM and LO_LIM are configured in the instruction's properties (the lower-right inspector pane) rather than wired as live parameters.
  • RET_VAL is implicit; the scaled REAL is the function's return value, and the "out of range" flag is exposed as a BOOL output.
  • BIPOLAR is selected in the instruction's properties, not wired as a BOOL tag.

If the project is migrated from STEP 7 V5.x to TIA Portal, every FC105 call must be deleted and a new SCALE / NORM_X+SCALE_X block inserted. STEP 7 V5.5 SP3 or later will not auto-convert FC105 to the TIA Portal instruction. Use the S7-300/S7-400 target in TIA Portal — the S7-1200/1500 target uses a different instruction set (NORM_X and SCALE_X) and a different raw-integer convention (0…27648 still applies, but the block instance is an FB, not an FC).

Reference: Siemens Support Entry 1765297 — How and for which analog measurements can you use FC105 "SCALE"

Safety, Commissioning, and Field Tips

  • Always confirm that the FC105 output is clamped to a process-safe value before driving downstream actuators. Use the RET_VAL non-zero check to inhibit control output during out-of-range events.
  • For SIL-rated loops, do not rely on FC105 clamp behaviour for safety. Implement an independent over-range check in the user program (compare IN to ±27648, or compare OUT to HI_LIM/LO_LIM within a tolerance) and shut down the controlled element if any condition is violated.
  • Insert FC105 in a time-driven OB (OB35, typically 100 ms) rather than in OB1 to decouple scaling from the OB1 cycle time jitter and to ensure deterministic execution on every S7-300/400 CPU.
  • When commissioning multiple FC105 blocks, place all RET_VAL outputs in a contiguous MW range and expose them on the HMI; this gives operators a single screen for diagnosing out-of-range analog signals.
  • Always wire the BIPOLAR input to a real BOOL tag, not a hard-wired constant. A toggle switch (as in the source case) is acceptable for commissioning, but a hard-wired 0/1 in the LAD body is brittle and cannot be changed without recompiling.
  • For users transitioning from Allen-Bradley PLCs (such as the SCP instruction on MicroLogix/CompactLogix): the conceptual model is the same (raw INT in, scaled REAL out, with high/low limits), but FC105 expects a real-time block call on every scan, while SCP is a single-instruction rung. A direct port of an Allen-Bradley SCP rung to FC105 is a 1:1 swap of the parameters; the only difference is the block download and OB-error-handling model described above.
  • Keep MD110 (or any REAL OUT of FC105) in a memory area that is not used by the FB-call chain. Real-world values stored in the bit-memory (M) area are volatile across CPU restart; if the scaled value must survive a warm restart, route it through a DB instead.

Why does my S7-300 CPU go to STOP the moment I set FC105's EN to 1?

The most common cause is that FC105 was not downloaded from the STEP 7 Standard Library to the CPU. Open PLC > Module Information > Diagnostic Buffer; a "Block FC105 not found" event confirms the cause. Insert FC105 from Standard Library > TI-S7 Converting Blocks into the S7 program, then download the program with "Overwrite all" enabled.

What is the correct raw-integer range for FC105 with a 4-20 mA signal?

Set BIPOLAR = 0. The valid raw range is 0 to 27648, with 27648 corresponding to 20 mA and 0 corresponding to 4 mA (or 0 mA if the module is configured for 0-20 mA). Out-of-range values up to 32511 are clamped; values above 32511 set RET_VAL to indicate over-range. Always confirm the analog module's HW Config "Measuring Range" matches the physical 4-wire vs 2-wire current wiring.

Is OB101 relevant to FC105 faults?

No. OB101 is a restart OB and has no role in programming-error handling. The error OBs are OB121 (programming error, e.g., missing block or invalid address) and OB122 (I/O access error). Loading OB121 in the S7 program allows the CPU to remain in RUN when FC105 encounters a programming error; without OB121 the CPU falls to STOP, which is the exact symptom in the source case.

Can I call FC105 from inside an FB such as FB4?

Yes. FC105 is a normal function and can be called from any block. The host FB must have a generated and downloaded instance DB, and the FC105 call must use addresses that do not overlap the instance DB. If the instance DB is missing, the call site raises OB121 and the CPU enters STOP. To eliminate FB-related variables, call FC105 directly in OB1 or OB35 as a baseline test.

What RET_VAL value indicates a range violation in FC105?

RET_VAL = 0x0000 means no error and OUT is within HI_LIM/LO_LIM. RET_VAL positive (0x0001 to 0x7FFF) means IN is above the upper raw limit and OUT is clamped to HI_LIM. RET_VAL negative (0xFFFF to 0x8001) means IN is below the lower raw limit and OUT is clamped to LO_LIM. RET_VAL = 0x8080 indicates HI_LIM = LO_LIM, a configuration error. Monitor MW100 (or whatever RET_VAL target) during commissioning to catch out-of-range inputs.

Back to blog