Resolving Channel Driver Mismatches (CH_AI) and Multi-Library Compilation Errors When Migrating PCS 7 to V7.1

Resolving Channel Driver Mismatches (CH_AI) and Multi-Library Compilation Errors When Migrating PCS 7 to V7.1

When migrating a SIMATIC PCS 7 project from V6.x to V7.1, copying newer channel driver blocks (such as CH_AI, CH_DI) into the Master Data Library without executing Update Block Types and updating the underlying PCS 7 Basis Library causes CFC compilation failures with errors like 'cannot compile from multiple libraries' or 'necessary files are missing for block CH_AI'. The driver architecture requires two matching components: user channel drivers and compiler-generated diagnostic blocks in @ charts. Engineers must update both the PCS 7 Library and PCS 7 Basis Library in the Master Data Library, execute Update Block Types, update block types in the chart folder, and recompile the entire program with module drivers.

Table of Contents

Executive Summary

Migrating legacy SIMATIC PCS 7 V6.0 or V6.1 automation projects to modern versions such as PCS 7 V7.1 or V8.x is a critical lifecycle activity. However, engineers frequently encounter severe compilation roadblocks when generating module drivers. A classic migration failure occurs when an engineer manually copies updated driver blocks (e.g., CH_AI, CH_DI, CH_AO, CH_DO) into the project's Master Data Library, only to receive compiler errors such as cannot compile from multiple libraries or necessary files are missing for block CH_AI. use the exact version of library. This technical article provides a deep architectural analysis of the PCS 7 driver generation system, explains why manual file copying fails, and presents the definitive procedure to update block types cleanly.

The Two-Part Driver Architecture: Channel Drivers vs Module Diagnostics

The SIMATIC PCS 7 automated I/O processing system consists of two tightly coupled layers:

  1. Layer 1: Channel Drivers (User Charts):
    * Blocks such as CH_AI (FB34), CH_DI (FB35), CH_AO (FB36), and CH_DO (FB37) placed directly by the automation engineer into technological CFC charts.
    * These blocks handle signal conditioning, raw value scaling, engineering unit conversion, flutter suppression, and simulation.
  2. Layer 2: Diagnostic Module Drivers (@ Charts):
    * When CFC compiles with Generate module drivers, the compiler scans HW Config and automatically generates @ charts containing diagnostic blocks (e.g., MOD_D1, MOD_HA, OB_BEGIN, OB_END, RACK, SUBNET).
    * The compiler automatically creates interconnections between the Layer 1 channel driver input pins (such as MODE, LADDR, SUBS_ST) and the Layer 2 diagnostic blocks.

Because of these automated interconnections, Layer 1 and Layer 2 blocks must belong to the exact same library version family.

Root Cause Analysis: Why Manual Block Copying Causes Library Mismatch Errors

When migrating from PCS 7 V6.0 to V7.1, two specific engineering mistakes create compilation errors:

  • The 'Copy-Paste Without Update' Fallacy: Merely copying new blocks into the Master Data Library (MDL) block folder does not update the instances already placed inside the CFC charts or CPU block folders. The CFC charts remain linked to the legacy V6.0 block definitions, while the compiler attempts to connect them to newly installed V7.1 module driver generators.
  • Split Library Inconsistency: In PCS 7 V6.x, all blocks resided in a single PCS 7 Library. Starting in PCS 7 V7.0, Siemens split the architecture: technological and channel drivers remained in PCS 7 Library, while hardware diagnostic blocks were moved to the newly introduced PCS 7 Basis Library. If an engineer updates only the channel drivers without importing the matching PCS 7 Basis Library blocks into the Master Data Library, the compiler detects an irreconcilable multi-library version conflict.

Architectural Evolution: The Creation of PCS 7 Basis Library in V7.0

Understanding the historical separation of libraries is vital for engineers handling legacy upgrades:

  • PCS 7 V6.x Structure: Single library containing both technological blocks (e.g., CTRL_PID, MOTOR, VALVE) and hardware diagnostic blocks (MOD_D1, RACK).
  • PCS 7 V7.0 / V7.1 Structure: Separation into PCS 7 Library V7.1 (technological and channel drivers) and PCS 7 Basis Library V7.1 (hardware diagnostics, time synchronization, OS message blocks, and @ chart drivers).
  • If a migrated project retains V6.0 diagnostic blocks while user charts instantiate V7.1 channel drivers, the driver generator halts with cannot compile from multiple libraries.

Step-by-Step Migration and Library Update Workflow

To resolve library mismatch errors and successfully migrate the driver system to PCS 7 V7.1, execute this validated workflow:

  1. Archive and Restore Project:
    * Take an archive backup of the original V6.0 project from the old engineering station.
    * Retrieve the project on the new PCS 7 V7.1 engineering station.
    * Open the project in SIMATIC Manager and accept the database format conversion.
  2. Populate the Master Data Library (MDL):
    * Open the project's Master Data Library.
    * Open the system libraries: File -> Open -> Library -> PCS 7 Library V71 and PCS 7 Basis Library V71.
    * Copy the required driver blocks (CH_AI, CH_DI, etc.) from PCS 7 Library into the MDL Blocks folder.
    * Copy all diagnostic blocks (MOD_*, OB_*, RACK, SUBNET) from PCS 7 Basis Library into the MDL Blocks folder, overwriting older versions when prompted.
  3. Update Block Types from Master Data Library:
    * In the Master Data Library, select the Blocks folder.
    * Select Options -> Charts -> Update Block Types.
    * Select all target S7 programs and click OK to propagate updated block definitions into all CPU block folders.
  4. Update Chart Folder Block Types:
    * Open any CFC chart in the AS station.
    * Select Options -> Block Types.
    * In the dialog, select all blocks in the left pane and move them to the right pane (Chart Folder).
    * Click New Version to update all instantiated blocks within the charts.
    * Click Clean Up to purge obsolete blocks.
  5. Recompile HW Config and CFC:
    * In HW Config, execute Station -> Save and Compile.
    * In CFC, select Chart -> Compile -> Charts as Program.
    * Select Entire program and ensure Generate module drivers is checked.

PCS 7 Library Migration and Compilation Error Matrix

The following table identifies typical migration compilation errors, root causes, and corrective actions:

Compiler Error MessageUnderlying Migration DefectSpecific Block InvolvedRequired Corrective Actioncannot compile from multiple librariesChannel drivers are V7.x while @ diagnostic blocks are V6.xCH_AI, MOD_D1, @ chartsUpdate both PCS 7 Library and PCS 7 Basis Library in MDL; run Update Block Typesnecessary files are missing for block CH_AIChannel driver updated in MDL but not propagated to CFCCH_AI (FB34)Open CFC -> Options -> Block Types -> click New VersionBlock type mismatch during driver generationTechnological library blocks upgraded without updating Basis LibraryMOD_HA, RACK_CFGImport latest PCS 7 Basis Library blocks into Master Data LibraryCannot adapt chart formatCFC opened without database conversionCFC chart containerOpen chart and accept automated format migration to V7.1Driver generator: HW Config not compiledHardware configuration not compiled under new software versionS7-400 HW ConfigOpen HW Config, execute Save and Compile, then recompile CFC

Verification

Confirm successful migration by checking the following indicators:

  1. CFC Compilation Log: Confirm that Chart -> Compile -> Charts as Program completes with 0 errors and 0 fatal warnings.
  2. Check Driver Interconnections: Open any analog channel chart. Inspect CH_AI input pins MODE and SUBS_ST. Confirm they are cleanly interconnected to the generated @ chart diagnostic blocks (@...).
  3. Version Consistency Audit: Under Options -> Shared Declarations and Options -> Reference Data -> Block Types, verify that all driver blocks report consistent library version numbers (e.g., V7.1).

Preventive Migration Guidelines for Legacy PCS 7 Projects

To streamline future version upgrades (e.g., from V7.1 to V8.2 or V9.1):

  • Always Use a Master Data Library: Never copy library blocks directly into individual AS CPU block folders. Always maintain a central Master Data Library and use Options -> Charts -> Update Block Types.
  • Update Both Technological and Basis Libraries Concurrently: Whenever updating process library blocks, update the corresponding Basis Library blocks simultaneously.
  • Consult Migration Documentation: Consult version-specific Siemens PCS 7 Migration manuals before upgrading major releases.

Limitations and Operational Precautions

Updating block types with New Version alters block interfaces and instance data structures, which invalidates online delta download capability. The first download following an Update Block Types operation typically requires putting the CPU in STOP mode.

All software upgrade licenses, engineering station compatibility requirements, and hardware firmware prerequisites must be verified against official Siemens migration documentation and authorized Siemens distributor quotations.

Engineer FAQ

Why did copying blocks to the Master Data Library not fix the error?

Copying blocks to the Master Data Library only updates the repository. You must execute 'Update Block Types' to push those changes into the CPU block folders and CFC charts.

What is the difference between PCS 7 Library and PCS 7 Basis Library?

PCS 7 Library contains user technological and channel driver blocks (e.g., CH_AI, CTRL_PID), while PCS 7 Basis Library contains internal diagnostic blocks (e.g., MOD_D1, RACK) generated in @ charts.

Can I migrate from V6.0 directly to V8.1?

Direct migration from V6.0 to V8.1 is not officially supported in a single step; Siemens documentation specifies an intermediate migration step (e.g., via V7.1) to ensure database format integrity.

Will running 'New Version' in CFC delete my block interconnections?

No. The CFC editor automatically preserves valid pin interconnections and parameter values, updating only modified or newly added pins.

Technical References

Related Articles

Related Tags

8 respuestas