Siemens S7-313C MPI PLC-to-PLC Communication Configuration Guide

David Krause11 min read
Industrial NetworkingSiemensTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

The Siemens SIMATIC S7-300 CPU 313C integrates an MPI (Multi-Point Interface) port on the front connector. This port supports three documented peer-to-peer communication methods that allow two S7-313C CPUs (or one S7-313C and another MPI-capable S7-300/400 station) to exchange process data without any additional CP module:

  • Global Data (GD) - cyclic, broadcast-style data exchange configured entirely from STEP 7; no code changes required.
  • S7 Basic Communication - event-driven data exchange via SFC 72/73/74 in the user program.
  • S7 Communication - acknowledged, larger-payload data exchange via SFB/FB 8, 9, 12, 13, 14, 15.

All three methods ride on the same MPI physical layer (RS-485, terminated, 187.5 kbps default). The selection is driven by data volume, scan determinism, and whether acknowledgments are required.

Reference: The authoritative system manual is the SIMATIC S7-300 Communication entry at Siemens Support entry ID 78028908. It defines the SFCs/SFBs, the GD configuration rules, and the MPI addressing limits.

S7-313C Hardware and MPI Interface Specifications

The CPU 313C family is shipped in several MLFB (order) variants. The two most common are:

Variant MLFB / Order No. MPI Port Default Address
CPU 313C 6ES7 313-5BE01-0AB0 Yes (X1, 9-pin Sub-D) 2
CPU 313C-2 DP 6ES7 313-6BE01-0AB0 Yes (X1 MPI / X2 DP) 2
CPU 313C-2 PtP 6ES7 313-6CE01-0AB0 Yes (X1 MPI / X2 PtP) 2

Key MPI specifications for the integrated port:

  • Physical layer: RS-485, isolated, 9-pin Sub-D female connector.
  • Baud rates supported: 19.2 kbps and 187.5 kbps (187.5 kbps is the default and the only rate valid for inter-CPU traffic when mixed with newer stations).
  • Maximum number of nodes on a single MPI segment: 32 (addresses 0-31), of which addresses 0 and 1 are reserved for the programming device (PG) by default.
  • Maximum segment length without repeaters: 50 m for 187.5 kbps with standard PROFIBUS cable.
  • Termination: bus termination resistors must be enabled at both physical ends (switch on PROFIBUS connector or terminator plug).
Bus termination is the most common cause of intermittent MPI faults. Always enable the terminating resistor on the connector of the first and last node only; nodes in the middle must remain unterminated.

MPI Network Topology for Two S7-313C CPUs

Two CPUs are addressed with unique MPI addresses. The default MPI address of an S7-313C out of the box is 2, which collides if both stations ship from the factory unchanged. One station must be reassigned before commissioning.

Station Role Recommended MPI Address Notes
CPU 313C #1 Master / Sensor source 2 Factory default; retains default.
CPU 313C #2 Partner / Sensor consumer 3 Change via STEP 7 -> Hardware -> Properties of CPU -> Interface -> MPI/DP -> Address.
PG (Programming Device) Configuration host 0 PG PC adapter (USB) occupies 0 by default.

Topology rule: connect all MPI nodes linearly. Use only PROFIBUS cable (violet, 6XV1 830-0EH10 or equivalent) and 9-pin Sub-D PROFIBUS connectors with switchable termination (e.g., 6ES7 972-0BA12-0XA0).

Hardware Cabling and Connectors

For PC-to-MPI programming during commissioning, the PC needs an MPI adapter:

Cable / Adapter Order No. Use
PC Adapter USB / MPI 6ES7 972-0CB20-0XA0 PG access during commissioning
RS-232 / MPI cable (legacy) 6ES7 901-0BF00-0AA0 Older PCs with COM port
PROFIBUS FC Standard Cable 6XV1 830-0EH10 MPI bus segment wiring
PROFIBUS connector with PG port 6ES7 972-0BA12-0XA0 Tap node + optional PG outlet

Termination must be enabled at the two physical ends of the segment, never in between.

Comparison of the Three Communication Methods

Feature Global Data (GD) S7 Basic Communication S7 Communication
Configuration method STEP 7 -> Options -> Define Global Data SFC 72/73/74 in user program NetPro connection + SFB 8/9/12-15
Direction Bidirectional, cyclic, broadcast Client / server (PUT/GET) Client / server (PUT/GET, USEND/URCV, BSEND/BRCV)
Max payload per call 22 bytes per GD packet (16 data + 6 status) 76 bytes (SFC 73 PUT) / 76 bytes (SFC 72 GET) Up to 64 KB (BSEND/BRCV) or 32 bytes (PUT/GET)
Acknowledgment No (status bits only) Implicit (parameter DONE/ERROR) Explicit (acknowledged connection)
Trigger Scan cycle / scan rate multiplier (1-255) Event-driven from user logic Event-driven from user logic
Connection resource required None (uses GD table only) 1 S7 connection per pair 1 S7 connection per pair
Typical use Sensor-data broadcast, slow status Small block exchange with confirmation Larger data sets, deterministic handshake

For the user's stated requirement - "I want to use first PLC's sensor information in second PLC" - any of the three works. Global Data is the smallest implementation effort and is recommended for sensor-status broadcasts. S7 Basic Communication is recommended when read/write confirmation and modest payload are needed. S7 Communication is appropriate for buffered block transfer.

Option 1 - Configuring Global Data (GD)

GD exchanges data cyclically on the MPI bus between configured stations without any user code. STEP 7 builds the GD table at compile time and downloads it with the S7 program.

Prerequisites

  1. STEP 7 V5.x installed (e.g., STEP 7 V5.6) and licensed.
  2. Both CPU 313C stations online with their HW Config loaded.
  3. MPI bus connected, terminated, and PG online to both CPUs.

Step-by-step

  1. Open the STEP 7 project containing both S7-300 stations.
  2. Assign unique MPI addresses (CPU #1 = 2, CPU #2 = 3) in HW Config -> Properties of the CPU -> Interface.
  3. Establish an MPI online connection to CPU #1 (address 2) via the PG.
  4. From the menu, choose Options -> Define Global Data. The GD editor opens.
  5. Right-click in the GD table and choose New; the CPUs participating in the GD must be inserted. Use CPUs in the GD Circle from the menu to add CPU #2 (address 3) and any other station.
  6. Click into the first row of the source column (CPU #1) and enter the sender area, e.g. DB1.DBD0. Click into the matching receiver cell (CPU #2) and enter the destination, e.g. DB2.DBD0.
  7. Set the transmission rate per row: factor 1 sends on every CPU scan; higher factors spread the rows across scan cycles to keep bus load low.
  8. Compile (GD Table -> Compile) and download (PLC -> Download to all CPUs in the GD circle).

Verification

  1. Open the GD editor and select View -> Status. Each row shows GD STATUS per partner with the bits: transmitter fault, receiver fault, transmission fault.
  2. In receiver CPU #2, monitor the destination DB in VAT or in the program; values must update cyclically.
Rule: The DBs (DB1 in CPU #1, DB2 in CPU #2) must already exist with sufficient length. STEP 7 does not create DBs from GD entries.

Option 2 - Configuring S7 Basic Communication

S7 Basic Communication uses SFCs in the user program. The MPI side of the connection is configured by assigning the partner's MPI address.

Function blocks / SFCs

SFC Old Name (S7-400) Purpose Max Payload
SFC 72 X_GET Read partner data into local memory 76 bytes
SFC 73 X_PUT Write local data to partner 76 bytes
SFC 74 X_ABORT Abort an existing basic connection n/a

The SFCs require a configured connection object of type S7 connection on each side, defined in NetPro.

Step-by-step

  1. In NetPro of CPU #1, right-click the CPU symbol and select Insert New Connection -> S7 connection. Partner = "Unspecified"; MPI interface; partner address = 3.
  2. Repeat on CPU #2 with partner = CPU #1, partner address = 2.
  3. Compile and download both NetPro configurations.
  4. In the user program of CPU #2 (the consumer), call SFC 72 (I_GET):
    CALL "I_GET" // SFC 72
      REQ    :=M10.0
      CONT   :=TRUE
      ADDR_1 :=P#DB1.DBX 0.0 BYTE 10  // partner DB1 in CPU #1
      ADDR_2 :=P#DB20.DBX 0.0 BYTE 10 // local target
      RD_I   :=0
      SD_I   :=0
      RET_VAL:=MW12
      BUSY   :=M10.1
      DONE   :=M10.2
      ERROR  :=M10.3
    
  5. To write back, call SFC 73 (I_PUT) with ADDR_1 = local source and ADDR_2 = partner destination.

Each call references an explicit connection identifier (e.g., connection ID 1). The SFC instance stays in BUSY until done; DONE = 1 means success, ERROR = 1 means check RET_VAL.

Option 3 - Configuring S7 Communication

S7 Communication uses the SFB/FB blocks and supports both unbuffered (PUT/GET, USEND/URCV) and buffered (BSEND/BRCV) transfer.

Block Type Direction Use
SFB/FB 8 USEND Unbuffered Send Up to 32 bytes, no handshake
SFB/FB 9 URCV Unbuffered Receive Up to 32 bytes, no handshake
SFB/FB 12 BSEND Buffered Send Up to 64 KB, handshake
SFB/FB 13 BRCV Buffered Receive Up to 64 KB, handshake
SFB/FB 14 GET Unbuffered Read Like SFC 72, server-side read
SFB/FB 15 PUT Unbuffered Write Like SFC 73, server-side write

STEP 7 / TIA Portal: configure the S7 connection in NetPro the same way as for S7 Basic Communication. The SFBs/FBS are contained in the standard library and are available for S7-300 from the moment a connection is created.

STEP 7 Project Configuration Sequence

  1. Create a STEP 7 project with two S7-300 stations in HW Config (one CPU 313C each).
  2. Assign MPI addresses in the CPU properties (Interface -> MPI/DP -> Address).
  3. In the project tree, open NetPro and add an S7 connection between the two CPUs; use "Unspecified" partner if the partner is not part of the same project.
  4. Compile and download both station HW Config + NetPro + S7 program.
  5. For GD: build the GD table in Options -> Define Global Data and download.
  6. For S7 Basic / S7 Communication: insert SFC / SFB calls in OB1 or a cyclic OB, then download.

Diagnostics, Error Codes, and Troubleshooting

MPI problems typically manifest as BUSY staying set, RET_VAL returning non-zero, or GD STATUS showing fault bits. The following matrix covers the recurring field failures.

Symptom Likely Cause Diagnostic Step Corrective Action
PG cannot go online to either CPU Wrong baud rate, mismatched MPI address, no termination Check Set PG/PC Interface; verify 187.5 kbps Set all stations to 187.5 kbps; enable termination at bus ends
PG online to one CPU only Duplicate MPI address on the segment Read accessible node list (PLC -> Accessible Nodes) Reassign duplicate address in HW Config and download
GD STATUS shows "Transmitter fault" Sender CPU in STOP, or sender DB shorter than configured Open GD -> View Status; check CPU mode Run sender CPU; extend sender DB length to match GD entry
GD STATUS shows "Receiver fault" Receiver DB too short or non-existent Open receiver DB properties Create / extend receiver DB to match GD entry
SFC 72 RET_VAL = W#16#0002 Partner not reachable / partner CPU in STOP Online view of partner CPU Run partner CPU; verify S7 connection downloaded on both sides
SFC 72 RET_VAL = W#16#001E Connection still busy from previous call Logic audit Wait for DONE/ERROR before re-triggering (do not pulse REQ faster than scan)
SFC 72 RET_VAL = W#16#8081 Address outside process image, or partner block missing Inspect ADDR_1 / ADDR_2 areas Correct absolute pointer; ensure partner DB exists with required length
USEND NDR not set URCV not called in partner Check partner logic Ensure URCV executes each cycle before USEND is retried
Intermittent timeouts during motor start EMI on MPI cable routed near VFD power cabling Visual cable routing inspection Separate MPI cable from power cable by ≥200 mm; use grounded shielded cable; add repeater if length > 50 m

For a complete list of SFC 72/73 RET_VAL codes refer to the S7-300 Communication manual entry at Siemens Support 78028908.

Verification Procedure

  1. Connect the PG to either CPU; verify Accessible Nodes lists both CPU 313C stations at their configured addresses.
  2. Open PLC -> Monitor / Modify on each CPU. Force a known value into the source area on CPU #1 and read the destination area on CPU #2.
  3. Open the GD Status view (for GD) or watch RET_VAL/BUSY/DONE in VAT (for SFC/SFB) and confirm DONE pulses without ERROR.
  4. Cycle power to both CPUs; communication must re-establish automatically without redownload.
  5. Disconnect the MPI cable mid-run to confirm the diagnostic blocks (GD STATUS fault, RET_VAL = 8084) react correctly; reconnect and verify recovery.

Edge Cases and Field-Commissioning Notes

  • Mixed baud rates: All MPI nodes on a segment must operate at the same baud rate (187.5 kbps). A legacy 19.2 kbps node will lock the bus off-line.
  • PG during runtime: Disconnecting the PG does not break the GD circle, but hot-swapping of MPI stations on a live segment can disturb traffic for one scan cycle.
  • CPU 313C-2 PtP: The PtP variant replaces the second MPI port with a serial port. Only X1 is MPI. Configuring an MPI connection on X2 will fail.
  • Routing to another subnet: Two S7-313C stations cannot route through each other over MPI; route capability on MPI is restricted. For routing, use an Ethernet CP (CP 343-1).
  • Buffered vs. unbuffered blocks: BSEND/BRCV maintain data on power-down of either partner; USEND/URCV do not. Choose buffered for sensor logs and unbuffered for live control signals.
  • Connection resources: Each S7 Basic / S7 Communication uses one connection resource per CPU. The CPU 313C supports up to 6 S7 connections over MPI; keep the count below this limit.

FAQ

What MPI address should I set on the second S7-313C?

Both CPUs ship with address 2 by default; one must be changed to a unique value (e.g., CPU #1 = 2, CPU #2 = 3) in HW Config under CPU properties -> Interface -> MPI/DP -> Address. Without this, address collision prevents any GD or S7 traffic.

Which MPI baud rate is required for two S7-313C CPUs?

Use 187.5 kbps on every node of the segment. Mixed rates are not supported; a node at 19.2 kbps will halt GD traffic and SFC retries.

How much data can Global Data transfer per cycle?

Up to 22 bytes per GD packet (16 data + 6 status), and up to 16 GD packets per GD circle. Larger payloads require S7 Basic Communication (SFC 72/73, up to 76 bytes) or S7 Communication (SFB 12/13, up to 64 KB).

Why does SFC 72 RET_VAL return W#16#8081?

This indicates the partner DB does not exist or is too short, or the absolute pointer ADDR_1/ADDR_2 points outside the partner process image. Confirm the partner DB is downloaded and large enough to hold the declared byte count.

Can I program both CPUs from one PC adapter while they exchange GD?

Yes. Connect the PC adapter to the MPI bus (tap node) and run two STEP 7 sessions or use one session with two online objects. The PC adapter occupies address 0 and does not interfere with GD cycles at 187.5 kbps provided bus load stays below ~50 percent.

Back to blog