Troubleshooting FB Download Failures and CPU STOP in SIMATIC PCS 7 - Controller Block Number Limits and Memory Compaction
In SIMATIC PCS 7 (including legacy v6.x and modern releases), the download failure error 'Some FB cannot be copied to CPU and cannot download' accompanied by an immediate controller STOP mode is caused by exceeding the hardware Function Block (FB) numbering limit of the target S7-400 CPU or exhausting contiguous RAM work memory. In older S7-400 CPUs (such as CPU 414-3 or CPU 416-2), the maximum permissible FB number is strictly FB2047 (or FB1023 on earlier firmware). When newly compiled CFC logic automatically assigns an FB number higher than the CPU's architectural limit (e.g., FB2048+), the operating system rejects the block during download. To resolve this, engineers must reconfigure CFC block number ranges or execute RAM memory compression.
Table of Contents
- Hardware Constraints and Block Number Ranges in S7-400 CPUs
- Root Causes of Block Copy Failures During Download
- Configuring CFC Block Number Reserves in SIMATIC Manager
- Memory Compaction and RAM Defragmentation Procedure
- Comparative Hardware Matrix: S7-400 CPU Block Limits
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Hardware Constraints and Block Number Ranges in S7-400 CPUs
In SIMATIC PCS 7, the Continuous Function Chart (CFC) compiler automatically translates graphical control sheets into standard STEP 7 Organization Blocks (OBs), Function Blocks (FBs), and Data Blocks (DBs). The compiler draws block numbers from reserved numerical ranges configured in project settings.
However, physical SIMATIC S7-400 CPUs possess rigid hardware boundaries defined by their firmware and ASIC architectures:
- CPU 414-3 / 416-2 (Older releases): Support block numbers from FB1 to FB2047 (and DB1 to DB4095).
- CPU 417-4 / CPU 410-5H (Modern releases): Support expanded block ranges up to FB65535 and DB65535.
If an engineer imports a custom technological library or allows the CFC compiler to assign numbers above the CPU's physical limit (for example, attempting to load FB2050 into a CPU 416 that only supports up to FB2047), the compiler may successfully generate the offline block, but the CPU operating system will reject the block transfer during download, logging an internal error and transitioning the controller into STOP mode.
Root Causes of Block Copy Failures During Download
When a download aborts with 'Block cannot be copied', diagnostic analysis points to two distinct engineering conditions:
- Block Number Out of CPU Bounds:
- The compiled block number exceeds the maximum number of FBs supported by the specific CPU model and firmware release.
- The diagnostic buffer records event ID16#4540or16#4300: 'Stop caused by download / DB or FB number out of permissible range'. - Work Memory Fragmentation:
- The total remaining CPU work memory may appear sufficient in Module Information, but lack a single contiguous memory segment large enough to accommodate the block.
- S7-400 controllers require contiguous address space for each loaded block. Frequent online delta downloads fragment the internal RAM, preventing large DBs or FBs from being written.
Configuring CFC Block Number Reserves in SIMATIC Manager
To restrict the CFC compiler to block numbers within the CPU's physical capability:
Step 1: Check CPU Block Number Limits in HW Config
- In SIMATIC Manager, open HW Config.
- Double-click the target CPU module to open Properties.
- Inspect the Memory or Technical Data tab to confirm the maximum supported FB and FC number (e.g., Max FB: 2047).
Step 2: Adjust CFC Compilation Ranges
- In SIMATIC Manager, select the
Chartsfolder in the S7 Program. - Select menu Options > Customize > Compile/Download....
- Under Block Numbers / Reserved Ranges:
- Set From FB:1
- Set To FB:2047(ensure it never exceeds the CPU hardware maximum). - Verify that FC and DB ranges are similarly aligned with controller hardware specifications.
- Click OK to apply.
- Perform a full CFC compilation (Compile > Charts as Program > Entire program).
Memory Compaction and RAM Defragmentation Procedure
If the failure stems from work memory fragmentation rather than block numbering:
Step 1: Inspect Online Memory State
- In SIMATIC Manager, select the CPU and press
Ctrl+Dto open Module Information. - Switch to the Memory tab.
- Review the Work Memory (Code) and Work Memory (Data) gauges. If free memory is low (< 10%) or fragmented, compaction is required.
Step 2: Execute Memory Compaction
- In the Memory tab of Module Information, click the Compress button.
- The CPU reorganizes its internal RAM, closing gaps left by deleted blocks.
- If the controller is in STOP mode and memory remains corrupted, perform a complete MRES (Memory Reset), re-download the Hardware Configuration, and execute a full download of the S7 program.
Comparative Hardware Matrix: S7-400 CPU Block Limits
The table below outlines block limits across various SIMATIC S7-400 controllers:
6ES7414-3XJ00-0AB06ES7416-2XK02-0AB06ES7416-3XL04-0AB06ES7417-4XL04-0AB06ES7410-5HX08-0AB0Verification
To confirm that block transfer failures are resolved:
1. Diagnostic Buffer Audit: Open CPU Module Information (Ctrl+D); confirm that no memory allocation faults (Event ID 16#4540 or 16#4300) appear.
2. Download Execution: Execute PLC > Download Changes in CFC; verify that all FBs and instance DBs transfer cleanly without rejection dialogs.
3. Controller Run Status: Confirm that the CPU transitions smoothly into RUN mode with green RUN LED solid and internal fault (INTF) LED extinguished.
Limitations and Operational Precautions
Observe the following operational constraints:
- Performing a Memory Reset (MRES) clears all volatile RAM and forces the CPU to STOP, immediately shutting down plant automation; perform only during scheduled cold shutdowns.
- Always validate final license quantities and MLFBs against the applicable Siemens catalog and authorized distributor quotation when procuring replacement memory cards or controllers.
- Never manually assign arbitrary FB numbers in SCL source files without verifying that the numbers fall within the reserved customer ranges configured in CFC.
Engineer FAQ
Can I expand the work memory of an S7-400 CPU using a Flash Memory Card?
No. Flash Memory Cards expand Load Memory, not Work Memory. S7-400 CPUs execute code exclusively out of internal volatile RAM work memory (or RAM Memory Cards on CPUs with expansion sub-slots). Flash cards only store the non-volatile backup program.
Why did the compiler succeed if the CPU cannot accept the block number?
The CFC compiler checks block syntax and project database consistency, but it does not query physical CPU firmware limits unless the target station hardware configuration has been explicitly mapped and verified.
What should I do if a CPU 414-3 cannot fit my expanded PCS 7 project?
If code work memory or block number ranges are fully exhausted, the CPU must be upgraded to a higher-capacity controller, such as a CPU 416-3 or the modern CPU 410-5H Process Automation controller.
Technical References
- SIMATIC S7-400 CPU Specifications and Hardware Manual (A5E00850745)
- SIMATIC PCS 7 CFC for S7 / M7 Manual (A5E36986518)
- SIMATIC S7-400 Memory Concepts and Addressing Limits (Entry ID: 7302549)
Related Articles
- Diagnosing S7-417-5H Controller Halts Caused by SFB20 and PG Stop Operations
- Handling Pointer and ANY Data Types in SIMATIC PCS 7 CFC
- Managing Runtime Group Synchronization Across OB35 and OB100 When Renaming CFC Charts
Related Tags
- S7-400
- CFC Compilation
- Work Memory
- Block Number Limits
- CPU STOP