Resolving Missing Block Type Errors (FB24) During SIMATIC PCS 7 CFC Compilation
A compilation failure in SIMATIC PCS 7 reporting that a function block (e.g., FB24) is missing or cannot be found occurs when a CFC chart references a block type that exists neither in the target AS S7 Program's Chart Folder nor in its Offline Block Folder. To resolve this: (1) In SIMATIC Manager Component View, expand the AS CPU to S7 Program -> Blocks and verify whether FB24 is present; (2) If FB24 is in the block folder but missing from CFC, open any CFC chart, select Options -> Block Types, select FB24 in the left pane (Block folder), and click the right arrow (->) to import it into the Chart folder; and (3) If FB24 is entirely absent, copy it from your project Master Data Library (MDL) or source library into the S7 Program block folder, then import it into CFC.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
During routine automation engineering, library migrations, or program modifications in SIMATIC PCS 7 V7.1 or V9.0, compiling CFC charts into executable controller machine code (Compile Charts as Program) can occasionally halt abruptly with an unspecific error message referencing a missing block number (such as FB24 or similar library functions). New automation engineers are frequently disoriented because the compiler summary does not immediately pinpoint the specific chart, sheet, or hierarchy path where the error occurred. This compilation fault originates from a broken synchronization between the CFC chart catalog and the underlying STEP 7 offline block container (bausteine). Understanding how CFC manages block types and imports ensures rapid resolution.
Architecture and Fundamental Mechanics
The block management and compilation pipeline of the CFC Editor operates through a two-tiered container architecture:
-
The Offline Block Folder (
bausteine) vs. Chart Folder (pläne):
- Offline Block Folder: Resides in STEP 7 Component View under[AS] -> [CPU] -> S7 Program -> Blocks. This container holds compiled machine code headers for all Function Blocks (FBs), Functions (FCs), and Data Blocks (DBs).
- Chart Folder / CFC Catalog: Resides underS7 Program -> Charts. For a block to be instantiated or compiled in a CFC chart, the block type must be formally registered in the Chart Folder catalog. -
Why Missing Block Errors Occur:
- Case 1: Block Exists Offline but Not in Chart Folder: If an engineer copies a block into the S7 Program block folder or modifies an SCL source, CFC does not automatically register it. If a chart references the block, the compiler halts because the block type was not imported viaOptions -> Block Types.
- Case 2: Accidental Block Deletion: An engineer might deleteFB24from the block folder, unaware that a legacy chart or an instantiated macro uses it. When the compiler traverses the charts, it detects the block instance in CFC but finds no matching compiled FB header in the block folder, triggering a fatal compile halt.
- Case 3: Unmigrated Legacy Library Blocks: When migrating older projects (e.g., PCS 7 V7.1), legacy standard blocks (such asFB24representing standard controller functions) may not exist in newer library versions unless explicitly copied from the Master Data Library or PCS 7 Legacy Library. -
The Role of Options -> Block Types: The Block Types dialog functions as the synchronization bridge: the left pane enumerates blocks residing in the offline folder, while the right pane enumerates blocks imported into the chart folder. Moving blocks across synchronizes compiler interface definitions.
Step-by-Step Implementation Procedure
Locate, restore, and synchronize the missing block type using the following procedure:
-
Locate the Block in Component View:
- In SIMATIC Manager, switch toComponent View(View -> Component View).
- Expand the multi-project tree:[AS Project] -> [SIMATIC 400 Station] -> [CPU] -> S7 Program -> Blocks.
- Scroll through the block list to check ifFB24(or the flagged block) is present in the container. -
Restore Missing Block from Master Data Library:
- IfFB24is missing from the block folder:- Open your project's Master Data Library (or
File -> Open -> Libraries -> PCS 7 Standard Library). - Locate
FB24in the library'sBlocksfolder. - Right-click
FB24, selectCopy, return to your AS project'sBlocksfolder, and selectPaste.
- Open your project's Master Data Library (or
-
Import Block Type into CFC Chart Folder:
- Open any CFC chart within the target AS program.
- In the CFC menu bar, selectOptions -> Block Types.
- In the Block Types dialog:- Look at the left pane labeled
Block folder. - Select
FB24. - Click the right arrow button (
->) to moveFB24into the right pane labeledChart folder. - If
FB24already appears on the right, click theNew VersionorClean Upbutton to refresh interface timestamps. - Click
OK. CFC imports the block type and updates its internal catalog.
- Look at the left pane labeled
-
Identify Errant Chart Instances if Block is Obsolete:
- IfFB24is an obsolete block that should be removed rather than restored:- In CFC, select
Options -> Block Types. - Select
FB24in the right pane and clickChart Reference List. - The list displays the exact chart name, sheet number, and block instance name referencing
FB24. - Open that specific chart and delete or replace the obsolete block.
- In CFC, select
-
Recompile CFC Charts:
- In SIMATIC Manager, selectPLC -> Compile -> Charts as Program.
- SelectScope: Entire Programand compile. The compilation will complete with zero missing block errors.
Verification
Verify compilation success and program integrity:
-
Compiler Log Verification: Inspect the CFC compiler log window. Confirm that compilation finishes with status
0 Errors, 0 Warnings. -
CFC Catalog Inspection: Open the CFC catalog pane. Expand the
All blocksorS7 Programfolder. Confirm thatFB24is listed with its proper symbolic name, author, and version. -
Online Download Test: Download the compiled program (Changes Only) to the AS controller. Confirm that the CPU remains in RUN mode without diagnostic buffer complaints.
Limitations and Operational Precautions
Never paste a block type into the S7 Program block folder that was compiled with a different version of the S7-SCL or CFC compiler without running 'Update Block Types'; mixing incompatible internal block header formats can corrupt the offline chart database. Always maintain authoritative block copies inside the multi-project Master Data Library.
Engineer FAQ
Why did CFC not tell me which chart contained the missing block?
The CFC compiler performs an initial global scan of registered block types before parsing individual chart sheets. If a registered type definition is missing, the compile aborts globally before evaluating chart specifics.
How do I find which chart is using a specific FB?
In the CFC Editor, select Options -> Block Types, select the FB in the right-hand list, and click the Chart Reference List button. It displays all charts and sheet coordinates where the block is instantiated.
What is the difference between Component View and Plant View in SIMATIC Manager?
Component View displays the physical hardware and S7 Program database structure (CPUs, block folders, charts). Plant View displays the technological plant hierarchy (Areas, Units, Equipment) used for WinCC and BATCH organization.
Can I delete a block from the S7 Program block folder if it is in a CFC chart?
No. Deleting an FB or FC from the block folder while an instance remains in a CFC chart causes compilation to fail with a missing block error.
What does the 'Clean Up' button do in the Block Types dialog?
It scans all CFC charts and un-registers any block types from the Chart Folder that are no longer used by any chart in the project.
Technical References
- SIMATIC PCS 7 CFC for S7 Engineering Manual V9.0
- SIMATIC PCS 7 Programming Instructions and Block Architecture Manual
- STEP 7 V5.6 System Architecture and Standard Functions Guide
Related Articles
- Master Data Library Template Updating: Process Tag Types vs Control Module Types in SIMATIC PCS 7
- Establishing Cross-CFC Block Interconnections and Parameter Assignments in Process Object View
- Differentiating Process Object View Parameters from the Technological List Editor in PCS 7
Related Tags
- CFC Compilation
- Block Types
- FB24
- Component View
- Master Data Library
- S7 Program