Overview
This reference covers a recurring industrial integration scenario: a fleet of legacy SIMATIC S7-400 stations must publish process data to a new SIMATIC S7-1500 gateway, which then exposes the consolidated dataset to a Level 2 (MES/scada) host over OPC UA. The reference example is sized for 18 S7-400 PLCs aggregating roughly 8,000 tags through one S7-1500 CPU, but the same constraints and configuration procedure apply to any multi-PLC S7 Communication topology that uses BSEND / BRCV.
The key engineering questions answered in this document are:
- Are BSEND/BRCV feasible across 18 simultaneous S7 connections on a single S7-1500 CPU?
- How many S7 connection resources are required per partner, and what are the firm CPU limits?
- How must the data be packaged in the S7-400 side so that the gateway can receive it with BRCV?
- When is PUT/GET the better choice over BSEND/BRCV?
- How are the S7 connections configured in TIA Portal on the S7-1500 side and in STEP 7 V5.x on the S7-400 side?
Reference Architecture
The reference plant topology is shown below. Each S7-400 acts as a data source; the S7-1500 acts as a gateway, and the Level 2 host consumes the published data via the OPC UA server embedded in the S7-1500 CPU (firmware V2.0 and higher).
- 18 × S7-400 CPUs (one per skid/machine cell) — each with its own program and one or more process data DBs.
- 1 × S7-1500 gateway CPU with two PROFINET interfaces (X1, X2) integrated in the CPU and two additional CP 1543-1 modules (or similar CPs) for plant-bus segmentation.
- 1 × Level 2 server consuming data through the OPC UA server of the S7-1500.
Approximate volumes used as the design baseline for the calculations in the next sections:
| Direction | Per S7-400 partner (worst case) | Total at gateway (18 partners) | Total to Level 2 (OPC UA) |
|---|---|---|---|
| PLC → Gateway (uplink) | 6,144 B (6 KB) | ~32 KB aggregate | ~32 KB aggregate |
| Gateway → PLC (downlink) | 2,048 B (2 KB) | ~32 KB aggregate | — |
| Total tag count | ~8,000 tags across the 18 S7-400 stations | ||
S7 Connection Resource Limits
Before committing to BSEND/BRCV, the connection budget of every CPU involved must be checked against the planned 18 S7 connections (one per S7-400 partner). Each BSEND/BRCV pair consumes exactly one S7 connection resource on each participating CPU.
| CPU | Order number (example) | Max. S7 connections | Max. PG/OP + S7 connections (combined) |
|---|---|---|---|
| S7-400 / CPU 412-2 PN | 6ES7412-2EK07-0AB0 | 32 | 32 |
| S7-400 / CPU 414-3 PN/DP | 6ES7414-3EM07-0AB0 | 64 | 64 |
| S7-400 / CPU 416-3 PN/DP | 6ES7416-3ES07-0AB0 | 96 | 96 |
| S7-400 / CPU 417-4 | 6ES7417-4XT07-0AB0 | 128 | 128 |
| S7-1500 / CPU 1515-2 PN | 6ES7515-2AM02-0AB0 | 128 | 128 |
| S7-1500 / CPU 1516-3 PN/DP | 6ES7516-3AN02-0AB0 | 256 | 256 |
| S7-1500 / CPU 1518-4 PN/DP | 6ES7518-4AP00-0AB0 | 384 | 384 |
For a 1:18 gateway architecture the S7-1500 gateway CPU must be sized to support at least 18 + N connections, where N is the number of OPC UA sessions, HMI sessions, and PG/OP connections. A CPU 1516-3 PN/DP (256 connections) is the safe minimum; a CPU 1518-4 PN/DP (384 connections) leaves headroom for future partners. The S7-400 side needs only one connection per station (to the gateway) plus any existing HMI/PUT/GET connections, so a CPU 414-3 PN/DP (64 connections) is adequate in most cases.
BSEND/BRCV Versus PUT/GET
BSEND/BRCV and PUT/GET both ride on S7 Communication. The differences that matter for this architecture are listed below.
| Property | BSEND / BRCV (FB12/FB13 on S7-400, FB12/FB13 on S7-1500) | PUT / GET (FB14/FB15 on S7-400, FB14/FB15 on S7-1500) |
|---|---|---|
| Configuration | S7 connection required on both partners; both sides placed in the connection table of TIA Portal / STEP 7 | S7 connection required only on the client (the S7-1500 in this case) |
| Max. payload per call | 32 KB (S7-400 and S7-1500) — 64 KB on newer CPUs with extended PDU | Limited by the data area pointer; practical ceiling ~8 KB per call (one Any pointer per call) |
| Direction | Asymmetric: BSEND on side A ↔ BRCV on side B for the same data; reverse direction needs another pair of FBs | Symmetric: a single PUT/GET pair carries data in both directions depending on the call |
| DB requirements at the receiver | The receiver must allocate a contiguous DB large enough to hold the worst-case block (BRCV writes into one DB) | The receiver can be accessed by area pointer; no dedicated receive DB required |
| Programming effort | Higher: two instance DBs, two FBs to wire, plus DONE/NDR/ERROR handling | Lower: single FB per direction with an Any pointer |
| Suitability for 8,000-tag gateway | High — one BSEND per partner carries the whole 6 KB at once | Medium — requires multiple PUT/GET calls per partner with pointer rotation |
| Performance | Same wire throughput as PUT/GET (PDU size, not call type, dominates) | Same wire throughput as BSEND/BRCV |
For this project BSEND/BRCV is the recommended choice because the payload per partner is small enough to fit a single BSEND call and the receiver DB is naturally the gateway's data consolidation DB. PUT/GET becomes attractive only when the S7-400 program cannot be modified to expose a contiguous data block.
Data Packaging Requirements
BSEND ships a contiguous byte block; BRCV receives the same block into a pre-allocated DB. The S7-400 must therefore assemble the 6 KB worth of data destined for the gateway inside a single DB (commonly named DB_GATEWAY_UPLINK or similar). The following rules apply:
- The receive DB on the S7-1500 side and the source DB on the S7-400 side must be the same length; BRCV raises
STATUS = W#16#8088if the received length differs from the DB length. - BYTE alignment is sufficient; no need to align on word boundaries at the S7-400 side as long as the same byte layout is mirrored in the S7-1500 DB.
- If the 8,000 tags are scattered across many FBs/DBs in the S7-400, add a packaging step (a cyclic OB1 or OB35 routine) that copies the relevant values into the uplink DB before BSEND triggers.
Connection Configuration in TIA Portal (S7-1500 Side)
Use TIA Portal V16 or later (V18/V19 recommended). The procedure is identical for every one of the 18 partners; the only values that change are the partner IP address and the connection name.
- Open the S7-1500 project in TIA Portal. In the project tree, expand Devices & Networks → Networks & Gateways.
- Add the S7-400 partner to the network view. Right-click the S7-1500 CPU and choose Add new connection → S7 connection.
- In the Connection dialog set the partner to "Unspecified" or to the actual S7-400 station if it exists in the project. Set the interface to the PROFINET interface X1 of the S7-1500 (or to the CP 1543-1 if the gateway partners are segmented onto a different subnet).
- Set the connection name to a unique identifier, for example
S7_400_Skid_01throughS7_400_Skid_18. - Set the partner IP address (e.g.
192.168.10.11for the first partner). Leave the rack/slot at the S7-400 default (rack 0, slot 2 for a CPU 414-3 PN/DP, slot 3 if a CP is used for the S7 connection). - Confirm that the connection is shown in the Connection table of the S7-1500 with Active connection establishment = Yes. The S7-1500 acts as the active partner; the S7-400 is passive.
- Repeat steps 2 to 6 for the remaining 17 partners.
After the connection table contains 18 S7 connections, compile and download the hardware configuration. The S7-1500 is now ready to instantiate the BSEND calls.
Connection Configuration in STEP 7 V5.x (S7-400 Side)
The S7-400 partner must agree on the connection. In STEP 7 V5.6 open the NetPro editor:
- Insert a new S7 connection to "Unspecified" partner.
- Enter the IP address of the S7-1500 interface used for the S7 connection (
192.168.10.1for example). - Set Active connection establishment = No — the S7-400 waits for the S7-1500 to establish.
- Save and download the connection to the S7-400.
For a list of firmware-compatible CPU combinations see the Siemens FAQ S7 Communication between SIMATIC S7-1500 and SIMATIC S7-300, which also applies to the S7-400 line because the same S7 Communication blocks (FB12/FB13) are used.
Programming BSEND on the S7-400 Side
The S7-400 calls FB12 BSEND from the standard library Communication Blocks → S7 Communication. The call must be made cyclically, for example from OB35, and the instance DB must be unique per partner.
CALL FB12, DB100 // BSEND instance for partner #1
REQ := TRUE // edge-triggered, set for one cycle
R := FALSE // no reset
ID := 1 // connection ID from NetPro
DONE := M100.0 // bit: job complete without error
ERROR := M100.1 // bit: error flag
STATUS := MW102 // word: detailed status
SD_1 := P#DB200.DBX0.0 BYTE 6144 // source: first 6 KB of DB200
LEN := MW110 // actual length to send (up to 6144)
Keep the call re-triggered: if REQ is left TRUE, BSEND re-sends the data on every successful completion. The S7-400 CPU 414-3 PN/DP (6ES7414-3EM07-0AB0) firmware V7.0 supports the 32 KB payload that BSEND allows.
Programming BRCV on the S7-1500 Side
The S7-1500 uses the system instruction BSEND / BRCV from the Communication → S7 Communication palette. Each partner requires two FB instances (one for uplink, one for downlink).
// SCL sample for S7-1500 BRCV instance 'rcv_Skid_01'
IF "rcv_Skid_01".NDR OR "rcv_Skid_01".ERROR THEN
IF "rcv_Skid_01".ERROR THEN
// log STATUS, raise alarm
ELSE
// new data available in DB 'GatewayUplinkDb'.Skid01
END_IF;
END_IF;
"rcv_Skid_01"(
REQ := FALSE,
ID := 1, // connection ID = TCON_ID of S7 connection
EN_R := TRUE, // enable reception
R := FALSE,
LEN := 6144, // expected length
DONE => , // ignored on BRCV
NDR => , // new data received
ERROR => ,
STATUS => ,
RD_1 := P#"GatewayUplinkDb".Skid01 BYTE 6144);
For a full programming example see the TIA Portal help page Program example for BSEND & BRCV (S7-1500, S7-1200 G2).
Wiring and Interface Layout
The S7-1500 CPU used in this reference has two PROFINET interfaces (X1, X2) integrated in the CPU plus two CP 1543-1 modules plugged in the left side of the rack. The recommended port assignment is:
| Interface | Subnet | Function |
|---|---|---|
| CPU X1 (PROFINET 1) | 192.168.10.0/24 | 18 × S7-400 partners (S7 Communication / BSEND-BRCV) |
| CPU X2 (PROFINET 2) | 192.168.20.0/24 | Level 2 (OPC UA server of the S7-1500) |
| CP 1543-1 (left slot 1) | 192.168.30.0/24 | Optional plant-bus segment for HMI / engineering access |
| CP 1543-1 (left slot 2) | 192.168.40.0/24 | Optional redundant gateway subnet |
Commissioning and Verification
After download to both CPUs, perform the following checks before going into production:
- Connection status: in TIA Portal open Online & Diagnostics → Connection table. Every one of the 18 entries should show Established = Yes. A STATUS = W#16#0001 on BRCV means the connection is up but no data has been received yet.
- Cyclic data: trigger a value change on the S7-400 (e.g. a counter incremented in OB1) and confirm that the change appears in the corresponding S7-1500 DB within one BSEND cycle (~50 ms typical for a 6 KB payload on a 100 Mbit/s link).
- PDU size: read SZL ID W#16#0132 on the S7-400 and confirm 480 bytes. A 240-byte PDU increases the cycle time by roughly a factor of two for the same payload.
- Connection count: in the S7-1500 online diagnostics, Communication → Connection resources, verify that 18 of the available connections are in use and that the OPC UA server (one session) is also accounted for.
- OPC UA exposure: from a Level 2 OPC UA client (for example UA Expert), browse the S7-1500 server, navigate to GatewayUplinkDb.Skid01..18 and confirm that all tags are readable and that the values match the S7-400 source.
Troubleshooting Matrix
| Symptom | Likely cause | Fix |
|---|---|---|
BRCV STATUS = W#16#8088
|
Length mismatch between the SD_1 area on the sender and the RD_1 area on the receiver | Make both Any pointers cover exactly the same byte count; remove any trailing padding |
BRCV STATUS = W#16#80A1
|
Connection has not been established or wrong connection ID used | Compare the ID in the FB instance with the ID in the S7 connection table of TIA Portal |
BRCV STATUS = W#16#80C3
|
Resource bottleneck: all S7 connection resources of the CPU are used | Switch to a CPU with more resources or free up existing connections (e.g. consolidate HMIs onto OPC UA) |
BSEND STATUS = W#16#80A2
|
Partner not reachable — wrong IP, wrong interface, or wrong rack/slot | Ping the partner; verify the rack/slot of the S7-400 CPU or CP |
| Connection never reaches Established on the S7-1500 side | Active/passive mismatch: both partners are configured passively | Set Active connection establishment = Yes on the S7-1500 side |
| Data arrives but contains old values | BSEND not re-triggered on the S7-400 side; only one frame sent on program start | Hold REQ=TRUE or use a rising-edge timer to re-trigger BSEND cyclically |
| OPC UA client cannot browse the S7-1500 server | OPC UA server disabled or wrong port (default 4840) | Enable the OPC UA server in Device configuration → OPC UA and open the firewall on the S7-1500 |
Edge Cases and Field-Proven Caveats
- S7-400 firmware < V6.0: only 240-byte PDU. The 6 KB payload per partner still works but takes ~25 PDUs per direction and cycle time goes up. Upgrade the firmware of the S7-400 CPUs to V7.0 or later if the application is cycle-time critical.
- CP 443-1 on the S7-400 side: if the S7-400 reaches the S7-1500 through a CP, the connection must be configured in NetPro with the CP's IP address and the CP's rack/slot (slot 4 for the first CP 443-1 in a S7-400 rack).
- Routing across subnets: the S7-1500 CPU cannot act as an S7 router between two S7-400 partners. Each S7-400 partner must establish its connection directly with the S7-1500 CPU on the same subnet.
- OPC UA performance: 8,000 tags polled at 100 ms produce ~80 kSamples/s on the OPC UA server. The CPU 1516-3 PN/DP can sustain this load; the CPU 1515-2 PN is at its limit and may saturate the OPC UA subscription queue.
- Security: S7 Communication between S7-400 and S7-1500 is not encrypted. Use a CP 1543-1 with an IPsec tunnel or move the S7 Communication to a separate physical plant-bus if data confidentiality is required.
Frequently Asked Questions
How many S7 connection resources does BSEND/BRCV consume on each CPU?
Exactly one S7 connection resource per BSEND/BRCV pair, on each of the two participating CPUs. A gateway that serves 18 S7-400 partners therefore needs at least 18 free connection resources, plus the OPC UA sessions and any PG/OP connections. A CPU 1516-3 PN/DP (256 connections) is the safe minimum for this topology.
Can BSEND/BRCV be used to send 32 KB in one call between an S7-400 and an S7-1500?
Yes. The BSEND instruction on both S7-400 and S7-1500 supports a payload of up to 32 KB per call (64 KB on newer S7-1500 CPUs with the extended PDU setting). The receiver DB must be at least the size of the worst-case payload, and the S7 PDU must be negotiated at 480 bytes for the call to complete in a single transaction.
Do I have to put all 8,000 tags in a single DB on the S7-400 side?
No. The 8,000 tags live in the 18 separate S7-400 programs. What is required is that the data destined for the S7-1500 gateway be packed into one DB per S7-400 CPU (e.g. DB200) before BSEND is called. A small OB35 routine that copies the relevant process values into DB200 is the standard approach.
Is PUT/GET acceptable as an alternative to BSEND/BRCV for this topology?
Yes, but PUT/GET has a smaller practical payload (around 8 KB per call) and must be triggered from one side only. For 6 KB per partner PUT/GET would still work, just with one PUT/GET pair per partner and a slightly higher programming effort on the gateway side (you must rotate the Any pointer to scan multiple areas if the data is not contiguous).
Which firmware version of the S7-1500 is required for the embedded OPC UA server?
The OPC UA server of the S7-1500 CPU is available from firmware V2.0. For the data volumes in this project (8,000 tags, 18 partners) firmware V2.9 or V3.0 is recommended because later firmware versions improved the subscription handling and added data-change filtering for the OPC UA server.