Bypassing Driver Generation Errors: Why Direct I/O Wiring to APL Blocks Fails in SIMATIC PCS 7

Bypassing Driver Generation Errors: Why Direct I/O Wiring to APL Blocks Fails in SIMATIC PCS 7

In SIMATIC PCS 7, connecting peripheral I/O addresses directly to technological blocks (MotL, VlvL, MonAnL) without channel drivers is an architectural anti-pattern and data-type incompatible. APL blocks require structured variables (STRUCT containing value and signal status ST), Process Image Partitioning (PIP) synchronization, and count-to-engineering unit scaling provided exclusively by channel drivers (Pcs7AnIn, Pcs7DiIn). When third-party libraries (e.g. Siwarex) cause driver compilation errors, keep channel drivers and manually parameterize the MODE input.

Table of Contents

The Engineering Dilemma: Compiler Errors vs. Channel Driver Elimination

During commissioning or emergency software modifications on an active SIMATIC PCS 7 plant, an automation engineer needs to insert new digital and analog I/O points (e.g. additional motor run feedback or a level transmitter).

However, during CFC compilation with Generate module drivers enabled, the compiler aborts with fatal errors:
* A specialized hardware module (such as a SIWAREX weighing module, third-party fieldbus gateway, or specialized counter card) is present in HW Config, but its corresponding software library is missing from the Engineering Station.
* The Driver Wizard fails to generate diagnostic blocks for the Siwarex card and aborts the entire compilation.

In an effort to bypass the error and complete the urgent I/O additions, engineers frequently ask:
* 'Can I simply bypass channel drivers completely and connect my raw I/O addresses (IW 512, QW 512) directly to the inputs and outputs of MotL, VlvL, or MonAnL?'

The answer is strictly NO. Attempting to connect raw peripheral addresses directly to technological blocks breaks the core architecture of SIMATIC PCS 7.

Why Direct I/O Wiring Is Impossible in SIMATIC PCS 7 APL

Direct wiring fails due to fundamental data type and signal conditioning mismatches:

  1. Structured Data Type Mismatch (STRUCT vs. Primitive Types):
    * A raw analog input address (PIW 512 or IW 512) is a primitive 16-bit word (WORD / INT).
    * APL technological blocks (e.g. MonAnL.PV_In) do not accept primitive types. They accept a structured data type:
    scl TYPE Struct_AnalogValue STRUCT Value : REAL; // 32-bit floating point engineering unit ST : BYTE; // 8-bit signal status (Good, Bad, Uncertain) END_STRUCT END_TYPE
    * CFC enforces strict type safety. Connecting an INT or WORD to a structured pin generates a fatal compiler connection error.

  2. Absence of Count-to-Unit Scaling:
    * Raw analog inputs arrive as integer counts from 0 to 27648 (for 4-20 mA / 0-10V).
    * Technological blocks require calibrated physical engineering units (e.g. 0.0 to 100.0 bar). Without a channel driver (Pcs7AnIn), no conversion occurs.

  3. Loss of Hardware Diagnostic Transparency:
    * Technological blocks rely on the Signal Status byte (ST) to detect wire breaks, power failures, and module faults. Without channel drivers, ST is missing, leaving the control system blind to broken field wiring.

The Technical Role of Channel Drivers and Process Image Partitions

Channel drivers (Pcs7AnIn, Pcs7DiIn, Pcs7AnOu, Pcs7DiOu) fulfill vital low-level tasks:

  • Process Image Partition (PIP) Synchronization:
  • In S7-400, reading direct peripheral addresses (PIW) incurs high backplane bus latency.
  • Channel drivers are assigned to Process Image Partitions (e.g. TPA1 associated with OB35). The CPU operating system reads all inputs in a single cyclic DMA burst, guaranteeing signal consistency across the scan.
  • NAMUR NE 43 Measuring Range Monitoring:
  • Pcs7AnIn evaluates transmitter health: valid signal (3.8 mA to 20.5 mA), undershoot (3.6 mA to 3.8 mA), wire break (< 3.6 mA), and short circuit (> 21.0 mA), setting Bad = 1 appropriately.

Direct Wiring vs. Channel Driver Architectural Comparison

Feature / CapabilityDirect I/O to Technological BlockPCS 7 Channel Driver (Pcs7AnIn)Data Type CompatibilityIncompatible (Primitive vs. STRUCT)100% Native APL CompatibilityEngineering Unit ScalingNone (Raw counts 0–27648)Automatic via Scale inputsNAMUR NE 43 Wire Break CheckNoneAutomatic (Sets Bad = 1, ST = 16#00)Process Image Partitioning (PIP)Unsynchronized (Jitter / Latency)Synchronized to cyclic interrupt OBSimulation CapabilityNoneNative simulation mode (SimOn = 1)

Safe Workaround When Driver Generation Must Be Bypassed

If a missing library (like Siwarex) prevents running 'Generate module drivers', apply the following authorized engineering procedure:

1. Retain Standard Channel Drivers in CFC

  • Continue using Pcs7AnIn and Pcs7DiIn for all new I/O points.
  • Connect the symbolic hardware address (e.g. LT_101_PV) to Pcs7AnIn.PV_In.
  • Connect Pcs7AnIn.PV_Out to MonAnL.PV.

2. Manually Configure the MODE Parameter

Because 'Generate module drivers' will be skipped, the driver block will not receive its automated mode word. You must set it manually:
1. Select the Pcs7AnIn block in CFC and press Alt + Return (Object Properties).
2. Locate input pin MODE.
3. Enter the hexadecimal code corresponding to your physical card channel setting:
* 4 to 20 mA (2-Wire Transmitter): Set MODE = 16#80000203.
* 4 to 20 mA (4-Wire Transmitter): Set MODE = 16#80000204.
* 0 to 10 V: Set MODE = 16#80000201.
* PT100 Standard: Set MODE = 16#80000207.

3. Configure Engineering Scale

  • Set Pcs7AnIn.Scale.Low = 0.0 and Pcs7AnIn.Scale.High = 100.0 (matching instrument calibration).

4. Compile Without Driver Generation

  1. Select Chart > Compile > Charts as Program.
  2. Uncheck the box Generate module drivers.
  3. Select Scope: Changes only.
  4. Compilation completes cleanly with 0 Errors, allowing urgent logic commissioning to proceed.

Verification

  1. In CFC, configure Pcs7AnIn with MODE = 16#80000203 and connect to MonAnL.
  2. Compile CFC with Generate module drivers UNCHECKED; confirm compilation concludes with 0 Errors.
  3. Download changes to S7-PLCSIM or physical CPU.
  4. Inject a 12 mA current signal (50% span); verify Pcs7AnIn.PV_Out.Value outputs 50.0.
  5. Verify Pcs7AnIn.Bad = 0 and Pcs7AnIn.PV_Out.ST = 16#80 (Good).
  6. Confirm MonAnL faceplate in WinCC displays 50.0 with healthy green status.

Limitations and Operational Precautions

  • Temporary Measure Only: Bypassing module driver generation is a temporary contingency. Procure and install the missing library (e.g. Siwarex) at the earliest opportunity to restore automated hardware diagnostics.
  • Overwriting Manual MODE: If an engineer subsequently compiles the project with 'Generate module drivers' enabled, the compiler may overwrite manually assigned MODE settings if the hardware profile remains unlinked.
  • Licensing Compliance: Sourcing specialized driver packages requires purchasing appropriate add-on licenses. Validate requirements with an authorized distributor.

Engineer FAQ

Why does Pcs7AnIn show Bad=1 if MODE is not set?

When MODE is 16#00000000, the block detects that the channel operating mode has not been initialized by the hardware subsystem. As a fail-safe measure, it marks the signal Bad to protect plant processes.

Can I use Classic driver blocks (CH_AI) instead of APL drivers?

Yes, Classic driver CH_AI outputs simple values, but it lacks APL signal status structures and is not recommended for modern PCS 7 APL projects.

Where can I find the complete list of MODE hexadecimal codes?

The complete table of MODE values for analog and digital modules is documented in the SIMATIC Process Control System PCS 7 Advanced Process Library (APL) manual under the Pcs7AnIn section.

Technical References

Related Articles

Related Tags

  • Channel Drivers
  • Pcs7AnIn
  • Generate Module Drivers
  • MODE
  • QBAD
  • APL
6 respuestas