Resolving 'Bad = 1' Quality Faults on Pcs7DiIn Channel Drivers in SIMATIC PCS 7 APL - Mode 16#8000FFFF and Generate Module Drivers

Resolving 'Bad = 1' Quality Faults on Pcs7DiIn Channel Drivers in SIMATIC PCS 7 APL - Mode 16#8000FFFF and Generate Module Drivers

In SIMATIC PCS 7 Advanced Process Library (APL), when digital input channel driver blocks (such as Pcs7DiIn or FbDiIn) output 'Bad = 1' with an invalid signal status (Quality Code 16#00) in a new project or during simulation with S7-PLCSIM, the fault occurs because the block input parameter 'Mode' is uninitialized (16#00000000). In PCS 7, channel drivers require hardware diagnostic binding created automatically by the 'Generate Module Drivers' compiler function. If testing without configured hardware or in simulation, engineers must manually set the block input parameter Mode to '16#8000FFFF' for standard digital inputs to force a healthy quality status (Quality Code 16#80).

Table of Contents

APL Channel Driver Architecture and Signal Quality Evaluation

Unlike basic STEP 7 ladder programs that read peripheral input bits directly (I 0.0), SIMATIC PCS 7 processes all physical field signals through standardized Channel Driver Blocks (Pcs7DiIn, Pcs7DiOu, Pcs7AnIn, Pcs7AnOu, and fieldbus blocks FbDiIn, FbAnIn):
- Structured Signal Interfaces (STRUCT):
* Drivers output structured variables containing both the process value (Value) and an IEEE 754 / NAMUR NE 107 Quality Code (ST : BYTE).
* Quality Code 16#80 represents Good - Valid process value.
* Quality Code 16#00 represents Bad - Configuration error or wire break.
- The Bad Output Pin:
* When the driver detects a hardware fault, diagnostic interrupt, or uninitialized operating mode, it asserts Bad = 1.
* Downstream logic blocks (such as MotL feedback inputs or Interlock blocks) evaluating this structured signal immediately trip or enter safety fallback states when Bad = 1.

The Role of 'Mode' and 'Generate Module Drivers'

A frequent point of confusion during project development or factory acceptance testing (FAT) is why a freshly placed Pcs7DiIn block asserts Bad = 1 even when the input bit in PLCSIM is forced high:
1. The Automated Driver Generation Mechanism:
- In production PCS 7 systems, the engineer configures I/O cards in HW Config and connects peripheral addresses (P#I 0.0) to the channel driver in CFC.
- During CFC compilation, the engineer checks Generate Module Drivers.
- The compiler scans HW Config, automatically instantiates diagnostic blocks (MOD_D16, OR_M_16), and interconnects their diagnostic status words to the driver's Mode and DataXchg pins.
2. The Uninitialized Mode Trap:
- If an engineer tests in an empty project without hardware, or deselects 'Generate Module Drivers', the Mode input defaults to 16#00000000.
- The driver block evaluates 16#00000000 as 'Module not present or unreleased hardware', immediately setting Bad = 1 and refusing to process field inputs.

Manual Simulation Configuration - Mode 16#8000FFFF for Digital Inputs

When testing logic in S7-PLCSIM or on a test bench before physical hardware configurations are compiled:

  1. Parameterize Digital Input Mode (Pcs7DiIn):
    - In the CFC chart, select the Pcs7DiIn block.
    - Locate the input parameter Mode (Data type: DWORD).
    - Enter the hexadecimal value:
    text 16#8000FFFF
    - Decoding the Bitmask:

    • High Word (16#8000): Signifies valid, active S7 digital input module format.
    • Low Word (16#FFFF): Signifies standard unipolar digital binary input.
    • Immediately upon entering 16#8000FFFF, output Bad drops to 0 and Out.ST transitions to 16#80 (Good).
  2. Parameterize Analog Input Mode (Pcs7AnIn):
    - For analog drivers (Pcs7AnIn), setting standard 4–20 mA current mode requires:
    text 16#80000203
    (High word 16#8000 = Valid format; Low word 16#0203 = 4..20 mA measuring range).

  3. Re-enabling Automated Drivers for Production:
    - In HW Config, configure physical I/O modules selected exclusively from the PCS7_V82 hardware catalog.
    - Execute CFC > Compile > Check 'Generate module drivers'. The compiler will overwrite the manual mode parameter with dynamic diagnostic interconnections.

PCS 7 Channel Driver Mode Codes and Quality Status Table

The following table details manual Mode settings across PCS 7 APL channel driver types:

Channel Driver BlockTarget Signal TypeManual Mode Hex CodeOutput Quality (Out.ST)Resulting Bad OutputPcs7DiInStandard Digital Input (24V DC)16#8000FFFF16#80 (Good)0 (Healthy)Pcs7DiOuStandard Digital Output (24V DC)16#8000FFFF16#80 (Good)0 (Healthy)Pcs7AnIn4..20 mA Current Transducer16#8000020316#80 (Good)0 (Healthy)Pcs7AnIn0..10 V Voltage Transducer16#8000000116#80 (Good)0 (Healthy)Pcs7AnInPT100 Resistance Temperature16#8000040116#80 (Good)0 (Healthy)Any DriverUnconfigured / Hardware Missing16#0000000016#00 (Bad)1 (Fault Active)

Verification

To confirm that the channel driver quality status is healthy:
1. Open the CFC chart containing Pcs7DiIn in test mode (Ctrl + T).
2. Verify that input parameter Mode reads 16#8000FFFF.
3. Check the block outputs:
- Output Bad must read 0 (FALSE).
- Output Out.Value tracks the physical or simulated peripheral input bit (PV_In).
- Output Out.ST displays 16#80 (Good).
4. Connect Out to an upstream motor block FbkRun: verify that the motor block accepts the feedback without asserting a channel discrepancy alarm.

Limitations and Operational Precautions

When managing channel driver modes:
1. Never Leave Hardcoded Modes in Final Production: Manual Mode overrides bypass diagnostic interrupts. If a physical field wire breaks in the field, the driver will NOT detect the fault if module drivers were not generated. Always run 'Generate module drivers' prior to site commissioning.
2. Released Catalog Modules: Only I/O cards listed in the official PCS7_<Version> catalog in HW Config support automated module driver generation. Using generic standard S7-300 cards from the STEP 7 catalog prevents driver generation and forces Bad = 1.
3. Simulation Mode Alternative: Instead of altering Mode, engineers can enable the block's internal simulation: set SimOn = 1 and inject simulated values via SimPV_In.

Engineer FAQ

Why does 'Generate module drivers' re-enable itself every time I compile?

Siemens designed the CFC compiler to enforce system availability. 'Generate module drivers' defaults to checked to ensure that physical I/O diagnostic interconnections are never accidentally omitted from controller downloads.

What does Quality Code 16#80 mean?

In accordance with PA Profile and NAMUR standards, 16#80 represents 'Good - Non-specific', indicating that the field measurement is valid, verified, and free of hardware faults.

Can I use standard digital inputs without channel driver blocks in PCS 7?

While standard Boolean variables can be wired directly in CFC, omitting channel drivers eliminates wire-break monitoring, simulation toggling, maintenance bypasses, and NAMUR NE 107 diagnostic reporting.

Why did my analog input show Bad = 1 when raw integer was 13824?

Because an integer of 13824 (50% of 27648) represents a valid signal, but if Mode is uninitialized or the measuring range does not match HW Config, the driver rejects the peripheral read as invalid.

Technical References

Related Articles

Related Tags

  • PCS7_APL
  • Pcs7DiIn
  • Pcs7AnIn
  • Channel_Drivers
  • Mode_Parameter
  • Generate_Module_Drivers
  • Quality_Code
6 respuestas