Interfacing IFM AC1411 AS-i Gateway 244-Byte Diagnostic Records into SIMATIC PCS 7

Interfacing IFM AC1411 AS-i Gateway 244-Byte Diagnostic Records into SIMATIC PCS 7

To interface the 244-byte diagnostic data record from an IFM AC1411 AS-Interface gateway into SIMATIC PCS 7 S7-400 controllers, use system function block SFB52 ('RDREC') or SFC59 ('RD_REC') in a custom SCL block to read DPV1 diagnostic data record Index 0x01. Standard PCS 7 module drivers handle basic DP slave station return and module faults, but do not unpack vendor-specific 244-byte gateway registers. Once read acyclically, the SCL block unpacks master health flags (voltage failure, earth fault, config error) and individual slave bitmasks, outputting structured status words to APL technological blocks.

Table of Contents

Executive Summary

The IFM AC1411 is an intelligent AS-Interface to PROFIBUS DP / PROFINET gateway widely used to interface discrete field actuators and sensors to SIMATIC S7 controllers. While standard PROFIBUS communication cyclically exchanges binary I/O data, in-depth diagnostic telemetry—such as AS-i master voltage status, earth fault detection, slave configuration discrepancies, and individual AS-i slave peripheral faults—resides in an extended 244-byte acyclic diagnostic data record. Because standard PCS 7 module drivers (MOD_D1, etc.) only process channel-level process image data, engineers must implement acyclic record polling to expose gateway diagnostics in WinCC. This guide provides the SCL block architecture, parameter mapping, and integration workflow.

Architectural and System Mechanics

Diagnostic data exchange architecture between IFM AC1411 and S7-400:

  • Cyclic Process Data: The GSD configuration maps binary inputs and outputs for up to 62 AS-i slaves (A/B addresses) into standard peripheral I/O addresses (PIW/PQW).
  • Acyclic Diagnostic Record (DPV1 Record Index 0x01):
  • Length: Exactly 244 bytes.
  • Header (Bytes 0-3): Vendor identifier, gateway state, and firmware revision.
  • Master Status (Bytes 4-7): AS-i master voltage fail, configuration active flag, earth fault detected, and execution error.
  • Slave Status Lists (Bytes 8-71): Bit-arrays representing Configured Data (CDI), Detected Data (DDI), and Activated Data (ADI) for Slaves 1A–31A and 1B–31B.
  • Slave Fault Flags (Bytes 72-135): Individual peripheral fault bits per slave.
  • Acyclic Communication Blocks:
  • SFB52 (RDREC): Reads data records asynchronously from DPV1 slaves using the diagnostic logical base address (LADDR).

Step-by-Step Engineering and Implementation Procedure

Step 1: Identify the Gateway Diagnostic Logical Address in HW Config

  1. Open HW Config on the AS station.
  2. Select the IFM AC1411 PROFIBUS DP slave.
  3. In the lower table, locate Slot 0 (the gateway head module) and note its diagnostic logical base address (e.g., LADDR = 2040 / 16#07F8).

Step 2: Implement SCL Diagnostic Reader Block Using SFB52

Create an SCL function block (FB_IFM_Diag) that calls SFB52 RDREC cyclically (e.g., every 5 seconds):

FUNCTION_BLOCK FB_IFM_Diag
VAR_INPUT
    LADDR : INT;          // Logical address of gateway head module
    REQ   : BOOL;         // Trigger read
END_VAR
VAR_OUTPUT
    MasterOK   : BOOL;
    EarthFault : BOOL;
    VoltFail   : BOOL;
    SlaveFault : ARRAY[1..62] OF BOOL;
END_VAR
VAR
    rdrec_inst : RDREC;
    diag_buffer : ARRAY[0..243] OF BYTE;
    busy : BOOL;
    err  : BOOL;
    status : DWORD;
END_VAR
BEGIN
    rdrec_inst(REQ := REQ, ID := DW#16#0 | INT_TO_DWORD(LADDR), INDEX := 1, 
               MLEN := 244, RECORD := diag_buffer);
    IF rdrec_inst.VALID THEN
        VoltFail   := (diag_buffer[4] AND 16#01) <> 0;
        EarthFault := (diag_buffer[4] AND 16#02) <> 0;
        MasterOK   := NOT (VoltFail OR EarthFault);
        // Unpack slave status bits into output array
    END_IF;
END_FUNCTION_BLOCK

Step 3: Instantiate Block in CFC and Wire to OB35

  1. Insert FB_IFM_Diag into a CFC chart running in OB35 (e.g., 100ms cycle).
  2. Connect LADDR to the diagnostic address from HW Config.
  3. Generate a slow pulse (e.g., via a pulse generator or clock memory) on REQ to poll every 2-5 seconds.

Step 4: Map Alarms and Quality Codes into WinCC

Wire slave error flags to APL digital inputs or route VoltFail and EarthFault to an EventTs or MsgEvId block to generate timestamped process alarms in WinCC Alarm Logging.

Verification

To verify diagnostic data retrieval:
1. In CFC test mode, verify that SFB52 executes without errors (STATUS = 0).
2. Disconnect the 30V DC AS-i power supply on the gateway: verify that VoltFail asserts to 1 within the polling interval.
3. Disconnect an individual AS-i slave: verify that the matching SlaveFault index asserts.
4. Confirm that WinCC receives corresponding process alarm messages.

Limitations and Operational Precautions

Operational precautions:
- Acyclic communication (RDREC) consumes PROFIBUS DP bandwidth. Do not poll the 244-byte record on every OB scan; poll every 2 to 5 seconds to prevent bus communication bottlenecks.
- Only one RDREC job can be active per slave at any given time; ensure the block verifies BUSY = 0 before triggering a new read request.
- Ensure the IFM GSD file revision matches the physical gateway firmware version installed in the field.

Engineer FAQ

Q: Why can't standard PCS 7 driver blocks read the 244-byte record?

A: Standard PCS 7 driver blocks (MOD_D1) only read cyclic I/O and standard 4-byte DP slave diagnostic records, not extended 244-byte vendor data records.

Q: What is the difference between SFB52 and SFC59?

A: SFB52 (RDREC) supports DPV1 acyclic communication and larger data records across DP and PROFINET, whereas SFC59 is a legacy S7-300/400 function limited to DPV0 records.

Q: Where is Record Index 0x01 defined?

A: It is defined in the IFM AC1411 communication manual under 'Acyclic DP-V1 Diagnostic Data Records'.

Q: Does reading this diagnostic record interrupt process I/O?

A: No. DPV1 acyclic data is transmitted in the non-cyclic time slice of the PROFIBUS token ring without disturbing cyclic I/O.

Q: Can this block be converted to PROFINET?

A: Yes, SFB52 RDREC functions identically over PROFINET by targeting the PROFINET hardware identifier.

Technical References

Related Articles

Related Tags

AS-Interface, IFM AC1411, SFB52 RDREC, PROFIBUS DPV1, Acyclic Diagnostics

20 respuestas