Configuring PROFIBUS-DP Master/Slave Between S7-300 CPU 313C-2DP

David Krause14 min read
ProfibusSiemensTutorial / 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

Configuring PROFIBUS-DP Master/Slave Communication Between Two SIMATIC S7-300 CPU 313C-2DP Controllers

The SIMATIC S7-300 CPU 313C-2DP (order number 6ES7 313-6CF00-0AB0 / 6ES7 313-6CE00-0AB0) integrates a PROFIBUS-DP master or slave interface directly on the CPU module, allowing two S7-300 stations to exchange process data without additional communication processors (CPs). This guide consolidates the configuration procedure for a peer-to-peer master ↔ slave link on the integrated DP port (X2), including HW Config setup, NetPro networking, SFC14/SFC15 consistent-data programming, and field verification.

Official reference: See the SIMATIC S7-300 CPU 31xC and CPU 31x manual at SIMATIC S7-300 CPU 31xC Technical Specifications for complete electrical, memory, and protocol data.

1. System Overview and Topology

The PROFIBUS-DP master/slave link between two CPU 313C-2DP stations uses the second interface (X2) of each CPU. By default, the X2 port is configured as a combined MPI/DP interface that can be switched to pure PROFIBUS-DP mode via HW Config.

Parameter Master station (CPU-A) Slave station (CPU-B)
CPU type 6ES7 313-6CF00-0AB0 (or -6CE00-0AB0) 6ES7 313-6CF00-0AB0 (or -6CE00-0AB0)
Firmware V2.6 or higher (V3.3 recommended) V2.6 or higher (V3.3 recommended)
DP interface (X2) PROFIBUS-DP master PROFIBUS-DP slave
PROFIBUS address 2 3
Baud rate 1.5 Mbit/s (max for CPU 313C-2DP) 1.5 Mbit/s
Cable PROFIBUS 2-wire shielded twisted pair ( violet) Same
Termination ON (master end) ON (slave end)

1.1 Hardware topology

The two CPUs are connected point-to-point through their integrated PROFIBUS-DP connectors (9-pin Sub-D, female). Termination resistors must be enabled at both physical ends. For a point-to-point link with only two nodes, both terminations must be ON; this is unusual for larger DP networks where only the two ends are terminated.

1.2 PROFIBUS connector pinout (X2, Sub-D female, 9-pin)

Pin Signal Function
1 — Shield (optional connection)
2 — Not connected (M24V in some 6ES7-972 connectors)
3 B / RxD/TxD-P Data line B (positive)
4 — RTS (request to send)
5 DGND Data ground
6 VP +5 V supply (terminating resistor)
7 — Not connected (P24V in some connectors)
8 A / RxD/TxD-N Data line A (negative)
9 — Not connected
Housing Shield Cable shield — must be bonded to connector housing
Use Siemens 6ES7 972-0BA12-0XA0 (90° outlet) or 6ES7 972-0BB12-0XA0 (35° outlet) PROFIBUS connectors with integrated termination switch and diagnostic LED. Avoid 6GK1 500-0EA02 generic connectors on S7-300 DP networks — they lack the switchable terminator and PG socket.

2. Prerequisites

Before starting the configuration, confirm the following items are present and compatible.

2.1 Software

  • STEP 7 V5.5 + SP4 (or V5.6) — required for CPU 313C-2DP firmware V2.6+
  • S7-300 HSP (Hardware Support Package) 0185 or newer installed in HW Config
  • Optional: SIMATIC Manager NetPro component (included in STEP 7)
  • Optional: NCM S7 for PROFIBUS diagnostics (included in STEP 7)

2.2 Hardware

  • 2 × CPU 313C-2DP (6ES7 313-6CF00-0AB0 or compatible)
  • 2 × PROFIBUS DP connectors (6ES7 972-0BA12-0XA0)
  • 1 × PROFIBUS cable, violet, 2-wire, shielded (e.g., 6XV1 830-0AH10)
  • 2 × S7-300 mounting rails (6ES7 390-1AE80-0AA0)
  • 2 × PS 307 power supplies (e.g., 6ES7 307-1EA01-0AA0)
  • PG/PC adapter USB-PROFIBUS (6GK1 571-0BA00-1AA0 or CP 5711) for commissioning

2.3 CPU 313C-2DP Technical Specifications (from Siemens manual)

Parameter Value
Order number (current) 6ES7 313-6CF00-0AB0
Firmware version V3.3
Work memory (code + data) 32 KB code / 32 KB data (64 KB total)
Load memory Micro Memory Card (MMC), up to 8 MB
Bit memory (M) 2048 bytes
S7 timers / counters 256 / 256
OB 1 priority class priority Local data 32 KB max per class (may be reduced by MMC size)
Integrated inputs (DI 24) 24 DI @ 24 V DC
Integrated outputs (DO 16) 16 DO @ 24 V DC, 0.5 A
Integrated AI/AO — (not on 313C-2DP)
Interface X1 (MPI) MPI / DP (configurable as DP master or slave)
Interface X2 (DP) PROFIBUS-DP master/slave, RS-485, 9.6 kbit/s – 12 Mbit/s
DP master max slaves 8 (CPU 313C limitation)
DP slave supported Yes (DP-V0)
DP user data per slave max 244 bytes input + 244 bytes output
PG/OP connections max 6 (PG) / 6 (OP) — combined limited by CPU resources
Although the integrated DP port of the CPU 313C-2DP physically supports up to 12 Mbit/s, Siemens documentation indicates the practical maximum for reliable CPU 313C operation is 1.5 Mbit/s for the master/slave link. Higher baud rates reduce diagnostic robustness and may cause sporadic bus faults on long cables. Always start with 1.5 Mbit/s for field commissioning.

3. STEP 7 Project Structure

Create a single STEP 7 project containing both stations. This guarantees consistent PROFIBUS addresses and lets NetPro verify the network topology.

3.1 Create the project

  1. Open SIMATIC Manager → File → New → New Project.
  2. Right-click the project → Insert New Object → SIMATIC 300 Station — name it CPU_A_Master.
  3. Repeat → name the second station CPU_B_Slave.
  4. Insert a PROFIBUS network object (Insert → New Object → PROFIBUS) if not auto-created.

4. Master Station Hardware Configuration (CPU-A)

4.1 Insert the CPU in HW Config

  1. Open CPU_A_Master → double-click Hardware.
  2. From the catalog, insert RACK-300 → slot 1 PS 307 → slot 2 CPU 313C-2DP (6ES7 313-6CF00-0AB0, V3.3).
  3. On slot 3–4 add the integrated DI24/DO16 by selecting the CPU's object → Object Properties → tab Inputs/Outputs if not already inserted.

4.2 Configure interface X2 as DP master

  1. Double-click the CPU → Interface → select X2 (DP).
  2. Click Properties… for PROFIBUS interface X2.
  3. In Address: enter address 2, uncheck Subnet if you have not created one.
  4. Click New… → create subnet PROFIBUS(1), set transmission rate 1.5 Mbit/s, profile DP.
  5. Select DP Master mode.
  6. Confirm with OK.

4.3 Configure DP master diagnostic addresses

The CPU reserves two diagnostic address ranges automatically:

Resource Default range Meaning
Master diagnostic 2047 / 2046 Module status, bus faults
Slave 3 (CPU-B) I/O PEW 0–31 / PAW 0–31 Process image of slave I/O
The default input/output address ranges can be edited in the master system Properties → I/O Addresses. Keep slot 0 reserved as the diagnostic slot.

5. Slave Station Hardware Configuration (CPU-B)

5.1 Insert the CPU in HW Config

  1. Open CPU_B_Slave → Hardware.
  2. Insert the same rack and PS 307.
  3. Slot 2 → CPU 313C-2DP (6ES7 313-6CF00-0AB0).

5.2 Configure interface X2 as DP slave

  1. Double-click the CPU → Interface → select X2 (DP).
  2. Open Properties… → assign address 3.
  3. Select the previously created subnet PROFIBUS(1) (1.5 Mbit/s).
  4. Select DP Slave mode.
  5. Confirm with OK.

5.3 Configure slave I/O slots

In DP-slave mode the slave CPU presents its integrated I/O to the master as DP slot modules:

  1. In HW Config of the slave project, the CPU object appears with DP-slave identification.
  2. Open the DP-slave object → tab Configuration → Slots.
  3. For each slot in the slave that should be visible to the master, insert a module from the catalog. The typical mapping for a 313C-2DP:
Slot Module Length (bytes) Direction
0 — (diagnostic slot) — —
1 DI24 / DO16 (integrated) 4 input / 2 output bi-directional
2..16 (reserved / unused) — —

For exchanging user data only (no I/O mirroring), insert an empty Universal module at slot 1 and configure it with a custom data length, e.g. 8 bytes input / 8 bytes output. This frees up the master CPU's process-image area for arbitrary cross-station mapping.

6. Master Station — Connect the Slave to the Master System

  1. Return to HW Config of CPU_A_Master.
  2. Select the DP master object (CPU X2).
  3. Drag CPU 313C-2DP from the catalog folder PROFIBUS DP → Other Field Devices → S7-300/400 into the master system, or use DP Slave → Connect and select the slave configured in step 5.
  4. Confirm PROFIBUS address 3 matches.
  5. Open the inserted slave object → tab Configuration → verify slot 1 matches the slave's slot 1 configuration.
Key constraint: the master's view of the slave's slot configuration must exactly match the slave's actual configuration. If a slot is added on one side only, the master reports 0xAF (Slave configuration error) in the diagnostic buffer.

7. Save, Compile and Download

  1. In HW Config of the master project: Station → Save and Compile (Ctrl+S).
  2. Select the CPU → PLC → Download to Target… — choose CPU_A.
  3. Repeat for slave station → download to CPU_B.
  4. Insert the Micro Memory Card (MMC) into each CPU before power-up if not already fitted.

After download the CPU executes a restart (OB 100). The SF and BF LEDs should extinguish within 5 s. A steady BF LED indicates a PROFIBUS fault — see section 11.

8. Programming — Consistent Data Exchange

Process data exchanged over PROFIBUS-DP between two CPUs can be handled two ways:

Method Blocks When to use
Direct peripheral access (PAW / PEW) — Non-consistent, byte/word access only
Consistent read / write via SFC SFC 14 (DPRD_DAT), SFC 15 (DPWR_DAT) Required for data lengths ≥ 4 bytes, or when atomicity matters
PUT/GET (S7 communication) SFB 14 / SFB 15 Alternative when both CPUs are S7 and an S7 connection exists (uses TSAPs)

8.1 Slave-side — Provide data to master

In the slave CPU (CPU-B), the master writes 8 bytes to slave input area starting at address 0. Use SFC 15 in OB 1 on the slave to copy a data block (e.g., DB 10) into the slave's output process image that the master will read:

// Slave OB 1 - publish 8 bytes from DB10 to master
CALL "DPWR_DAT"
  LADDR  := W#16#0000      // Start address in slave output area (PEW 0)
  RECORD := P#DB10.DBX0.0 BYTE 8
  RET_VAL:= MW 100

8.2 Slave-side — Receive data from master

// Slave OB 1 - receive 8 bytes from master into DB11
CALL "DPRD_DAT"
  LADDR  := W#16#0000      // Start address in slave input area (PIW 0)
  RET_VAL:= MW 102
  RECORD := P#DB11.DBX0.0 BYTE 8

8.3 Master-side — Read slave inputs / write slave outputs

// Master OB 1 - write 8 bytes from DB20 to slave
CALL "DPWR_DAT"
  LADDR  := W#16#0000      // Address of slave output area on master
  RECORD := P#DB20.DBX0.0 BYTE 8
  RET_VAL:= MW 110

// Master OB 1 - read 8 bytes from slave into DB21
CALL "DPRD_DAT"
  LADDR  := W#16#0000      // Address of slave input area on master
  RET_VAL:= MW 112
  RECORD := P#DB21.DBX0.0 BYTE 8

The LADDR value on the master side is the start of the configured I/O area for the slave in the master station. Find it under HW Config → DP master system → slave object → I/O addresses.

A consistent read with SFC 14 returns either the full data set that was present at one bus cycle, or RET_VAL = W#16#80B0 indicating that the data was updated between byte n and byte n+1 and the buffer should be discarded. Retry on the next OB 1 cycle.

9. Alternative — S7 PUT/GET over an S7 Connection

When the application requires variable-length block transfers rather than fixed I/O slots, configure an S7 connection in NetPro and use SFB 14 / SFB 15 (PUT/GET):

  1. In NetPro, select the master CPU → Insert New Connection → S7 Connection.
  2. Partner: the slave CPU in the same project.
  3. Set the TSAP for the slave (default 03.01 for slot 2 rack 0).
  4. Download both connection tables.
  5. Use SFB 14 PUT (master) / SFB 15 GET (master) with ID := W#16#1 (connection ID from NetPro).

10. Verification

10.1 LED status (CPU 313C-2DP, X2)

LED OFF ON (green) ON (red) Flashing
SF OK — Group fault —
BF Bus OK — Bus fault (cable / slave missing) Bus fault (configuration)
RUN Stop Run — Startup
STOP Run Stop — Stop request / memory reset

10.2 Online diagnostics

  1. Connect PG with STEP 7 → PLC → Online → Diagnostics/Setting → Diagnostics of the Slave.
  2. Confirm the slave station shows Status OK with current baud rate 1500 kbit/s.
  3. Open CPU → Module Information → Diagnostic Buffer on the master. Look for entry 16#0E3F = DP slave OK.

10.3 Functional test

Place a VAT table on both DB 10 (slave send) and DB 21 (master read). Set a non-zero value in DB 10 — confirm it appears in DB 21 within one OB 1 cycle (typically 10–50 ms). Repeat in reverse direction with DB 20 → DB 11.

11. Troubleshooting Matrix

Symptom LED state Diagnostic buffer entry Likely root cause Action
No bus communication BF steady red — Cable broken or polarity reversed Check pins 3 (B) and 8 (A); verify shield bond; swap connector
BF steady, all terminations on BF steady red — Same PROFIBUS address on both CPUs Reassign master=2, slave=3
BF flashing BF flashing red 0xAF – configuration error Slot configuration mismatch Compare HW Config of master and slave; regenerate
BF flashing after baud rate change BF flashing red 0xAF Baud rate mismatch master/slave Set both to identical value (1.5 Mbit/s)
Communication stops after a few minutes BF flashing 0x0E0F – watchdog Cable too long or EMC noise Max 200 m at 1.5 Mbit/s; check shield continuity
SFC 14 returns 0x80B0 — — Consistency violation, retry next cycle Wrap SFC call in retry loop; do not use data on error
SF on master after download SF red 0x39B1 – I/O access error Wrong LADDR in SFC 14/15 Check configured slave I/O address in HW Config
BF after firmware update BF red 0xEBC2 – firmware mismatch Old GSD in HW Config Update HSP, recompile HW Config, redownload

12. Common Configuration Mistakes

  1. Using the wrong port. The CPU 313C-2DP has two interfaces — X1 (MPI) and X2 (DP). PROFIBUS-DP must be on X2. Configuring X1 results in no bus activity.
  2. Leaving the S7-300 rail terminator OFF. Both physical ends must have ON. For a 2-node link, this means both connectors terminated.
  3. Exceeding 244 bytes per direction. The CPU 313C-2DP slave accepts at most 244 bytes input + 244 bytes output per slave, master aggregates across all slaves.
  4. Setting baud rate above 1.5 Mbit/s. Although the silicon supports 12 Mbit/s, the S7-300 DP master performance and diagnostics degrade above 1.5 Mbit/s for the CPU 313C generation.
  5. Forgetting to download NetPro connection table. When using S7 PUT/GET, both ends need the connection configuration, not only the block calls.
  6. Not using SFC 14/15 for multi-word data. Direct peripheral access (e.g., L PEW 0 / T PAW 0) reads/writes word-by-word and may give inconsistent values across multiple words. Use SFC 14/15 for any length ≥ 4 bytes.

13. Performance and Timing

Approximate DP cycle times for a CPU 313C-2DP at 1.5 Mbit/s:

Payload (bytes I + bytes O) Cycle time
4 + 4 ~1.0 ms
16 + 16 ~1.4 ms
32 + 32 ~1.8 ms
64 + 64 ~2.6 ms
128 + 128 ~4.3 ms
244 + 244 ~7.5 ms

These times exclude STEP 7 OB 1 processing on each side; full end-to-end latency master-DB → slave-DB ≈ 2 × OB 1 cycle + 2 × DP cycle, typically < 100 ms for a 10 ms OB 1.

14. Edge Cases and Field Notes

  • Cold restart after MMC swap: When the MMC is replaced, the CPU re-initializes with the new project. The slave must be in RUN and PROFIBUS cable connected before the master is powered, otherwise the master records 0x0EF1 (slave failure) in its diagnostic buffer. Recover by cycling master power.
  • Mixed firmware: A 313C-2DP master with firmware V3.3 can communicate with a V2.6 slave. Baud rate is auto-negotiated by the master if Auto is selected — but for stable operation, set explicit 1.5 Mbit/s.
  • Adding a CP 342-5: If a third station is required as a DP slave but the CPU's X2 is occupied by another master, use an external CP 342-5 (6GK7 342-5DA02-0XE0) on the IM slot of the slave.
  • Hot-swapping the slave: Not supported on S7-300 CPU 313C; if the slave is removed the master logs 0x0E07 and stops cyclic data exchange.
  • EMC on long cables: For runs > 50 m, use PROFIBUS EC (fast-connect) cable with grounding clamps every 25 m.

15. Summary Checklist

  • [ ] Both CPUs identical 6ES7 313-6CF00-0AB0 or compatible
  • [ ] STEP 7 V5.5 SP4+ with HSP 0185

FAQ

Can two CPU 313C-2DP stations communicate PROFIBUS-DP without an additional CP module?

Yes. Both CPUs have an integrated DP interface on X2. Configure one as master (address 2) and one as slave (address 3) in STEP 7 HW Config and connect them with a PROFIBUS cable terminated at both ends. No CP is required.

What is the maximum PROFIBUS baud rate for a CPU 313C-2DP master/slave link?

The interface silicon supports up to 12 Mbit/s, but Siemens field-tested and recommends a maximum of 1.5 Mbit/s for reliable CPU 313C operation. Higher rates are possible but reduce diagnostic robustness and may produce sporadic BF faults.

How do I exchange more than 4 bytes per direction between the two CPUs?

Use SFC 14 (DPRD_DAT) and SFC 15 (DPWR_DAT) on both sides. Configure the slave slot with a universal module of the desired length (max 244 bytes in / 244 bytes out) and call SFC 14/15 in OB 1 with the correct LADDR from HW Config. Direct peripheral access (PEW/PAW) is not consistent for ≥ 4 bytes.

The BF LED stays red after download — what is the first check?

Verify cable polarity (pin 3 = B/P, pin 8 = A/N), confirm both terminators are ON, and check that the slave and master have different PROFIBUS addresses (e.g., 2 and 3). The most common cause is identical addresses or a missing termination.

Where can I find the official S7-300 CPU 313C-2DP technical specifications?

The official Siemens manual "SIMATIC S7-300 CPU 31xC and CPU 31x: Technical specifications" contains electrical, memory, and PROFIBUS parameters. It is available at support.industry.siemens.com — entry ID 12996906.

Back to blog