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
- 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 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:
-
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 asMOD_D16_PN,MOD_HA, orRACK). The module driver evaluates hardware interrupt OBs (OB82, OB83, OB86, OB122) and cyclically broadcasts the operational status of the I/O module. -
The Module Driver Generation Pipeline: When CFC compiles with 'Generate module drivers' checked, the driver generator scans HW Config, instantiates the required
MOD_*andRACK_*blocks in system charts, and automatically wires their diagnostic outputs to theDataXchgpins 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 theDataXchgpointers unlinked or pointing to stale memory offsets. The channel driver interprets an unlinked or uninitializedDataXchgstructure as an active hardware fault, assertingBad = 1andST = 16#00. -
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 ofOB_BEGINor ahead of their parentMOD_*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:
-
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.
- PerformOptions -> Block Types -> Update Block Typesacross all AS projects in the multi-project. -
Execute Full CFC Compilation with Module Driver Generation:
- In SIMATIC Manager, select the AS Chart container.
- SelectPLC -> 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.
- ClickOKand allow the compiler to rebuild all diagnostic interconnections. -
Verify and Correct CFC Run Sequence:
- Open any CFC chart and pressCtrl+F11(or selectEdit -> Open Run Sequence).
- Expand the primary cyclic interrupt OB (e.g.,OB35).
- Confirm that the system runtime group containingOB_BEGINexecutes first.
- Confirm that module driver runtime groups (@MOD_*) execute immediately followingOB_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 beforeOB_BEGIN, drag and reposition it after the diagnostic groups. -
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:
-
Channel Driver Signal Status: Open sample CFC charts online. Inspect
Pcs7DiInandPcs7AnInoutputs. Confirm thatBad.Value == FALSEandPV_Out.ST == 16#80(Good) on all healthy I/O channels. -
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. -
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
- SIMATIC PCS 7 APL Advanced Process Library Function Manual V8.2 / V9.0
- SIMATIC PCS 7 Driver Generator Engineering Manual
- SIMATIC S7-410 Process Automation System Manual
Related Articles
- Diagnostic Processing Architecture and Event Routing for ET 200SP HA in PCS 7
- Cyclic Interrupt Execution Constraints and ET 200SP HA Channel Driver Allocation
- Analog Input Scaling and Resolution Handling in APL Channel Driver Pcs7AnIn
Related Tags
- Channel Drivers
- Pcs7DiIn
- Pcs7AnIn
- Signal Quality
- Module Drivers
- APL Upgrade