Diagnosing Bad Quality Codes Across APL Channel Drivers Following Block Type Upgrades

Diagnosing Bad Quality Codes Across APL Channel Drivers Following Block Type Upgrades

When upgrading SIMATIC PCS 7 APL block types (e.g., from V8.0 to V8.2) on an S7-410 controller, channel drivers (Pcs7DiIn, Pcs7AnIn) outputting bad quality codes (ST = 16#00) following the upgrade of technological blocks is caused by mismatched diagnostic driver blocks or execution sequence corruption. To resolve this: (1) Update diagnostic system blocks (MOD_D16, MOD_HA, RACK) in the Master Data Library alongside technological blocks; (2) Execute a full CFC compilation with 'Generate module drivers' enabled to rebuild the DataXchg diagnostic interconnects; and (3) In the CFC Run Sequence (Ctrl+F11), verify that OB_BEGIN executes prior to channel drivers in cyclic OBs, and that module diagnostic blocks reside in their proper system runtime groups.

Table of Contents

Executive Summary

During software maintenance on SIMATIC PCS 7 systems running high-performance S7-410 controllers, engineering teams frequently upgrade library blocks to access enhanced Advanced Process Library (APL) functions and stability patches. A confounding failure occurs when channel driver blocks (such as Pcs7DiIn and Pcs7AnIn) are initially upgraded in isolation and operate normally, but as soon as the remaining technological blocks (MotL, VlvL, PIDConL) and project blocks are updated and downloaded, all channel drivers simultaneously collapse into bad quality codes (ST = 16#00, Bad = 1). Reverting technological blocks temporarily restores good quality. This systemic failure stems from desynchronized module diagnostic structures (DataXchg), incomplete driver generation during partial compiles, or run sequence inversions in cyclic interrupt OBs.

Architecture and Fundamental Mechanics

The signal quality evaluation architecture in the PCS 7 Advanced Process Library connects hardware diagnostics to process logic:

  1. Channel Driver Quality Mechanics: Channel drivers do not assess hardware health independently. Instead, each channel driver connects via hidden system structures (Mode, DataXchg, MS) to an upstream diagnostic module driver (such as MOD_D16_PN, MOD_HA, or RACK). The module driver evaluates hardware interrupt OBs (OB82, OB83, OB86, OB122) and cyclically broadcasts the operational status of the I/O module.

  2. The Module Driver Generation Pipeline: When CFC compiles with 'Generate module drivers' checked, the driver generator scans HW Config, instantiates the required MOD_* and RACK_* blocks in system charts, and automatically wires their diagnostic outputs to the DataXchg pins of all instantiated channel drivers. If technological blocks are updated without running a full driver generation compile, or if intermediate block headers differ, the compiler leaves the DataXchg pointers unlinked or pointing to stale memory offsets. The channel driver interprets an unlinked or uninitialized DataXchg structure as an active hardware fault, asserting Bad = 1 and ST = 16#00.

  3. Execution Sequence Inversions: System diagnostic processing relies on strict execution boundaries within Organization Blocks (e.g., OB35 at 100 ms):
    - OB_BEGIN (or @OB_BEGIN_*): Prepares cycle buffers and resets interrupt flags.
    - Module Drivers (MOD_*): Evaluate hardware health.
    - Channel Drivers (Pcs7*In): Read peripheral I/O (PIW/PID) and apply quality codes.
    - Technological Blocks (MotL, PIDConL): Execute control logic.
    - OB_END: Finalizes cycle status.
    If updating technological blocks inadvertently shifts channel drivers ahead of OB_BEGIN or ahead of their parent MOD_* blocks in the CFC Run Sequence, channel drivers evaluate uninitialized status words on every cycle, permanently asserting bad quality.

Step-by-Step Implementation Procedure

To restore proper channel driver quality codes and eliminate system-wide bad status faults:

  1. Synchronize Master Data Library Blocks:
    - Open the Master Data Library (MDL) in SIMATIC Manager.
    - Ensure all blocks—including channel drivers (Pcs7AnIn, Pcs7DiIn), diagnostic drivers (MOD_*, RACK_*), and technological blocks (MotL, VlvL)—are updated to the identical library version (e.g., APL V8.2 SP1) from the PCS 7 APL library catalog.
    - Perform Options -> Block Types -> Update Block Types across all AS projects in the multi-project.

  2. Execute Full CFC Compilation with Module Driver Generation:
    - In SIMATIC Manager, select the AS Chart container.
    - Select PLC -> Compile -> Charts as Program.
    - Select the compilation scope: Entire Program (do not select Changes Only during major block upgrades).
    - CRITICAL: Ensure the checkbox Generate module drivers is explicitly checked.
    - Click OK and allow the compiler to rebuild all diagnostic interconnections.

  3. Verify and Correct CFC Run Sequence:
    - Open any CFC chart and press Ctrl+F11 (or select Edit -> Open Run Sequence).
    - Expand the primary cyclic interrupt OB (e.g., OB35).
    - Confirm that the system runtime group containing OB_BEGIN executes first.
    - Confirm that module driver runtime groups (@MOD_*) execute immediately following OB_BEGIN.
    - Confirm that technological charts containing channel drivers and motor/valve blocks execute after the module drivers.
    - If any channel driver runtime group is placed before OB_BEGIN, drag and reposition it after the diagnostic groups.

  4. Download to AS Controller:
    - Download the compiled program to the S7-410 controller (Download -> Changes Only, or complete download during planned shutdown).

Verification

Verify signal quality recovery across the automation system:

  1. Channel Driver Signal Status: Open sample CFC charts online. Inspect Pcs7DiIn and Pcs7AnIn outputs. Confirm that Bad.Value == FALSE and PV_Out.ST == 16#80 (Good) on all healthy I/O channels.

  2. Diagnostic Buffer Inspection: In SIMATIC Manager, right-click the S7-410 CPU and select PLC -> Module Information -> Diagnostic Buffer. Confirm that zero module read faults or driver timeout events are being recorded.

  3. WinCC Alarm and Faceplate Check: Open the WinCC OS runtime. Confirm that all yellow 'Bad Quality' warning triangles clear from motor, valve, and transmitter faceplates.

Limitations and Operational Precautions

Never bypass driver generation by manually wiring DataXchg or Mode pins on APL channel drivers; these pins are strictly reserved for the automated module driver generator. Additionally, if the AS controller hardware configuration in HW Config was altered, a hardware compilation and download must precede CFC module driver compilation to ensure symbolic addresses match hardware slots.

Engineer FAQ

Why did channel drivers work when upgraded alone, but failed when technological blocks were updated?

Channel drivers evaluated alone retained the existing compiled module driver linkages. Updating technological blocks triggered a partial re-compile that invalidated the diagnostic memory offsets without regenerating the underlying module driver connections.

What does Quality Code 16#00 mean in PCS 7 APL?

16#00 represents 'Bad, non-specific' signal quality in the NAMUR NE107 / IEC 61158 standard, indicating that the driver cannot verify hardware health.

Can I update block types using Changes-Only compile?

While Changes-Only compile is supported for minor bug fixes, updating core library families (APL V8.0 to V8.2) requires an 'Entire Program' compile with 'Generate module drivers' enabled to rebuild internal system pointers.

Where is the 'Generate module drivers' checkbox located?

It is located in the CFC Compile dialog (Compile Charts as Program) in SIMATIC Manager.

What role does the DataXchg parameter play on Pcs7AnIn?

DataXchg is an internal technological structure connecting the channel driver to its parent module diagnostic block (MOD_*), transmitting rack health, wire-break flags, and module power status.

Technical References

Related Articles

Related Tags

  • Channel Drivers
  • Pcs7DiIn
  • Pcs7AnIn
  • Signal Quality
  • Module Drivers
  • APL Upgrade
20 respuestas