How to Configure Redundant Analog Inputs in SIMATIC S7-400H Systems

To program redundant analog inputs on a Siemens SIMATIC S7-400H fault-tolerant PLC in STEP 7 (SIMATIC Manager), map both redundant analog input modules to the CPU Process Image Input (PII) table inside HW Config, wire the sensor signal in parallel or via dedicated MTA terminal blocks to both modules, and call the library block FB453 (RED_IN) continuously in a cyclic execution task such as OB1 or OB35.

Table of Contents

Technical Cause: Why Direct Peripheral Addressing Fails in Redundant Systems

Attempting to read redundant analog inputs using direct peripheral access commands (such as L PIW 518) bypasses the fault-tolerant driver layer managed by the S7-400H operating system and the Redundant IO library. Direct peripheral instructions access only the specific hardware address specified in the line of code, ignoring channel diagnostics, discrepancies between the two redundant modules, and active CPU redundancy state transitions.

Using FB453 (RED_IN) resolves these processing errors. RED_IN evaluates the health status and values of paired input channels within the Process Image Input (PII) memory space (such as IW 518). If one module fails or reports a channel wire-break fault, RED_IN automatically substitutes the healthy channel value into the user memory space and reports diagnostic status flags without dropping the process signal.

Plaintext

+-------------------------------------------+
               |        4-20mA Field Sensor / Transmitter   |
               +-------------------------------------------+
                                     |
                    +----------------+----------------+
                    |                                 |
                    v                                 v
        +-----------------------+         +-----------------------+
        | Analog Input Module A |         | Analog Input Module B |
        |   (e.g., PIW 518)     |         |   (e.g., PIW 534)     |
        +-----------------------+         +-----------------------+
                    |                                 |
                    v                                 v
        +---------------------------------------------------------+
        |           S7-400H Process Image Input (PII)             |
        |              (e.g., IW 518 and IW 534)                  |
        +---------------------------------------------------------+
                                    |
                                    v
        +---------------------------------------------------------+
        |      "RED_IN" Block (FB453 / DB10) Driver Evaluation    |
        |    (Monitors channel health & discrepancy flags)       |
        +---------------------------------------------------------+
                                    |
                                    v
        +---------------------------------------------------------+
        |     Validated Signal Handled in Logic (e.g., MW 100)    |
        +---------------------------------------------------------+

Prerequisites

Before implementing redundant analog input logic on an S7-400H system, verify the following setup requirements:

  • Engineering Environment: STEP 7 V5.5 (or higher) with the S7-F/FH Systems or Redundant IO Sub-Module (Red_IO) library installed.
  • Target Controller: SIMATIC S7-400H fault-tolerant CPU pair (e.g., CPU 412-5H, 414-5H, 416-5H, or 417-5H).
  • I/O Subsystem: Distributed ET 200M stations connected via redundant PROFIBUS DP or PROFINET interfaces (e.g., dual IM 153-2 interface modules).
  • Hardware Modules: Two identical S7-300/400 analog input modules supported for redundancy operation (e.g., 6ES7 331-7TF01-0AB0).
  • Documentation Access: The official Siemens manual "S7-400H Fault-Tolerant Systems" located in the local installation path (C:\Program Files (x86)\SIEMENS\Documentation\English) or accessible via Siemens Industry Online Support (SIOS).

How Redundant I/O Logic Functions

In an S7-400H system, hardware input redundancy uses two physical modules assigned to identical sensor signals. The operating system and driver library evaluate the quality of both channels based on module diagnostic interrupts and process value discrepancies.

If both channels are healthy, the driver block outputs the primary channel value (or an averaged value, depending on parameter settings). If a wire break, short circuit, or module hardware error occurs on one channel, the system transitions to the remaining healthy channel instantly. If both channels fail, a diagnostic alarm is generated, and a configurable fallback value is passed to the application program.

Configuring Hardware Redundancy in STEP 7

Before writing PLC code, pair the analog input modules inside STEP 7 HW Config:

  1. Open HW Config for the S7-400H project.
  2. Select the first analog input module in the rack/station.
  3. Open module Properties and navigate to the Redundancy tab.
  4. Enable module redundancy and select the second corresponding analog input module from the assignment list.
  5. Set the discrepancy time and tolerance window appropriate for the process dynamics (e.g., 100 ms discrepancy time for fast analog signals).
  6. Assign both modules to address ranges within the CPU Process Image Partition (e.g., IW 518 for Module A and IW 534 for Module B).
  7. Save, compile, and download the hardware configuration to the S7-400H CPU pair.

Implementation Workflow in STEP 7 S7-400H STL

The standard routine for managing redundant I/O requires calling RED_IN (FB453) at the start of the program sweep to process all redundant input pairs, followed by accessing the primary process image word.

Correct Statement List (STL) Implementation

Code snippet

ORGANIZATION_BLOCK OB1
TITLE = "Main Program Sweep"
BEGIN

// Step 1: Execute Redundant IO Driver Block for Inputs
// FB453 ("RED_IN") updates process image memory based on channel health
CALL "RED_IN" , "DB_RED_IN"          // Instance DB for RED_IN (e.g., DB10)
   RETURN_VAL := MW10                // Block execution return code
   EXT_INFO   := MW12                // Extended diagnostic information

// Step 2: Read validated signal from Process Image Input (PII)
// DO NOT use "L PIW 518" - Use process image "L IW 518"
L     IW 518                         // Read primary channel process image word
T     MW 100                         // Transfer validated analog value to user tag

// Step 3: Execute application logic (Scaling, Alarm Processing, PID Controls)
// ...

// Step 4: Execute Redundant IO Driver Block for Outputs
// FB454 ("RED_OUT") handles redundant analog/digital output sync
CALL "RED_OUT" , "DB_RED_OUT"        // Instance DB for RED_OUT (e.g., DB11)
   RETURN_VAL := MW14                // Block execution return code
   EXT_INFO   := MW16                // Extended diagnostic information

END_ORGANIZATION_BLOCK

Core Driver Function Blocks for S7-400H I/O Redundancy

The Siemens Redundant IO library supplies standardized function blocks to handle signal synchronization and fault management automatically:

Function BlockBlock NamePurpose and Operational DescriptionFB453RED_INEvaluates redundant input channels, performs discrepancy checks, updates process image memory (IW), and reports hardware channel faults. Must be executed prior to processing input signals in logic.FB454RED_OUTManages redundant output modules, synchronizing process image outputs (QW) across redundant channels. Must be executed after processing output logic.FC450RED_DIAGExtracts detailed diagnostic information from redundant I/O pairs for visualization on HMI or SCADA systems.

Verification

The procedure is successful when:

  1. Active Value Reading: Analog process inputs update correctly in MW 100 during normal dual-module operation.
  2. Channel Fault Tolerance: Disconnecting the field wiring from Module A causes Module A to report a wire-break fault while MW 100 continues updating seamlessly from Module B without dropping value updates.
  3. Diagnostic Output Check: Block parameters RETURN_VAL and EXT_INFO on FB453 show 16#0000 under normal conditions and update with relevant fault codes during simulated channel disruptions.

Limitations and Operational Cautions

  • Process Image Boundary Constraints: Redundant module addresses must reside strictly within the configured CPU Process Image Input (PII) area. If module addresses are assigned outside the process image range (e.g., address PIW 1024 when the process image is set to 512 bytes), RED_IN cannot process the signal, forcing the program to fail.
  • Direct Peripheral Access Prohibition: Never use peripheral access instructions (L PIW x or T PQW x) for hardware configured as redundant. Direct reading bypasses driver fault processing, returning raw data from a single physical card regardless of its health state.
  • Module Matching Requirements: Both redundant modules in a pair must share the exact same order number (MLFB) and firmware revision to ensure identical hardware scanning cycles and prevent spurious discrepancy errors.

Engineer FAQ

Where can I find sample S7-400H redundant projects inside STEP 7?

Siemens installs built-in sample projects directly alongside STEP 7. In SIMATIC Manager, select File > Open > Samples and open the project named ZS70_01_S7400H or similar. Advanced PCS 7 sub-module examples are also available via Siemens Industry Online Support (SIOS).

Why does using L PIW cause incorrect behavior in S7-400H redundant systems?

L PIW reads the peripheral input byte directly from the specified hardware module at that exact millisecond. It bypasses the internal diagnostic buffer, discrepancy timers, and channel switching logic executed by RED_IN. Using L IW ensures you read the validated process image value maintained by the redundant driver stack.

How are 2-wire 4-20mA transmitters connected to redundant analog input modules?

To connect a single 2-wire sensor to two redundant analog input modules, feed the loop current through dedicated redundant terminal blocks equipped with decoupling diodes or use an active signal splitter/isolator to distribute duplicate 4-20mA loops to each card.

Related Articles

Related Tags

Code: C131

6 respuestas