PROFIBUS-DP Master-Slave Configuration: S7 CPUs and Remote I/O

David Krause15 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

PROFIBUS-DP Master-Slave Configuration: S7 CPUs and Remote I/O

PROFIBUS DP (Decentralised Periphery) is the dominant fieldbus for connecting distributed sensors, actuators, and remote I/O to a central controller in factory automation. The most common engineering task for a new automation engineer is configuring a DP network that contains (a) a CPU acting as a DP master, (b) one or more CPUs acting as intelligent DP slaves, and (c) distributed I/O stations such as the ET 200 family. This reference walks through that complete configuration on a Siemens SIMATIC S7 platform using STEP 7 / SIMATIC Manager and S7-PLCSIM, then verifies the network with standard diagnostics.

1. PROFIBUS DP Protocol Overview

PROFIBUS DP is standardised in IEC 61158 / IEC 61784 and is governed by PROFIBUS International (PI). Three protocol versions are relevant to field work:

Version Functionality Typical Use
DP-V0 Cyclic I/O data exchange, diagnostics Standard remote I/O (ET 200)
DP-V1 Adds acyclic read/write services, alarms Process automation, parameterisation
DP-V2 Isochronous mode, slave-to-slave broadcast Motion control, high-speed deterministic data

A single PROFIBUS DP segment supports up to 32 stations (master or slave) without a repeater. With repeaters, the address space extends to 126 stations (addresses 0 to 125; address 126 is reserved for broadcast). Each DP cycle is token-passed between masters; slaves only respond when polled, which is why bus timing is bounded and deterministic at low/medium baud rates.

Data rates are switchable per segment:

Baud Rate Max Segment Length (Type A cable) Cycle Time per Slave (typical)
9.6 kbit/s 1,200 m ~ 60 ms
19.2 kbit/s 1,200 m ~ 30 ms
45.45 kbit/s 1,200 m ~ 15 ms
93.75 kbit/s 1,200 m ~ 8 ms
187.5 kbit/s 1,000 m ~ 4 ms
500 kbit/s 400 m ~ 2 ms
1.5 Mbit/s 200 m ~ 1 ms
3 Mbit/s 100 m ~ 0.5 ms
6 Mbit/s 100 m ~ 0.3 ms
12 Mbit/s 100 m ~ 0.3 ms
Use only Type A cable (solid-core, twisted pair, characteristic impedance 135–165 Ω at 3–20 MHz, loop resistance ≤ 110 Ω/km, capacitance ≤ 30 pF/m, e.g. Siemens 6XV1 830-0EH10 violet) for the DP backbone. Type B ( stranded) is for short drop cables only.

2. Prerequisites

For a complete CPU-to-CPU master-slave link plus remote I/O, plan the following items before starting STEP 7.

2.1 Hardware (real lab)

  • 2 × S7-300 CPU with integrated PROFIBUS DP port, e.g. CPU 315-2 DP (6ES7 315-2AG10-0AB0) or CPU 317-2 DP (6ES7 317-2AJ10-0AB0). The second DP interface (X2/MPI-DP) is required for the master-slave link.
  • 1 × ET 200S or ET 200M distributed I/O station, e.g. IM 151-1 (6ES7 151-1AA04-0AB0) for ET 200S, or IM 153-1 (6ES7 153-1AA03-0AB0) for ET 200M.
  • PROFIBUS cable: Siemens 6XV1 830-0EH10 (violet, sold per metre).
  • PROFIBUS D-sub connectors with terminating resistor and PG socket:
    • Standard: 6ES7 972-0BA12-0XA0 (90° cable outlet)
    • With 24 V terminal: 6ES7 972-0BB12-0XA0
  • PROFIBUS repeater, e.g. 6GK1 500-3AA00 (RS 485 repeater), if you exceed 32 stations or one segment-length limit.
  • 24 V DC power supply (e.g. SITOP 6EP1334-3BA10) for the bus terminator power.

2.2 Software (engineering PC)

  • STEP 7 V5.5 + SP2 or later (SIMATIC Manager) — the field report uses V5.5. TIA Portal V15 or later can be used instead and uses the same logical model.
  • S7-PLCSIM V5.4 + SP5 (or later) for offline simulation of both master and slave CPUs without any hardware. A valid licence is required.
  • WinCC flexible 2007 or WinCC (TIA) for HMI; not required for the bus itself but used for end-to-end visualisation.
  • GSD file for every third-party DP slave (Siemens slaves ship with STEP 7 and need no separate GSD install). Download from the manufacturer or PI's GSD library on profibus.com.
S7-PLCSIM V5.4 supports MPI/DP simulation between two PLCSIM instances using the "PLCSIM Virtual Ethernet" or via the S7-PLCSIM "TCP/IP" interface introduced in SP5. Native PROFIBUS does not pass through PLCSIM directly; for fully virtual DP testing without hardware, use the Siemens "NetPro PLCSIM" routing feature in STEP 7 V5.5 SP2 or the Softnet DP-Slave option. Hardware-in-the-loop with one real CPU and one PLCSIM CPU is the most reliable path when first learning.

3. Network Topology and Physical Layer

PROFIBUS DP is a single linear RS-485 bus with no spurs permitted above 3 Mbit/s. The two ends of the segment must be terminated with the built-in 220 Ω resistor between pins 3 and 8 (see diagram). Switch the resistor ON at the two end stations, OFF at every station in between.

CPU 315-2 DP Master · Addr 2 CPU 315-2 DP Slave · Addr 3 ET 200M Slave · Addr 4 PROFIBUS DP segment (RS-485, max 32 nodes per segment) Term ON Term ON Pin 3 = B (RxD/TxD+) Pin 8 = A (RxD/TxD-) Shield on connector housing, 360° contact

3.1 Connector pinout (D-sub 9, female on the device)

Pin Signal Function
1 SHIELD Cable shield, 360° termination
3 B / B' Receive/transmit data + (line B)
4 RTS Request to Send (direction control)
5 GND Data ground (isolated from chassis)
6 +5 V Bus terminator power (≤ 90 mA load)
7 Reserved
8 A / A' Receive/transmit data − (line A)
9 Reserved

3.2 Termination rule (critical)

  1. Power the terminator using pin 6 (+5 V) of the connector at both end stations. The 6ES7 972-0BA12 connector has a switch labelled "ON / OFF" — set ON only at the two end stations.
  2. Never place a terminated connector in the middle of a segment. Reflections will destroy the signal at 1.5 Mbit/s and above.
  3. If a repeater is used, every repeater port is its own segment with its own terminator rule.

4. CPU-to-CPU Master-Slave Configuration in STEP 7

This section configures two S7-300 CPUs as DP master and DP slave, with the master reading 4 bytes of input from the slave and writing 4 bytes of output to the slave.

4.1 Create the project

  1. Open SIMATIC Manager → File → New Project → name it DP_MasterSlave_Demo.
  2. Insert a SIMATIC 300 station for the master: right-click the project → Insert New Object → SIMATIC 300 Station. Rename it CPU_Master.
  3. Insert a second SIMATIC 300 station: CPU_Slave.

4.2 Configure the master CPU

  1. Open CPU_Master → Hardware.
  2. Insert a RACK-300, then a PS 307 5A (slot 1), then a CPU 315-2 DP (6ES7 315-2AG10-0AB0, V2.6 or higher) in slot 2.
  3. When you double-click the X2 (MPI/DP) interface, the Properties — PROFIBUS interface dialog opens. Click New and create subnet PROFIBUS(1) with the default profile DP. Set address 2 for the master.
  4. Select DP Master operating mode, then click Operating Mode tab → DP Master → OK.

4.3 Configure the slave CPU

  1. Open CPU_Slave → Hardware, insert the same CPU 315-2 DP, this time assigning PROFIBUS address 3 on the same subnet.
  2. In the X2 dialog, switch the Operating Mode tab to DP Slave.
  3. Click the Configuration tab and define the I/O exchange area the slave will provide to its master:
    • Click New in the Slave Inputs box: row 0, address IB 0, length 4 bytes, consistency = Unit.
    • Click New in the Slave Outputs box: row 0, address QB 0, length 4 bytes, consistency = Unit.
  4. Compile and download the slave hardware configuration. Power-cycle is not required.

4.4 Connect slave to master in NetPro

  1. Open the master's HW Config. The PROFIBUS(1) subnet should show in the right-hand panel.
  2. Open the Siemens Application Note 1179382 — DP Couplers / CPU-to-CPU DP link for reference and confirm the dialog flow.
  3. Drag CPU_Slave from the project tree to the subnet. STEP 7 will warn "Assign Slave to Master" — confirm.
  4. Double-click the slave on the bus. A dialog opens where you map the master's I/O to the slave's I/O:
Direction Master I/O Address Length Consistency
Inputs (from slave) IB 100 .. IB 103 4 bytes Unit
Outputs (to slave) QB 100 .. QB 103 4 bytes Unit
  1. Compile and download to the master. The slave is now visible in the master's Diagnostic Repeater view with status 0x00 (OK) once the bus comes up.

4.5 User program on the master

The master simply moves data from IB 100..103 to its QB 0..3 for sanity-checking in PLCSIM:

// OB1 (master)
L     IB 100
T     QB 0
L     IB 101
T     QB 1
L     IB 102
T     QB 2
L     IB 103
T     QB 3

// On the slave side
L     IB 0      // received from master, written by master's QB100
T     QB 0      // mirrored back, read by master at IB100

4.6 Using SFC14 / SFC15 for consistent data

The default mapping in HW Config uses Unit consistency. For Total Length consistency (recommended when the data represents a coordinated record), use SFC14 "DPRD_DAT" and SFC15 "DPWR_DAT":

// Master FB — read 4 bytes from slave consistently
CALL  "DPRD_DAT"            // SFC 14
LADDR  := W#16#64           // 100 dec = 0x64, I-area start
RET_VAL:= MW 200
RECORD := P#DB1.DBX0.0 BYTE 4  // copy 4 bytes into DB1 starting at 0

// Write 4 bytes to slave consistently
CALL  "DPWR_DAT"            // SFC 15
LADDR  := W#16#6E           // 110 dec = 0x6E, Q-area start
RECORD := P#DB2.DBX0.0 BYTE 4
RET_VAL:= MW 202
The SFC14/SFC15 path requires the I/O slots to be configured with Total Length consistency, not Unit. Re-open the slave dialog in HW Config and change both directions to Total Length before downloading.

5. Remote I/O (ET 200) Configuration

The remote I/O link uses the same DP backbone. A typical ET 200M is a passive DP slave (no user program); all I/O is mapped directly into the master's I/O address space.

5.1 Insert ET 200M as DP slave

  1. Open CPU_Master → Hardware on the master station.
  2. In the catalog tree: PROFIBUS DP → ET 200M → drag IM 153-1 (6ES7 153-1AA03) onto the PROFIBUS(1) subnet at address 4.
  3. Right-click the IM 153-1 → Insert Object → select the required signal modules in slot order, e.g. SM 321 DI 16×24V (6ES7 321-1BH02-0AA0) and SM 322 DO 16×24V/0.5A (6ES7 322-1BH01-0AA0).
  4. STEP 7 auto-assigns I/O addresses — verify the range (typical 4..7 for DI, 4..5 for DO on a 1-slot base).
  5. Compile and download.

5.2 ET 200S variant

For ET 200S, the IM 151-1 (6ES7 151-1AA04-0AB0) is configured the same way. Power modules (PM-E) sit in slot 0, electronic modules in slots 1–63. Watch for hot-swap: only IM 151-1 ST and HF variants support module exchange during operation.

5.3 Status bytes

Each IM 153 has a 4-byte input status region (the slot 0 mapping). Reading byte 0 returns a bitmask of available modules; reading byte 1 returns the diagnostic bit. See Siemens Support Entry 1158693 — Configuring and Commissioning PROFIBUS DP.

6. Third-Party DP Slaves (GSD Files)

Any non-Siemens DP slave (encoder, valve block, variable-speed drive, etc.) is integrated by installing the manufacturer's GSD (General Station Description) file. The GSD text file lists every I/O module the slave supports, its diagnostics, and the slot count.

6.1 Install a GSD file

  1. In HW Config: Options → Install GSD File.
  2. Browse to the *.GSD or *.GSE (F-DPV1 with profile 3.02) file. STEP 7 copies it into ...\Siemens\Step7\S7data\GSD.
  3. Refresh the catalog (Options → Update Catalog). The new device appears in PROFIBUS DP → Additional Field Devices.
  4. Drag it to the bus, assign an unused address, then double-click each slot to map the desired input/output channel.
A device with profile 3.02 (DP-V1 with PROFIsafe) requires STEP 7 V5.5 SP2 + HF1 or TIA V13 SP1 or later. Older STEP 7 versions will see the GSD as unsupported.

7. Commissioning Procedure

  1. Power the bus terminators. Verify the green "Term Power" LED on both end connectors.
  2. Power the master, then each slave in turn. The SF (red) LED must be OFF, BF (red) LED must be OFF, ON (green) must be ON.
  3. Connect the PC to the master's MPI/DP port. In SIMATIC Manager: PLC → Online → Accessible Nodes. The master should appear.
  4. From HW Config: Station → Online. The online view will show each slave as green (OK), red (fault), or yellow (not configured / wrong module).
  5. Open the master's Module Information (right-click CPU → Module Information) → Diagnostic Buffer. Look for event 16# 0A21 (DP slave OK) or 16# 0A22 (DP slave failure).
  6. Force a single digital output on the ET 200. Read back the corresponding input on the master. A passing loop confirms the bus, address map, and program are all healthy.

8. Diagnostics and Troubleshooting Matrix

Symptom Most Likely Cause Diagnostic Step Fix
BF (bus fault) red LED on master, flashing at 1 Hz No termination or terminator power missing Check pin 6 = +5 V on both end connectors Set terminating switch ON, power 24 V on terminator variant
BF red steady on master Cable short, broken shield, baud-rate mismatch Disconnect slaves one by one, observe when BF clears Replace cable; verify all stations set to same baud rate (or use Auto-Detect via DPV1)
SF red on slave, master reports 0x0A22 Slave is in RUN-STOP, no program, or wrong GSD revision Read slave diagnostic buffer via HW Config → Slave Diagnostics Load the matching GSD; switch slave CPU to RUN
Master sees slave, but I/O is always 0 Slot configured in HW Config but the physical module is missing or wrong order Compare online view with offline view side-by-side Insert correct module, re-download HW Config
Intermittent loss at high baud (1.5/3/6/12 Mbit/s) Spur cables too long, wrong cable type, missing 360° shield contact Measure segment with BT 200 bus tester (6ES7 193-8PA00-0AA0) Use Type A solid-core cable, shorten all taps to < 1 m at 12 Mbit/s, re-crimp connectors with shield clamp
PLCSIM DP doesn't see partner STEP 7 V5.5 + SP2 requires S7-PLCSIM on the same PC with the Softbus option enabled Check Start → SIMATIC → S7-PLCSIM → Setting the PG/PC Interface → PLCSIM (PROFIBUS) Switch interface assignment; rebuild both station downloads; or use a single real CPU + one PLCSIM instance for testing
Diagnostic buffer shows 0x0F31 on master Address conflict — two stations on the same DP address Disconnect half the network, isolate Re-address one of the conflicting stations
SF on ET 200M, slot 0 status byte = 0x10 Module pulled or wrong module type installed Read IM 153 diagnostic data Insert the correct module or update HW Config to match

9. Performance and Bus Timing

For deterministic loops, calculate the worst-case cycle using PI's simple model:

T_cycle ≈ Σ (T_message(i) + T_slave(i)) + 6·T_bit + Token_T_total

where T_message(i) = number of bytes for slave i × 11 bit-times, T_slave(i) = Tsdr (≤ 60 bit-times for a DP-V0 slave, ≤ 100 bit-times for DP-V1), and 6 bit-times per station for the slot time. At 1.5 Mbit/s, a 4-byte I/O exchange takes roughly 4·11·11/1,500,000 = 0.32 ms of pure airtime.

For motion, use DP-V2 isochronous mode with the SYNC signal from the master. CPU 317-2 DP and CPU 319-3 PN/DP support isochronous mode with the Synchronous checkbox in HW Config and the OB61 (Synchronous Cycle) interrupt.

10. Field-Proven Caveats

  1. Address 1 is the default for many Siemens slaves. If you insert a new ET 200M without changing the address switches, two devices on address 1 will fight and bring the segment down without a clear message. Always re-address before power-up.
  2. Use 6XV1 830-0EH10 cable. The older 6XV1 830-0AH10 (grey) is identical electrically but sold for indoor fixed installation only and has a different fire rating. The violet (EH) is the current Profibus DP cable and is qualified for 12 Mbit/s up to 100 m.
  3. Strip back the outer jacket exactly 25 mm and the inner foil exactly 12 mm when assembling a 6ES7 972-0BA12 connector. The shield must make 360° contact with the connector backshell clamp — a "pigtail" drain wire alone is not acceptable at 12 Mbit/s.
  4. Keep DP cable ≥ 20 cm from VFD motor cables. Even with shielded cable, capacitive coupling at PWM edges is the most common cause of intermittent CRC errors.
  5. Address space is per master, not per segment. Master 1 may use 2..30, master 2 may use 31..60 — the two address ranges must never overlap.
  6. STEP 7 V5.5 + SP2 + HFx is the last stable release for legacy projects; new builds should be in TIA V16 or V17. TIA V15 has known issues with old ET 200S GSD files that V16 fixed.

11. Reference Material

What baud rate should I use for a 50 m cabinet with one master and three slaves?

1.5 Mbit/s. Cable run is well under the 200 m limit for that rate, and 1.5 Mbit/s is the highest baud rate that all Siemens ET 200 and S7-300 DP ports support reliably on standard 6XV1 830-0EH10 cable without isochronous restrictions. STEP 7 "Auto-Bus Profile" can be left enabled and will negotiate down if a slave can't keep up.

Can I have two DP masters on the same physical bus?

Yes — PROFIBUS is multi-master. With 32 stations per segment, mix up to 32 class-1 masters total. Set distinct PROFIBUS addresses on every master, give each master its own slave address range, and set the master's "Highest Station Address" (HSA) parameter in HW Config to the last address it must poll. Token rotation is automatic; a failing master drops out within the GAP factor timeout.

Do I need a repeater for 4 slaves in a 350 m run?

Yes, if you run at 500 kbit/s or higher. At 500 kbit/s the segment limit is 400 m, so 350 m is borderline. Cleanest solution: split into two segments with a Siemens 6GK1 500-3AA00 repeater placed at the 200 m mark. At 187.5 kbit/s the segment is rated 1,000 m, so no repeater is needed at lower baud — but 1.5 Mbit/s would require repeaters every 200 m.

How do I integrate a non-Siemens slave (e.g. Festo valve manifold)?

Download the GSD file from the manufacturer's product page or from the PI GSD library, then in STEP 7 HW Config choose Options → Install GSD File. After Update Catalog, the device appears under PROFIBUS DP → Additional Field Devices. Drag it onto the bus, set its address, and the I/O channel lengths are read straight from the GSD.

Why does my CPU slave show BF but the master is fine?

Almost always a duplicate PROFIBUS address. The slave is transmitting on the bus while the master is not addressed to it, so the slave's token-passing logic never receives an answer and times out. Disconnect half the network to isolate, then check the address DIP switch on the IM module or the HW Config address of each CPU.

Back to blog