Migrating Legacy Ethernet Communication Blocks FB205 (FR_AGSEN) and FB206 (FR_AGRCV) to AG_SEND and AG_RECV in PCS 7

Migrating Legacy Ethernet Communication Blocks FB205 (FR_AGSEN) and FB206 (FR_AGRCV) to AG_SEND and AG_RECV in PCS 7

In legacy SIMATIC PCS 7 systems migrating from V5.x to modern releases (such as PCS 7 V6.1, V7.x, or V8.x), function blocks FB205 (FR_AGSEN) and FB206 (FR_AGRCV) were specialized wrapper blocks belonging to the obsolete PCS 7 V5 Communication Library. They were designed to provide a simplified CFC interface for Ethernet communications via CP 443-1 by internally invoking the standard communication functions AG_SEND (FC5) and AG_RECV (FC6). When updating software, Siemens discontinued these wrapper blocks. To resolve missing block errors, engineers must replace FR_AGSEN and FR_AGRCV with the official standard communication functions FC5 (AG_SEND) and FC6 (AG_RECV) located in the SIMATIC_NET_CP library under the CP400 folder.

Table of Contents

Historical Background: FR_AGSEN and FR_AGRCV in PCS 7 V5.x

In early PCS 7 releases (V4.x and V5.x), executing raw ISO-on-TCP or TCP/IP communications over Industrial Ethernet communication processors (CP 443-1) required calling Step 7 communication functions. To make these blocks easier to use inside the Continuous Function Chart (CFC) editor without manual edge-trigger management, Siemens introduced the 'PCS 7 Communication Library'.

This library introduced two core Function Blocks:
1. FB205 (FR_AGSEN): Cyclic send wrapper for Ethernet telegrams.
2. FB206 (FR_AGRCV): Cyclic receive wrapper for incoming Ethernet telegrams.

Under the hood, these FBs simply passed parameters directly to the underlying SIMATIC NET functions FC5 AG_SEND and FC6 AG_RECV.

Why the Wrapper Blocks Were Discontinued in Modern PCS 7

Starting in PCS 7 V6.0, Siemens fundamentally changed its industrial communication strategy:

  1. Driver Standardization: The driver generator and APL library established standardized S7 fault-tolerant connections (BSEND/BRCV) for inter-AS communication.
  2. Deprecation of Obsolete Wrappers: The separate PCS 7 Communication Library was retired. Retaining FR_AGSEN and FR_AGRCV caused naming and numbering collisions with new system driver blocks (such as FB205 OB_BEGIN_HPN and FB206 MOD_CENTRAL in modern Basis Libraries).
  3. Direct FC Utilization: Modern Step 7 compilers allow FC5 and FC6 to be placed directly into CFC charts, eliminating the need for wrapper FBs.

Locating FC5 (AG_SEND) and FC6 (AG_RECV) in the SIMATIC_NET_CP Library

When replacing these blocks on an updated Engineering Station, engineers must select the correct library container:

  1. In SIMATIC Manager, select File > Open > Libraries.
  2. Open the SIMATIC_NET_CP library.
  3. Navigate to folder CP 400 > Blocks (CRITICAL: Do NOT select the CP 300 folder, as S7-300 communication functions use different pointer structures).
  4. Copy FC5 (AG_SEND) and FC6 (AG_RECV) into your project's Master Library and offline Blocks folder.

Step-by-Step Procedure to Replace Legacy Ethernet Blocks in CFC

To execute the block migration cleanly:

  1. Record Existing Parameters: Open the CFC chart containing FB205 (FR_AGSEN) and FB206 (FR_AGRCV). Record the Connection ID (ID), Logical Address (LADDR), Send DB pointer (DATA), and Send Length (LEN).
  2. Delete Legacy Blocks: Delete the FB205 and FB206 blocks from the CFC chart.
  3. Purge Block Types: In CFC, select Options > Block Types...; clean up FB205 and FB206 from the chart folder.
  4. Insert FC5 and FC6: Drag FC5 (AG_SEND) and FC6 (AG_RECV) from the library into the CFC chart.
  5. Parameterize Inputs:
    - Connect ACT: Assign a cyclic clock pulse or condition to trigger transmission.
    - Connect ID and LADDR: Match the NetPro connection parameters.
    - Connect SEND / RECV: Enter the ANY pointer to the data buffer (e.g., P#DB100.DBX0.0 BYTE 128).
  6. Compile and Download: Compile CFC with scope 'Entire program' and download to the controller.

Comparison of Legacy Wrapper Blocks vs Modern Standard FCs

The following table compares legacy V5 wrapper blocks with modern SIMATIC NET communication functions:

| Feature Dimension | Legacy Wrapper: FB205 / FB206 | Modern Standard: FC5 / FC6 (CP400) |
|---|---|---|---|
| Library Origin | Obsolete PCS 7 Communication Library | Official SIMATIC_NET_CP Library |
| Memory Footprint | Consumes 1 FB instance DB + internal FC call | Lightweight Function call (No instance DB) |
| Collision with Modern Basis Lib | Clashes with OB_BEGIN_HPN / MOD_CENTRAL | Zero block number collisions |
| Data Transmission Trigger | Internal autonomous cyclic pulse | User-controlled deterministic ACT trigger |
| Long-Term DCS Support | Discontinued since PCS 7 V6.0 | Fully maintained across all PCS 7 releases |

Verification

Verify Ethernet communications after block replacement:
1. Inspect the CP 443-1 front LEDs: confirm that the RUN LED is green and SF (System Fault) is extinguished.
2. In the CFC chart, monitor FC5 online: verify that DONE pulses true upon each transmission and ERROR remains false (0).
3. Monitor FC6 online: verify that incoming data records populate the receive data block and NDR (New Data Received) pulses true.
4. Verify in the CPU diagnostic buffer that no communication execution errors (such as event 0x4540) are logged.

Limitations and Operational Precautions

Always verify whether the communication partner requires fixed or variable length telegrams; when using AG_RECV on TCP native connections, configure LEN = 0 to read variable packet sizes without buffer truncation. Never copy FC5/FC6 from the CP 300 library into an S7-400 program, as the S7-300 communication processor routines will cause CPU STOP events when executed on an S7-400 processor.

Engineer FAQ

Why did my modern PCS 7 library contain different blocks under FB205 and FB206?

In modern PCS 7 Basis Libraries (V8/V9), Siemens reused block numbers FB205 for OB_BEGIN_HPN (H-CPU function block) and FB206 for MOD_CENTRAL. The original FR_AGSEN was discontinued decades ago.

Where can I find FC5 and FC6 in Step 7?

They reside in the official SIMATIC_NET_CP library inside the CP400 folder.

Can I use S7 connections instead of AG_SEND and AG_RECV?

Yes! If the communication partner is another S7 controller or WinCC station, using configured S7 Connections with standard SFB 12 (BSEND) and SFB 13 (BRCV) is the preferred, higher-performance Siemens standard.

Technical References

Related Articles

Related Tags

  • AG_SEND
  • AG_RECV
  • CP 443-1
  • Ethernet Communication
  • Migration
6 respuestas