Fixing Step 7 V5.4 SP4 FB Not Opening on CPU 416-3DP

David Krause16 min read
S7-400SiemensTroubleshooting
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

When a Function Block (FB) is copied from a source STEP 7 V5.4 SP4 project into a working project that contains an S7-400 CPU 416-3DP, the FB may refuse to open in the LAD/FBD/STL editor of SIMATIC Manager. The editor displays an error dialog — most commonly "Internal error", "Block consistency error", or "Symbol not defined" — the moment the user double-clicks the copied FB icon. Yet the same FB, copied to a freshly inserted second CPU 416-3DP of the identical order number within the same project, opens without error.

This asymmetric behavior — failing on one station, succeeding on the next — is the most important diagnostic clue. It rules out project-level corruption, password protection (already verified by the user), and content-level syntax errors in the FB source. The fault is almost always a missing reference to a multi-instance FB (or related block) that the editor requires to resolve the FB's interface, combined with an inconsistent block state on the destination CPU.

This article covers STEP 7 V5.4 SP4 (SIMATIC Manager) on a CPU 416-3DP. The same principles apply to other S7-400 CPUs and to STEP 7 V5.5; TIA Portal behavior is summarized in the FAQ.

Environment: STEP 7 V5.4 SP4 and CPU 416-3DP

STEP 7 V5.4 SP4 is the SIMATIC Manager release for programming S7-300/S7-400 stations, released in 2008 and still in use across brownfield plants worldwide. The programming model is block-oriented: OB, FB, FC, DB, SDB, SFB, SFC. FBs and FCs are compiled from LAD/FBD/STL or from SCL sources. The CPU 416-3DP belongs to the high-end S7-400 line and offers the following relevant limits and resources for block programming:

CPU 416-3DP (6ES7416-3 series) block and memory limits
Resource Limit Notes
Maximum user FBs (FB 0 to FB 2047) 2048 Excludes system FBs
Maximum user FCs (FC 0 to FC 2047) 2048 Excludes system FCs
Maximum DBs (DB 1 to DB 4095) 4095 DB 0 is reserved
Maximum OB priority classes OB 1, OB 10-17, OB 20-22, OB 31-38, OB 40-47, OB 55-57, OB 60, OB 80-87, OB 90, OB 100-102, OB 121-122 24 supported OBs total
Maximum block size (FB/FC/DB) 64 KB Includes interface description
Maximum local data per OB priority class 32 KB Configurable per priority in HW Config
Work memory, code (latest -3XS07-0AB0) 4 MB Integrated, expandable to 4 MB code
Work memory, data (latest -3XS07-0AB0) 4 MB Retentive area configurable
Load memory Memory card (MMC) up to 64 MB Required for firmware update
Multi-instance support Yes Allows FBs to call FBs as STAT

Reference the SIMATIC S7-400 CPU 416-3 DP device manual on the Siemens Industry Online Support portal for the full technical specification, and the Programming with STEP 7 V5.4 reference manual for block-oriented programming details.

The CPU 416-3DP fully supports multi-instances. A multi-instance is an FB that is called not from a dedicated instance DB, but as a STAT (static) variable in the interface of another FB. The instance data of the called FB is stored in the instance DB of the calling FB. This feature saves instance DBs and groups related block state into a single data structure, but it also creates a hard dependency: the calling FB cannot be opened in the editor unless the referenced FB is present in the offline S7 program of the same CPU.

Symptom Analysis: Why One CPU Works, the Other Does Not

When the same FB copies cleanly to a second CPU inserted in the same project, the cause is almost always local to the S7 program of the first CPU. Three plausible local conditions explain the asymmetric behavior:

  1. Multi-instance FB reference exists in the FB interface, and the referenced FBs are present in CPU #1's S7 program but missing or at a different version in CPU #2's program. Counter-intuitively, the editor sometimes opens the block on the CPU where the multi-instance chain can be partially resolved, while failing on the CPU where references are absent. This is the leading hypothesis for the reported symptom.
  2. Block container state corruption on CPU #1: A previous partial copy, an aborted insert operation, or a write to the S7 program container has left the offline block catalog of CPU #1 in an inconsistent state. SIMATIC Manager treats the corrupted container as authoritative and refuses to open the FB even though the underlying S7 source is valid.
  3. Offline/online block desynchronization: The first CPU has the FB in its offline block container (S7 program > Blocks) with a different interface hash, version stamp, or time stamp than the freshly copied FB expects. The freshly inserted CPU #2 has no prior block state, so the copy lands cleanly.

The user-reported observation that the same FB opens on CPU #2 is the diagnostic signal: the FB's content is not the problem; the destination S7 program's block state is.

Root Cause: Multi-Instance FB Dependency

Multi-instance calls in STEP 7 are declared in the STAT (static) section of the calling FB's interface. A typical declaration in the FB interface editor (F11) looks like the following. The exact representation in the STL source export (.awl) is also shown.


// FB 100 "MotorManager" - calling FB
// Interface declaration (visible in F11):
//   STAT
//     sMotor1   : FB 200    // multi-instance of "MotorCtrl"
//     sMotor2   : FB 200    // second multi-instance of "MotorCtrl"
//     sValve1   : FB 210    // multi-instance of "ValveCtrl"
//
// Compiled STL (excerpt):
//   CALL  "MotorCtrl" , "MotorManager_DB".sMotor1
//   CALL  "MotorCtrl" , "MotorManager_DB".sMotor2
//   CALL  "ValveCtrl"  , "MotorManager_DB".sValve1

To open FB 100 in the editor, SIMATIC Manager must resolve the interface of every multi-instance FB referenced in its STAT section (FB 200, FB 210 in the example). The editor walks the S7 program of the destination CPU, opens each referenced FB in memory, and validates the interface layout. If any referenced FB is missing from the offline S7 program of the destination CPU, the resolution path is broken and the editor displays a block consistency error.

The most common trigger for the user's symptom is the following sequence:

  • The source project contains a calling FB that uses multi-instances of other FBs.
  • The user copies only the calling FB into the working project.
  • On the first CPU 416-3DP, the working project's S7 program may already contain some of the referenced FBs from earlier work, but with a different version or interface. The partial resolution fails the editor's open call.
  • On the freshly inserted second CPU 416-3DP, the S7 program is empty, but the editor falls back to the project-wide block search and may find the referenced FBs in a sibling S7 program. More commonly, the absence of any conflicting reference allows the editor to open the FB and report unresolved multi-instances as warnings rather than fatal errors.

This is why "check if you use multi-instances, and if yes, copy all FBs, not just 1" is the canonical answer for this symptom in STEP 7 V5.4. The block version stamp (CRC over interface and compiled code) makes even a partial match between calling and called FB enough to derail the editor.

Secondary Causes to Investigate

When multi-instance dependency is ruled out, four secondary causes account for nearly all remaining occurrences of "FB not opening":

Secondary causes for FB not opening after copy
Cause Diagnostic check Resolution
Know-how protection (excluded in the user's report) Right-click FB → Object Properties → Know-how Protection tab Enter password or export unencrypted STL/SCL source
Block version stamp mismatch (interface CRC) Run Program → Compile All; review the compile report Delete the block, then insert it again from the source file
Symbol table entry points to a data type that does not exist in the destination program Open Symbols table; search for the FB number; check the data type column Reassign the symbol to the new FB number or remove the symbol
Memory or block limit reached (2048 FBs, 64 KB max block size) PLC → Check Block Consistency → Review report Delete unused FBs; split large FBs into smaller pieces

Block version stamps in STEP 7 are derived from a CRC over the interface declaration and the compiled code body. If the FB is copied into a destination where the referenced multi-instance FBs exist but have a different version stamp, the editor can refuse to open the calling FB even though the call would technically resolve. Recompiling the FBs in the destination program refreshes the stamps and is the standard recovery path.

Diagnostic Procedure

Follow this ordered procedure to isolate the cause before applying a fix. The order is important: cheaper checks first, then destructive operations.

  1. Confirm the FB is not know-how protected. In SIMATIC Manager, right-click the FB and select Object Properties → Know-how Protection. The user has already done this; if password protection is added later, the symptom reappears.
  2. Open the source FB in the original project. If the FB opens cleanly in the source project, the code is valid and the issue is local to the destination project. This is the strongest evidence for the multi-instance theory.
  3. Inspect the FB interface for multi-instance STATs. In the destination project, select the FB and press F11 (Interface). Scroll the STAT section. Any STAT entry whose data type begins with "FB" (for example, STAT sMotor1 : FB 200) is a multi-instance call.
  4. List every FB referenced as a multi-instance. Note each FB number, then check the S7 program of the destination CPU for presence of that FB number.
  5. Run Block Consistency check. Menu PLC → Check Block Consistency. The report lists every block whose interface or reference chain is broken.
  6. Compare the offline FB file with the version on disk. Navigate to the project's offline Blocks folder, locate the block file for the FB, and verify the timestamp and byte count.
  7. Export the FB as source. Right-click the FB → Generate Source. If generation succeeds, the FB is internally consistent. If it fails, the FB is corrupted and must be reinserted.
  8. Insert a fresh CPU 416-3DP of the same order number, copy the FB to it, and confirm the open succeeds. The user has already done this; the open success on the fresh CPU is definitive evidence that the FB itself is intact.

Step-by-Step Recovery Procedure

The following procedure resolves the symptom in the large majority of field cases. Execute the steps in order; abort and re-evaluate if a step fails.

Step 1 - Catalog all dependent FBs

Open the FB in the source project. In the interface editor (F11), scroll the STAT section. Note every STAT with type starting with "FB". For each, record:

  • FB number (the multi-instance base type)
  • Symbolic name of the multi-instance variable
  • Whether the referenced FB is itself a multi-instance (recursive reference chain)

If the project is large, use the cross-reference tool: Options → Cross-References, filter by the calling FB, and expand the "FB/FC call" section. Recursive chains must be followed to closure: every called FB must have all of its multi-instance FBs present in the destination.

Step 2 - Copy all related FBs together

Do not copy the calling FB alone. In the source project's S7 program > Blocks, multi-select the calling FB and every multi-instance FB it references. Use Ctrl+click or Shift+click to select contiguous or non-contiguous entries. Drag the selection to the S7 program > Blocks of the destination CPU 416-3DP.

SIMATIC Manager's drag-and-drop copy preserves the FB numbers. If the destination CPU already contains an FB with the same number, export the destination's version to a safe location before confirming the overwrite. Drag-and-drop is preferred over "Copy / Paste" because it preserves the original interface hashes intact.

Step 3 - Recompile the destination S7 program

After copying, force a recompile of every block in the destination S7 program to refresh interface CRC stamps:

  1. Menu PLC → Compile All (or right-click the Blocks folder → Compile All).
  2. Review the compile log. Every error must be resolved before proceeding.
  3. Re-run PLC → Check Block Consistency. The output should be empty for a fully consistent program.

Step 4 - Test opening the FB

Double-click the calling FB in the destination project. The editor should open without error. If the multi-instance symbols show "????" placeholders or warning triangles, the multi-instance FBs are still missing — return to Step 2 and copy the missing FB numbers.

Step 5 - Regenerate instance DBs

If the calling FB has an associated instance DB (for example DB 1001), open the calling FB, then from the menu select File → Generate Instance DB (or right-click the FB → Instance DB). STEP 7 generates a fresh instance DB whose layout reflects the current multi-instance chain.

Step 6 - Verify in PLCSIM or online

Download the corrected program to PLCSIM (S7-400 simulator, part number 6ES7841-0CC05-0YA5) or to the actual CPU 416-3DP. Open the FB online; verify that the multi-instance variables show valid values when monitored. Online monitoring of a multi-instance STAT requires the calling FB's instance DB to be present in the CPU.

Verification

The fix is verified by the following four checks, in this order:

  1. Open check: The FB opens in the LAD/FBD/STL editor without any error dialog. The interface shows the multi-instance STAT variables with their correct type names, not placeholders.
  2. Compile check: PLC → Compile All completes with zero errors and zero warnings related to the FB or its multi-instance chain.
  3. Consistency check: PLC → Check Block Consistency reports the S7 program as consistent. Any block flagged with "Interface difference" or "Unknown type" indicates a remaining reference gap.
  4. Online check: Download the program to a CPU 416-3DP (real or PLCSIM), go online, and monitor a multi-instance variable (e.g., sMotor1.bReady). The value updates when the called FB executes, confirming the call chain is fully wired.

If any of the four checks fails, return to the diagnostic procedure and re-check the multi-instance FB list. The most common oversight is missing an FB that is itself a multi-instance caller — its referenced FBs must also be copied.

Troubleshooting Matrix

Symptom-to-cause matrix for FB not opening in STEP 7 V5.4 SP4
Symptom detail Most likely cause First action
FB opens in source project, fails in destination Multi-instance dependency Copy all FBs in the multi-instance chain
Error: "Block consistency error" on click Missing referenced FB Run PLC → Check Block Consistency
Error: "Internal error in the editor" Block container corruption Delete the block, reinsert from source
FB opens on a fresh CPU, fails on existing CPU Existing CPU has partial references Compare FB lists between the two CPUs
Error: "Type FB xxx not declared" Multi-instance FB xxx not in S7 program Copy FB xxx into the same S7 program
Error after know-how protection added Encrypted FB hides its interface Re-export source before re-encrypting
Block opens, but instance DB is missing fields Instance DB was not regenerated File → Generate Instance DB
Block opens, online shows ??? for STAT Multi-instance FBs not in online program Download all FBs to the CPU

Prevention and Engineering Best Practices

For ongoing projects, follow these practices to prevent recurrence and to simplify recovery when block corruption occurs:

  • Distribute FBs as SCL or STL source files (.awl for STL, .scl for SCL), not as compiled blocks. The STEP 7 V5.4 reference manual documents the source-based workflow in the "Generating Source Files from Blocks" and "Creating Blocks from Sources" sections. Source files are immune to block container corruption and make the multi-instance chain self-documenting.
  • Document the multi-instance hierarchy in a project README or in the FB header comment. List every multi-instance FB number and its role. A 30-line comment block at the top of each calling FB is enough to halve field-engineering time on the next migration.
  • Use the S7 program's block folder as the single source of truth. Avoid editing FB copies in the offline Blocks folder directly; always work through the S7 program container.
  • When copying between projects, copy the entire S7 program (or at minimum the entire Blocks folder) rather than individual FBs. The bulk copy preserves all multi-instance references in one transaction.
  • Apply know-how protection only after the multi-instance chain is complete. An encrypted multi-instance FB hides its interface and breaks the editor's ability to resolve the calling FB. This combination of encryption + multi-instance is the most common cause of "FB will not open" in protected libraries.
  • Tag every CPU 416-3DP with the same order number in plant documentation so that field engineers know to perform identical memory and block-limit checks before any program migration.
  • Maintain a backup of every project's S7 source in a version-controlled repository (SVN, Git, or the TIA Portal Teamcenter gateway). When block corruption occurs, the source can be recompiled into a clean block in minutes.
  • Run Block Consistency as a scheduled maintenance check, not only when problems appear. Inconsistencies caught at a known checkpoint are cheaper to repair than inconsistencies discovered during a production fault.
The CPU 416-3DP is a legacy S7-400 module. For new installations, Siemens recommends migrating to S7-1500 with TIA Portal, which manages multi-instance references through the PLC tag table and provides clearer diagnostics for missing references. Existing S7-400 fleets can remain in service for decades; the procedures in this article apply unchanged to any S7-400 firmware version that supports multi-instances (all versions since 1995).

Frequently Asked Questions

Why does the same FB open on one CPU 416-3DP but not on another in the same project?

The FB's code and interface are valid. The most likely cause is that the calling FB declares multi-instance STAT variables (typed as other FBs) and one CPU's S7 program contains a partial, version-mismatched set of the referenced FBs while the freshly inserted CPU does not. The editor's reference resolver behaves differently depending on the local S7 program state. Copy all FBs in the multi-instance chain together and recompile to align version stamps.

How do I check whether my FB uses multi-instances?

Open the FB in SIMATIC Manager and press F11 to view the interface. Scroll the STAT section. Every STAT whose data type starts with "FB" (for example, STAT sMotor1 : FB 200) is a multi-instance. The same check is available in the cross-reference list (Options → Cross-References) under "FB/FC call".

Can I recover a corrupted FB without the original project?

If the FB still opens on any CPU in any project, right-click it and choose "Generate Source" to export the STL/SCL source. The source can be re-inserted into any project via "Insert" → "External Source". If the FB does not open in any project, only a backup, an exported source, or a version-controlled copy can recover it. The compiled block format is not human-readable and cannot be reverse-engineered without the source.

Does the same problem affect FCs and DBs?

FCs are stateless and do not use multi-instances, so the multi-instance theory does not apply. DBs are data containers and do not call other blocks, so they cannot trigger this symptom. OBs can call FBs as multi-instances only through their static call structure, which is unusual. In practice, the symptom is exclusive to FBs that declare multi-instance STATs.

Is this fixed in STEP 7 V5.5 or in TIA Portal?

STEP 7 V5.5 improves the editor's diagnostics for missing multi-instance references and adds clearer error messages, but the root cause (missing FB references) still requires the same remedy: copy all related FBs. TIA Portal handles multi-instance references through the PLC tag table and the program editor's call hierarchy, which makes missing references more visible but does not eliminate the requirement to copy all referenced FBs together.

Back to blog