1. System Overview and Reference Topology
This reference describes S7 communication between a SIMATIC S7-400 station using a CP 443-1 communications processor and a SIMATIC S7-300 station based on a CPU 315-2 PN/DP with its integrated PROFINET interface. Configuration is performed in STEP 7 V5.5 (or STEP 7 V5.4 SP) using NetPro. Runtime data exchange is implemented with the SIMATIC function blocks PUT/GET, BSEND/BRCV, or USEND/URECV, each taken from the library that targets the interface module.
Two architectural constraints govern block selection and must be understood before any programming:
- The CPU 315-2 PN/DP supports S7 connections through its integrated PROFINET port. The legacy ISO transport layer that AG_SEND/AG_RECV require is not exposed by the integrated PN interface; those FCs are reserved for external CP modules such as the CP 343-1, where they execute against the CP rather than the CPU.
- The CP 443-1 is dual-mode capable. It can terminate either S7 connections or ISO transport connections. When the partner is a CPU 315-2 PN, only S7 connection termination is valid. The CP must be configured as the S7 connection endpoint in NetPro and the blocks on the S7-400 side must come from the library that targets the CP module.
1.1 Reference Topology
The reference topology places both PLCs on a single /24 subnet through a managed switch:
2. Prerequisites and Hardware Identification
Confirm the following before commissioning:
| Item | Requirement |
|---|---|
| STEP 7 | V5.4 SP5 or V5.5 with NCM S7 V5.5 (matching SP) |
| CPU 315-2 PN/DP | MLFB 6ES7 315-2EH14-0AB0 or compatible; firmware V3.2 or later recommended |
| CP 443-1 | MLFB 6GK7 443-1EX20-0XE0 (recommended) or newer; firmware V3.x or later |
| CPU 414-2 DP | MLFB 6ES7 414-2XK05-0AB0 or compatible; firmware V4.x or later |
| Switch | 100 Mbit/s or 1 Gbit/s managed or unmanaged Ethernet switch |
| PG/PC | Ethernet TCP/IP access; STEP 7 installed with S7-300 and S7-400 optional packages |
Refer to the CP 443-1 Communications Processor Manual and the S7-300 CPU 315-2 PN/DP Manual on the Siemens Industry Online Support portal for module-specific limits.
Record the following from HW Config before configuring the S7 connection:
| Module | Slot | Interface | IP Address | Subnet Mask |
|---|---|---|---|---|
| CPU 414-2 DP | 3 | DP / MPI — not used in this example | — | — |
| CP 443-1 | 4 | PN (X1) | 192.168.0.10 | 255.255.255.0 |
| CPU 315-2 PN/DP | 2 | PN (X1, integrated) | 192.168.0.20 | 255.255.255.0 |
Open HW Config > CP 443-1 Properties > Ethernet Interface and assign the IP address. Repeat for the CPU 315-2 PN in the S7-300 station. After saving and downloading the hardware configuration, verify reachability from the PG:
ping 192.168.0.10
ping 192.168.0.20
Both pings must succeed before any S7 connection is configured. If ping fails, fix the physical layer (cable, switch port, LED state) before debugging protocol settings.
3. S7 Connection Configuration in NetPro
NetPro is the single configuration editor for S7 connections on STEP 7 V5.x. The simplest approach — and the one used here — places both stations in a single STEP 7 project. Cross-project connections (using proxies) are outside the scope of this reference.
- Open SIMATIC Manager > S7-400 station > NetPro.
- Right-click the CP 443-1 and choose Insert New Connection.
- In the connection partner dialog, select CPU 315-2 PN/DP. The integrated PN interface appears as the partner endpoint. The connection type must be S7 Connection. Do not select ISO Transport or TCP native; neither is supported by the CPU 315-2 PN integrated interface.
- Confirm. NetPro creates an S7 connection row and assigns a connection ID. Note:
- Local ID (CP 443-1 side): enter as the ID parameter of PUT/GET/BSEND/BRCV/USEND/URECV called on the S7-400 against the CP. Typical values: W#16#0001, W#16#0002, etc.
- Partner ID (CPU 315-2 PN side): enter in the S7-300 program. Typical values: W#16#0001, W#16#0002, etc. The local ID on one station does not have to equal the partner ID on the other.
- Open Properties > General > Connection Path. Verify that the local endpoint is the CP 443-1 (slot 4), not the CPU 414-2 DP (slot 3). The CP must own the S7 connection; otherwise, S7 communication blocks call against the wrong interface.
- Set the connection establishment mode to Establish an active connection on the side that should initiate the TCP handshake — typically the S7-400 / CP 443-1.
- Save and compile NetPro, then download the connection configuration to both stations.
4. Communication Block Selection Matrix
| Block Pair | Library | Direction | Data Limit | Coordination | Use When |
|---|---|---|---|---|---|
| PUT (FB15) / GET (FB14) | Standard Library or SIMATIC_NET_CP | Bidirectional, single trigger | PUT: 4 × 462 bytes; GET: 4 × 462 bytes | Triggered by REQ; stateless from FB side | Small, periodic data exchange where the receive side has a known data layout |
| BSEND (FB12) / BRCV (FB13) | Standard Library or SIMATIC_NET_CP | Sender-controlled segmented | Up to 65534 bytes per call (segmented automatically) | R_ID based — both sides must match | Bulk transfer of recipes, parameter sets, file-like payloads |
| USEND (FB8) / URECV (FB9) | Standard Library or SIMATIC_NET_CP | Uncoordinated quick exchange | Up to 440 bytes per call | None — receiver overwrites | Cyclic publish-style data where the most recent value is what matters |
| AG_SEND (FC5) / AG_RECV (FC6) | SIMATIC_NET_CP only | ISO transport | 240 bytes (AG_) or 8192 bytes (AG_L) | None | Not usable with CPU 315-2 PN integrated interface |
5. Library Differentiation: SIMATIC_NET_CP vs Standard Library
The same FB names (PUT, GET, BSEND, BRCV, USEND, URECV) appear in two libraries shipped with STEP 7. They are not interchangeable. Each version is implemented against a different interface target:
-
Standard Library > Communication Blocks — FBs route through the CPU's own integrated interface (PN, DP, or MPI for S7-400 CPUs that have one). The LADDR parameter is
W#16#0000for integrated ports. -
SIMATIC_NET_CP — FBs route through an external CP module (CP 343-1, CP 443-1, etc.). The LADDR parameter is the logical base address of the CP from HW Config (for example
W#16#0100if the CP is at logical address 256).
Rule of thumb when populating the symbol table or generating instance DBs:
| Calling Side | Library | LADDR Value |
|---|---|---|
| S7-300 program calling against CPU 315-2 PN | Standard Library > Communication Blocks | W#16#0000 |
| S7-400 program calling against CP 443-1 | SIMATIC_NET_CP | Logical base address of the CP from HW Config |
6. Block Programming
6.1 PUT/GET on CPU 315-2 PN (Standard Library)
PUT writes from the calling CPU to the partner's data area. GET reads from the partner into the calling CPU's data area. Both handle a single call in a single cycle; for continuous operation tie REQ to a periodic pulse or repeat the call while BUSY is true.
// Instance DB: idb_put_300 (auto-generated by STEP 7)
CALL "PUT", idb_put_300
REQ := TRUE // Trigger once per cycle, or on demand
ID := W#16#0001 // Connection ID from NetPro (local)
LADDR := W#16#0000 // Integrated PN interface
DONE := put_done
ERROR := put_error
STATUS:= put_status
SD_1 := P#DB10.DBX0.0 BYTE 20 // Send 20 bytes from DB10 to partner
SD_2 :=
SD_3 :=
SD_4 :=
RD_1 := P#DB11.DBX0.0 BYTE 20 // Receive 20 bytes from partner into DB11
RD_2 :=
RD_3 :=
RD_4 :=
6.2 GET on the S7-400 (SIMATIC_NET_CP)
// Instance DB: idb_get_400 (auto-generated)
CALL "GET", idb_get_400
REQ := TRUE
ID := W#16#0001 // Local connection ID on the S7-400 side
LADDR := W#16#0100 // CP 443-1 logical base address from HW Config
NDR := get_ndr
ERROR := get_error
STATUS:= get_status
RD_1 := P#DB20.DBX0.0 BYTE 20
RD_2 :=
RD_3 :=
RD_4 :=
6.3 PUT/GET Parameter Reference
| Parameter | Type | Description |
|---|---|---|
| REQ | BOOL | Rising edge triggers a job. Tie to a clock flag or pulse for periodic transfer. |
| ID | WORD | S7 connection ID from NetPro. Local ID on the side calling the FB. |
| LADDR | WORD | W#16#0000 for CPU integrated PN; configured CP base address when using SIMATIC_NET_CP blocks. |
| DONE / NDR | BOOL | TRUE for one cycle when transfer completes successfully. |
| ERROR | BOOL | TRUE for one cycle when transfer fails. |
| STATUS | WORD | Hex error code (see Section 8). |
| SD_1..SD_4 (PUT only) | ANY | Up to four send pointers. Each ≤ 462 bytes. Empty pointers set to zero. |
| RD_1..RD_4 (GET, PUT) | ANY | Up to four receive pointers. PUT receives in the same call it sends; GET receives only. |
6.4 BSEND/BRCV for Bulk Transfer
BSEND/BRCV segment a payload automatically. Use them when a single PUT call would overflow the 462-byte per-pointer limit or when the application has logical records larger than ~1 KB (recipes, setpoint tables).
// S7-400 sender (CP 443-1)
CALL "BSEND", idb_bsend_400
REQ := bsend_req
ID := W#16#0002 // S7 connection ID for bulk transfer
LADDR := W#16#0100 // CP 443-1 base address
DONE := bsend_done
ERROR := bsend_error
STATUS:= bsend_status
SD := P#DB100.DBX0.0 BYTE 4096
LEN := bsend_len // Caller-supplied byte count (≤ 65534)
R_ID := DW#16#1234ABCD // Must match the R_ID used by BRCV on partner
// S7-300 receiver (CPU 315-2 PN)
CALL "BRCV", idb_brcv_300
EN_R := TRUE
ID := W#16#0002
LADDR := W#16#0000
NDR := brcv_ndr
ERROR := brcv_error
STATUS:= brcv_status
RD := P#DB110.DBX0.0 BYTE 8192
LEN := brcv_len // Actual bytes received
R_ID := DW#16#1234ABCD // Same value as sender
BRCV uses EN_R rather than REQ; it is enabled continuously and collects whatever the partner sends. If BRCV is not enabled when a BSEND arrives, the data is discarded and STATUS = W#16#80D1 appears on the sender side.
6.5 USEND/URECV for Cyclic Publish
USEND/URECV are useful for cyclic publish-subscribe style data with no handshake. The receiver always overwrites its receive buffer with the most recent frame; if a new frame arrives before the application processes the previous one, the previous frame is lost. Use them only when this behavior is acceptable.
// S7-400 publisher
CALL "USEND", idb_usend_400
REQ := clock_1s // Every 1 s
ID := W#16#0003
LADDR := W#16#0100
DONE := usend_done
ERROR := usend_error
STATUS:= usend_status
SD := P#DB200.DBX0.0 BYTE 100
// S7-300 subscriber
CALL "URECV", idb_urecv_300
EN_R := TRUE
ID := W#16#0003
LADDR := W#16#0000
NDR := urecv_ndr
ERROR := urecv_error
STATUS:= urecv_status
RD := P#DB210.DBX0.0 BYTE 100
LEN := urecv_len
7. Why AG_SEND/AG_RECV Cannot Be Used With CPU 315-2 PN
AG_SEND (FC5) and AG_RECV (FC6) operate against ISO transport connections. The CPU 315-2 PN/DP does not expose an ISO transport endpoint on its integrated PROFINET interface — only S7 connection and open TCP connection (open communication) endpoints are available. ISO transport on S7-300 requires an external CP module such as the CP 343-1 Lean/Standard/Advanced, where the FCs run against the CP.
Diagnostic symptoms when AG_SEND/AG_RECV are called incorrectly:
- The FC exists in the program and compiles, but at runtime the call returns ERROR = TRUE with STATUS = W#16#80A1 (connection not configured) or W#16#80B2 (interface module not present).
- NetPro shows a configured connection, but it is an ISO Transport connection. Because the partner cannot match, the S7-300 never reports the connection established.
- On the CP 443-1 side, online diagnostics (CP Diagnostics > Connections) shows the connection state as not established indefinitely.
If migrating a legacy CP 343-1 + AG_SEND/AG_RECV application to the CPU 315-2 PN, replace the FCs with PUT/GET or BSEND/BRCV against the integrated PN interface. The instance DBs must be regenerated because the FCs and FBs have different signatures.
8. Configuration Download, Online Diagnostics, and Status Codes
- Compile NetPro. Confirm zero warnings.
- Download to the S7-400 (target system = both CP 443-1 and CPU 414-2 DP).
- Download to the S7-300 (target system = CPU 315-2 PN/DP).
- Switch both CPUs to RUN.
- Open NetPro > right-click connection > Connection Status. The connection state transitions from not established → being established → established within a few seconds. If the state never advances, see Section 10.
- Force a test value into the S7-400 source DB and observe it appear at the corresponding S7-300 destination DB within one scan of the periodic REQ trigger.
For runtime diagnostics on the S7-400, open SIMATIC Manager > CPU 414-2 DP > Accessible Nodes > online > Diagnostics > Connection Diagnostics. On the S7-300, use CPU 315-2 PN/DP > Online > Diagnostics > Connection Diagnostics. Both views show connection state, byte counters, and last STATUS for each configured S7 connection.
8.1 Status Code Reference
| STATUS (hex) | Meaning | First Action |
|---|---|---|
| 0000 | Job complete without error | — |
| 7000 | No job active | Check REQ / EN_R logic |
| 7001 | First call with REQ = TRUE | Wait for next cycle |
| 7002 | Intermediate call | Continue calling |
| 80A1 | No S7 connection configured for the given (ID, LADDR) pair | Check ID, LADDR, and NetPro connection endpoint |
| 80A2 | Connection cannot be established (partner unreachable or refused) | Verify partner IP, ping, switch |
| 80A3 | Connection established but aborted by partner | Check partner CPU RUN state and partner FB call |
| 80A7 | Connection aborted due to overflow or resource exhaustion | Reduce call rate; verify receive buffer size |
| 80B0 | Instance DB error: wrong length or wrong type | Regenerate instance DB |
| 80B1 | Specified length exceeds maximum of the protocol | Verify data length per protocol rules |
| 80B2 | Cannot find a configured module at LADDR | Check HW Config address; correct library selection |
| 80C0 | Send data area cannot be read | Verify SD ANY pointer; check DB length |
| 80C1 | Receive data area too small for received data | Increase RD buffer; reduce sender payload |
| 80D0 | Block called in wrong operating state | Check CPU RUN/STOP and connection state |
| 80D1 | Send attempted while connection not yet established | Wait for NetPro "established" state before REQ |
| 80D2 | R_ID mismatch (BSEND/BRCV only) | Match R_ID on both sides |
9. Verification Checklist
- Both CPUs reachable from the PG via
ping. - STEP 7 project compiles without warnings.
- NetPro shows the S7 connection terminating on the CP 443-1 side, not the CPU 414-2 DP side.
- Connection establishment mode is configured on the active side.
- FBs on the S7-300 come from Standard Library > Communication Blocks with LADDR = W#16#0000.
- FBs on the S7-400 come from SIMATIC_NET_CP with LADDR = CP base address.
- ID matches the local connection ID from NetPro on each side.
- BSEND/BRCV use identical R_ID hex constants.
- NetPro online status reports established within seconds after RUN.
- Test data round-trips through the configured pointers.
- STATUS reads W#16#0000 after each successful call.
10. Troubleshooting Matrix
| Symptom | Likely Cause | Fix |
|---|---|---|
| STATUS = W#16#80A1 on every call | (ID, LADDR) pair has no matching NetPro connection | Open NetPro, double-click the connection, verify Local ID matches FB ID; verify endpoint is CP 443-1 |
| STATUS = W#16#80B2 | Block library and LADDR combination invalid | Switch from Standard Library to SIMATIC_NET_CP for CP-bound FBs, or vice versa |
| Connection state stuck at not established | Partner CPU in STOP, or partner IP unreachable | Place both CPUs in RUN; verify ping; check switch port LEDs |
| STATUS = W#16#80C1 | Receiver buffer too small | Increase RD pointer length; reduce sender LEN |
| STATUS = W#16#80D2 (BSEND only) | R_ID mismatch between sender and receiver | Match R_ID hex constant on both sides |
| PG can ping but cannot reach S7 connection | Firewall on PG blocking TCP/UDP for S7 (port 102 for ISO-on-TCP / S7 communication) | Allow ISO-on-TCP / S7 protocol on PG firewall |
| AG_SEND/AG_RECV compiles but STATUS = W#16#80A1 | Wrong protocol — CPU 315-2 PN does not support ISO transport on integrated PN | Replace with PUT/GET/BSEND/BRCV/USEND/URECV against S7 connection |
| Data transfers once then STATUS stays W#16#7000 | REQ not re-triggered | Tie REQ to a clock flag or pulse generator |
| STATUS = W#16#80A7 after long uptime | Too many concurrent jobs or buffer overflow | Reduce call rate; verify receive buffer size; check for duplicate ID assignments |
| PUT runs but PUT partner reports STATUS = W#16#80C1 | PUT RD_1..RD_4 on partner smaller than PUT SD_1..SD_4 on sender | Match pointer lengths and offset counts on both sides |
11. Frequently Asked Questions
Can I use AG_SEND/AG_RECV with a CPU 315-2 PN over its integrated PROFINET interface?
No. AG_SEND (FC5) and AG_RECV (FC6) operate against ISO transport connections, and the CPU 315-2 PN does not expose an ISO transport endpoint on its integrated PROFINET interface. Use PUT/GET, BSEND/BRCV, or USEND/URECV against an S7 connection instead.
Which library do I select for the CP 443-1 versus the CPU 315-2 PN?
Use SIMATIC_NET_CP for FBs called against the CP 443-1 (LADDR = CP base address from HW Config, e.g. W#16#0100), and Standard Library > Communication Blocks for FBs called against the CPU 315-2 PN integrated interface (LADDR = W#16#0000). The same FB names exist in both libraries but they target different interface modules.
Why does my BSEND call return W#16#80D2?
BSEND and BRCV use a 32-bit R_ID to associate sender with receiver. A STATUS of W#16#80D2 indicates the R_ID supplied to BSEND does not match the R_ID of any active BRCV on the partner. Match the R_ID hex constant on both sides and ensure BRCV is enabled (EN_R = TRUE) before the next BSEND.
How many S7 connections can I configure between the CP 443-1 and the CPU 315-2 PN?
The CP 443-1 (EX20 generation) supports up to 64 connections in total; the maximum that can be S7 connections specifically is 32. The CPU 315-2 PN/DP supports up to 14 S7 connections for PG, OP, and S7 communication combined. Plan the connection count to stay within both limits.
Do I have to terminate the S7 connection on the CP 443-1, or can it terminate on the CPU 414-2 DP?
The CPU 414-2 DP only exposes a PROFIBUS DP interface, not Ethernet, so for Ethernet-based S7 communication in this configuration the connection must terminate on the CP 443-1. If a CPU 414-3 PN/DP is used instead, an additional Ethernet option becomes available on the CPU itself.