Resolving FM 458-1 DP CFC Compile Error 128 Library and HWConfig

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

Resolving FM 458-1 DP CFC Compile Error 128: Library and HWConfig Fix

The SIMATIC FM 458-1 DP is a technology module for the S7-400 platform that performs high-speed closed-loop control, motion, and drive-oriented tasks. Programming of the FM 458-1 DP is done in the CFC (Continuous Function Chart) optional package, which is installed on top of STEP 7 V5.x. Because CFC relies on a tightly bound chain of compile-time information—block type libraries, HWConfig slot assignments, and the EXM 438-1 expansion module descriptors—a single missing artifact can cascade into hundreds of compile errors and runtime failures. Error code 128 is the canonical symptom reported when the CFC compiler cannot resolve a referenced block type library. This article documents the field-proven resolution path, including restoring the missing br.msk library, aligning the HWConfig module name with the diagnostic log, and preallocating EXM 438-1 I/O addresses so that incremental updates can complete without freezing.

1. Problem Definition: Symptoms Reported in the Field

Engineers commissioning or maintaining an FM 458-1 DP station typically encounter the following three failure modes together:

  1. Compile-time error count of 128 (or another repeating count) when invoking the CFC compile action on a chart or on the entire S7 program.
  2. Update process freezes when the user attempts an online update of an active chart via CFC menu Chart > Update or Chart > Download.
  3. Modifications to the CFC circuit fail to apply after the compile has nominally succeeded, because the underlying block type catalog is inconsistent.

The Inspector window of the CFC editor surfaces these problems through the Info > Compile log. Each entry shows the chart, the affected instance DB, and a structured error code. In the most common case the log states that a block type from library BR could not be resolved, producing errors like:

[128] Block type 'BR_CTL' from library 'BR' not found
[128] Instance DB 4711 (chart MOTOR_1) cannot be generated

The same error pattern is well-known to STEP 7 V5.x users compiling user-defined CFC charts that reference B&R-style runtime blocks redistributed through the FM 458 optional package. When the library is missing, the compiler substitutes placeholder blocks, but downstream type-checks still fail, producing the characteristic 128-error count.

Important: Do not ignore a high error count from the CFC compile. Even when the program is "operational," missing type references corrupt the next download and may produce OB 121 / OB 122 programming errors at runtime on the FM 458-1 DP CPU side.

2. Architecture Context: FM 458-1 DP, EXM 438-1, and CFC

Before changing files it helps to understand the moving parts.

Component Role Key Identifier
FM 458-1 DP (6DD1 607-0AA1 / 6DD1 607-0AA2) Application module for high-dynamic closed-loop control; occupies an S7-400 slot HW name "4581DP" expected by CFC diagnostic log
EXM 438-1 (6DD1 607-0CA0 / 6DD1 607-0CA1) I/O expansion module connected to the FM 458 via the SUB-D ribbon cable Preallocated I/O addresses required for CFC compile
CFC optional package (V5.x, V6.x, V7.x) Graphical editor for function-chart programming; manages chart DB generation Install path C:\Program Files (x86)\Siemens\Step7\s7cfc
S7-400 CPU (e.g. CPU 414-3, CPU 416-3) Hosts CFC runtime; exchanges process data with FM 458 via I/O backplane or DP HWConfig slot configuration must match physical rack
BR block library (br.msk) Runtime blocks for closed-loop / drive functions distributed with the FM 458 package Mask file expected in s7cfc\sdblocks

The CFC compiler resolves every block instance back to a "block type" stored in a .msk mask file. Mask files are loaded from the global block-type catalog at ...\s7cfc\sdblocks. If the catalog does not contain the type the compiler reports error 128 and aborts the chart.

3. Root Cause Analysis

Three root causes explain the symptom set in roughly 90 % of field cases. Always investigate them in the order shown, because fixing the first two often makes the third irrelevant.

3.1 Missing Block-Type Library (Most Common)

The CFC compiler cannot find a referenced block type, typically from library BR. The two situations are:

  • Library was never installed on the engineering station because the FM 458-1 DP optional package install was interrupted, run on a different account, or installed before the CFC package was added.
  • Library was installed in a project-local directory (e.g. ...\Project_name\Global\sdblocks\) but was never copied to the global CFC catalog at C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks. Project-local copies are not picked up by the global compile.

3.2 Module Name Mismatch in HWConfig

The HWConfig name of the FM 458 module must equal the symbolic name expected by the CFC runtime. The default expected name is 4581DP. If the engineer has renamed the module (for instance to FM458 or SLOT4), the diagnostic log cannot resolve references and the update path may deadlock while the editor waits for a confirmation dialog that never appears.

3.3 EXM 438-1 I/O Addresses Not Preallocated

The EXM 438-1 expansion is reported in HWConfig with its own I/O address area. If the addresses are left in the auto-assign state, the CFC compile may pass on the first run but fail on incremental updates, because the I/O range reserved for the EXM conflicts with free ranges the chart needs.

4. Resolution Procedure

Follow this ordered procedure. Do not skip steps; each one is a prerequisite for the next.

4.1 Step 1 — Locate or Restore the br.msk Library

  1. Open Windows Explorer and navigate to %USERPROFILE%\Documents\<Project_name>\Global\sdblocks\ (project-local catalog).
  2. Search for the file br.msk. If it is present, copy it.
  3. Paste the file into C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks.
  4. If the file is not present in the project folder, locate the original installation media of the FM 458-1 DP optional package and re-install or copy br.msk from Disk1\Setup\S7CFC\Sdblocks on the install medium.
  5. Confirm the catalog contains the file by opening the CFC editor menu Options > Block Types. The BR library must appear in the left list with at least one block (typically BR_CTL, BR_PWM, BR_SPD).
Permissions: writing to C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks requires elevated rights on Windows 7/10/11. Right-click the Explorer and choose Run as administrator if the copy fails with access denied.

4.2 Step 2 — Align the FM 458 Module Name in HWConfig

  1. Open the SIMATIC Manager project that contains the FM 458 station.
  2. Double-click Hardware to launch HWConfig.
  3. In the rack view, right-click the FM 458-1 DP module and choose Object Properties.
  4. Switch to the Properties tab.
  5. In the Name field enter exactly the name reported in the CFC compile log. In the canonical case this is 4581DP. If the log shows a different string, use that string verbatim — including case.
  6. Click OK, then Save and Compile in HWConfig.

4.3 Step 3 — Preallocate EXM 438-1 I/O Addresses

  1. In HWConfig, right-click the EXM 438-1 module and choose Object Properties.
  2. Select the I/O Addresses tab.
  3. Click Preallocate. The dialog assigns a fixed address range to the EXM. Accept the proposed range unless it collides with a known range used by another module — in which case adjust the start address manually.
  4. Click OK, then Save and Compile in HWConfig.

4.4 Step 4 — Recompile CFC

  1. Return to the CFC editor.
  2. From the menu bar select Options > Chart Check to verify the program is consistent before a full compile.
  3. Select Options > Compile > Charts (or press F7 for the active chart).
  4. Watch the Inspector window. The error count must drop to 0. If the count is non-zero, expand each entry in the log; the first three errors usually explain the rest.

4.5 Step 5 — Perform the Online Update

  1. Establish an online connection to the target S7-400 station.
  2. Open the chart that previously froze during the update.
  3. From the menu choose Chart > Update (or Chart > Download for a full download).
  4. Confirm any version-change dialogs. The update should now complete within seconds; the freeze symptom was caused by the editor waiting for a name match between the chart references and the HWConfig slot name.

5. Verification

After applying the fix, perform these checks:

Check Expected Result Tool / Location
CFC compile returns 0 errors Inspector window > Info > Compile shows no red entries CFC editor
Block Types catalog lists BR Library visible with at least one block CFC > Options > Block Types
FM 458 module name equals compile log name Match (case-sensitive) HWConfig > FM 458 > Properties > Name
EXM 438-1 has fixed address range Address is greyed (preallocated) HWConfig > EXM 438-1 > I/O Addresses
Online update completes Progress dialog closes within 30 s CFC online view
CPU is in RUN without OB 121/122 Diagnostic buffer clean SIMATIC Manager > PLC > Module Information

6. Common Edge Cases and Caveats

  • 64-bit Windows 10/11 with 32-bit STEP 7: the catalog path is C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks; on 32-bit Windows it is C:\Program Files\Siemens\Step7\s7cfc\sdblocks. Always confirm the path before copying.
  • Multi-project installations: each SIMATIC Manager project may have its own Global\sdblocks folder. The br.msk must reside in both the project folder and the global catalog if you intend to compile from the S7 program or from individual chart views.
  • Antivirus quarantining: some endpoint security products quarantine .msk files because of the binary signature. Whitelist the STEP 7 installation directory and re-copy the file if it disappears.
  • Symbolic vs. absolute IO access: the EXM 438-1 preallocation is mandatory only when the chart accesses I/O symbolically. If you have switched to direct P/Q access, the preallocation can be omitted, but doing so is discouraged because the symbol table is regenerated every time HWConfig compiles.
  • Frozen update on virtual machines: CFC uses COM to talk to the S7 online interface. On slow virtual machines the update dialog can appear frozen while COM marshalling completes. Allow at least 60 s before assuming the freeze is the same error condition.
  • Multiple FM 458-1 DP modules in one station: each FM 458 slot must have a unique name. Use 4581DP_1, 4581DP_2 for additional modules and update the chart references accordingly.

7. Block Type Catalog — What the Editor Shows

Open Options > Block Types in the CFC editor. The dialog shows two lists:

  • Available block types (left): all block types from the global catalog at s7cfc\sdblocks and the project-local catalog.
  • Block types used in the chart (right): types referenced by the open chart.

If BR is missing from the left list, the catalog is broken. If BR is present but a specific block (for example BR_PID2) is missing, only that mask is missing — install the matching optional package or copy the missing .msk from a working engineering station.

8. Error Code Reference

Code Message Fragment Likely Cause Fix
128 Block type not found Library .msk missing from sdblocks Copy br.msk to global catalog
129 Instance DB cannot be generated Cascading from 128 Resolve 128 first
134 Invalid chart reference HWConfig slot missing or renamed Add or rename the FM 458 module
201 Address conflict EXM 438-1 not preallocated Run Preallocate on EXM 438-1
305 Symbol table out of sync HWConfig recompile pending Save and compile HWConfig, then re-run CFC compile

9. Best Practices for FM 458-1 DP Projects

  1. Document the engineering workstation in the project quality file. List every optional package installed (CFC, SCL, Drive ES, FM 458 toolbox) and the install path. This is the single most valuable artifact for any future troubleshooting.
  2. Version the catalog. Keep a zipped copy of C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks in source control. Restoring a corrupted catalog is then a one-step operation.
  3. Avoid renaming FM 458 modules. The CFC runtime expects a specific name, and renaming requires a chart-wide re-compile and an online update of every chart reference.
  4. Preallocate I/O at commissioning. Always run Preallocate on the EXM 438-1 the first time the station is configured. The cost is one dialog click; the benefit is freedom from address-drift errors during updates.
  5. Compile HWConfig before CFC. A compile in the wrong order produces 128-style errors that disappear once HWConfig is recompiled and the symbol table is regenerated.
  6. Re-run Chart Check before each online update. The check is faster than a full compile and surfaces most catalog problems.

10. When the Symptom Persists

If the compile still reports errors after applying the four steps above, investigate the following before opening a support ticket:

  1. Open the project-local folder <Project_name>\Global\sdblocks and confirm that every .msk referenced by the chart is present in both the project and the global catalog. Use a checksum comparison if available.
  2. Confirm the CFC version in SIMATIC Manager > Help > About matches the version of the FM 458-1 DP optional package. Mismatched versions are a frequent cause of catalog corruption after a partial install.
  3. Open the Windows event viewer and filter for application errors during the compile. Missing DLLs (especially s7cfc.dll and br_api.dll) appear here.
  4. Re-run Step 7 > Options > PG/PC Interface and confirm the access point for the FM 458 is configured for the correct protocol (typically S7ONLINE for TCP/IP or PC internal for local).
  5. Check the FM 458 diagnostic buffer through PLC > Module Information. A failing FM 458 can also produce CFC compile errors because the runtime cannot retrieve the I/O signature.

11. Summary

The CFC compile error 128 on the FM 458-1 DP is a catalog problem, not a logic problem. The catalog must contain the mask file (br.msk) for the library referenced by the chart, and the HWConfig view of the FM 458 must carry the exact name expected by the runtime. The EXM 438-1 must have a preallocated I/O range. When all three conditions are met, the compile finishes with zero errors and the online update proceeds without freezing. The procedure is short, but the order matters: library first, module name second, EXM addresses third, then CFC compile, then online update.

For general guidance on correcting compilation errors in SIMATIC projects, see the Siemens TIA Portal documentation on correcting compilation errors. Although that page targets TIA Portal V20, the underlying compile-error model is shared with the CFC optional package, and the inspection workflow described there mirrors the Info > Compile log in the classic CFC editor.

What does CFC compile error 128 mean on the FM 458-1 DP?

Error 128 indicates that the CFC compiler cannot resolve a block type referenced by a chart. The most frequent cause is a missing block-type library mask file (typically br.msk) in the global catalog at C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks. Copy the file from the project-local sdblocks folder or from the FM 458 install medium, then recompile.

Why does my CFC online update freeze and never complete?

A frozen update on the FM 458-1 DP is almost always a name mismatch between the HWConfig module name and the symbolic name the CFC runtime expects. Open HWConfig, set the module name on the Properties tab to 4581DP (or the value shown in the compile log), save and compile HWConfig, and re-try the update.

Do I have to preallocate I/O addresses on the EXM 438-1?

Yes, for projects that use symbolic IO access. Open the EXM 438-1 properties, switch to the I/O Addresses tab, and click Preallocate. This fixes the address range and prevents the chart compile from conflicting with the auto-assign pool during incremental updates.

Where should the br.msk file be copied to?

Copy br.msk to C:\Program Files (x86)\Siemens\Step7\s7cfc\sdblocks on 64-bit Windows, or to C:\Program Files\Siemens\Step7\s7cfc\sdblocks on 32-bit Windows. The file must also remain in the project-local <Project_name>\Global\sdblocks folder if the chart references it locally. Always run the CFC editor as administrator when writing into the global path.

How do I confirm that the BR library is properly registered after the fix?

Open the CFC editor and select Options > Block Types. The BR library must appear in the left-hand catalog list with at least one block (for example BR_CTL or BR_PID2). If the library is listed but a specific block is missing, copy the corresponding mask file from a working engineering station or reinstall the matching optional package.

Back to blog