PROFIBUS DP Consistent Data with DP/DP Coupler Using SFC14/15

David Krause21 min read
ProfibusSiemensTechnical Reference
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 of PROFIBUS DP Data Consistency

PROFIBUS DP (Decentralized Periphery) is a high-speed fieldbus specified in IEC 61158 and EN 50170 for connecting controllers (Class 1 DP masters) to distributed I/O and field devices (DP slaves). Cyclic data exchange forms the backbone of the protocol: each master sequentially polls its assigned slaves, and on every cycle the master reads the input image and writes the output image of each slave. Because the bus is shared, the integrity of multi-byte data values transferred in a single cycle depends on the consistency rules applied at the slave and the master's view of that data.

Data consistency in PROFIBUS DP means that a contiguous block of data transferred in a single bus cycle is guaranteed to represent a single, atomic snapshot of the source memory. Either the entire block reflects the state of the source at one point in time, or it reflects a different state. The protocol explicitly prohibits the case where individual bytes or words inside the block have been partially overwritten by a newer value while others still hold the previous value.

For an ET200S, ET200M, or any standard DP slave, the maximum consistent data length is determined by the slave's GSD file and its internal buffer architecture. For standard DP slaves, the most common consistent lengths are 1 byte, 1 word, 2 words, 4 words, 8 words, and 16 words (32 bytes). Some DP-V1 and DP-V2 slaves support up to 64 words (128 bytes) of consistent data per slot, and certain Siemens-specific devices (e.g., S7-300/400 CPUs acting as I-slaves, FM modules) can support larger consistent blocks.

DP/DP Coupler Operation and Internal Mirroring

A DP/DP coupler (Siemens catalog number 6ES7158-0AD01-0XA0) is a gateway that connects two independent PROFIBUS DP networks, allowing the DP master on network A to exchange I/O data with the DP master on network B without those masters sharing a single bus segment. Each side of the coupler presents itself as a standard DP slave with a configurable input and output area; the coupler internally mirrors the inputs received from one side to the outputs presented on the other side, and vice versa.

The typical maximum data length per side is 244 bytes of inputs and 244 bytes of outputs, although this is split across the slot structure. In STEP 7 or TIA Portal, the coupler is added to the hardware catalog under PROFIBUS DP > Couplers > DP/DP Coupler, and its input and output modules are inserted into the slot structure. Each module is configured with a length (in bytes or words) and a consistency attribute.

Because the two sides of a DP/DP coupler are configured independently, it is possible — and very common — for one master to mark the same data area as consistent while the other master marks it as non-consistent. The coupler itself does not enforce consistency; it simply forwards bytes. The consistency contract is held by the master accessing that side.

Per the official TIA Portal documentation, the DP/DP coupler is added to the device catalog and inserted onto the PROFIBUS subnet of the DP master; the slot structure is then configured with input and output modules, with the consistency attribute set per module. See the TIA Portal V20 reference: DP/DP coupler in the hardware catalog.

The "Sentence and Time Slice" Problem

The clearest way to understand why consistency matters is to picture the data as a sentence. Imagine the 16-word block you transfer via a DP/DP coupler spells out "THE QUICK BROWN FOX". If you fetch the words one at a time from the process image while the master is simultaneously writing a new value, the PROFIBUS cycle is in the middle of overwriting the source memory. There exists a finite time window during which the application reads word 1 from the new value, word 2 from the new value, word 3 from the old value, and so on. The result is a corrupted, mixed sentence such as "THE BRIWN FROG XOS".

Non-consistent (fragmented) data allows this mixed state to be observed by the consumer. The bus cycle, the master's process image update, and the application's read are three independent events that can interleave in any order. For data that is logically a single value (a measured position, a recipe word, a control word with status bits), this mixed state is not just inconvenient — it can cause the application logic to make a transient but incorrect decision, which in motion or process control can be hazardous.

Consistent data eliminates the mixed state by guaranteeing that the read or write operation captures the entire block in one indivisible transaction. The PROFIBUS hardware (or the CPU's consistent data buffer) latches the source memory at the start of the transaction and releases it at the end, so the consumer sees a stable snapshot.

SFC14 (DPRD_DAT) — Reading Consistent Data

SFC14 "Read Consistent Data of a Standard Slave" is part of the standard library of S7-300 and S7-400 CPUs. It reads a consistent block of data from a DP slave (or from a slot of an I-device) and copies it into a user-defined area in the CPU work memory.

SFC14 Interface
Parameter Declaration Type Description
LADDR INPUT WORD Configured start address of the slave's input area (e.g., W#16#100 for address 256)
RET_VAL OUTPUT INT Error code; 0 if the operation succeeded
RECORD OUTPUT ANY Destination area; must be of byte type and match the configured length (e.g., P#DB100.DBX0.0 BYTE 32)

The CALL must be issued from a cyclic OB (OB1) or a cyclic interrupt OB. Calling SFC14 from OB100 (warm restart) is not allowed because the DP slave is not yet in data exchange. Calling it from a higher-priority OB while a previous call is still being processed can cause the second call to fail with error 80C3h ("Number of frames exceeded").

Error Codes Returned by SFC14 / SFC15

SFC14 / SFC15 RET_VAL Error Codes
RET_VAL (hex) Meaning
0000 No error
8090 LADDR address not configured, or configured length exceeds maximum
8092 RECORD ANY pointer error (e.g., WRDB, type mismatch)
8093 RECORD data length does not match the configured length
80A0 Negative acknowledgment from the DP slave, or DP slave failure
80A2 DP slave data length inconsistency between configuration and actual response
80B0 DP slave is not in data transfer state (e.g., still configuring)
80B1 Indirect addressing error in the ANY pointer
80C0 Data transmission error on the bus
80C2 DP slave is in CLEAR mode
80C3 Number of frames exceeded (overload of the consistent data path)
80C4 Communication interruption (bus fault or slave power loss)

SFC15 (DPWR_DAT) — Writing Consistent Data

SFC15 "Write Consistent Data to a Standard Slave" is the write counterpart of SFC14. It transfers a consistent block of data from a user-defined source area to the DP slave's output area.

SFC15 Interface
Parameter Declaration Type Description
LADDR INPUT WORD Configured start address of the slave's output area
RECORD INPUT ANY Source area in the user program; must match the configured length
RET_VAL OUTPUT INT Error code

The same RET_VAL error codes as SFC14 apply. SFC15 is also subject to the same OB restrictions and to the "number of frames exceeded" limit when called too frequently from a high-priority OB.

Critical: If the slave's output area is configured as consistent, you must use SFC15 to write it. If you write to a single byte or word of the consistent area using T PQB or a direct MOVE instruction, the PROFIBUS master may be in the middle of transferring the consistent block to the slave. The slave firmware can either reject the entire block (and possibly report a diagnostic alarm) or, in the worst case, accept a partially updated block. Either way, the data integrity guarantee is broken.

Why Mismatched Consistency Between Two Sides Causes Silent Failure

Consider a DP/DP coupler with 16 words of input and 16 words of output. The master on network A configures the input area as "Consistent over total length" because it uses SFC14 to read the block. The master on network B, however, configures the same physical inputs as "Non-consistent" because the application reads them via direct I/O access (L PIB) in OB1. What actually happens?

The coupler hardware is not affected by the consistency setting — the bytes flow across the device in real time. The consistency setting is a property of the master CPU's view of its own I/O area. Master A reads its input area using SFC14, which causes the CPU to extract the consistent block in one transaction; the application sees a stable 16-word snapshot. Master B reads its input area directly from the process image, which is updated byte-by-byte (or word-by-word) at the end of each bus cycle. The application sees a stream of independently updated values, not a consistent block.

As long as master B's application does not interpret the 16 words as a single value, no harm is done. But if master B's application then forwards the same data to master A's outputs via another mechanism (for example, a CP443-1 cross-network write), the round-trip integrity is lost. The "sentence" can be corrupted at the master B boundary even if both masters "think" they have configured the same data area.

STEP 7 (V5.x) Configuration Procedure

  1. Open HW Config in SIMATIC Manager.
  2. Drag the DP/DP Coupler from the hardware catalog (PROFIBUS DP > Couplers > DP/DP Coupler) onto the PROFIBUS DP subnet of the first station.
  3. Double-click the coupler icon to open its properties. Note the PROFIBUS address; this must be unique on the subnet.
  4. Insert input and output modules from the coupler slot table. The "Universal module" is typical; configure it for the required byte/word count (1, 2, 4, 8, or 16 words).
  5. Open the properties of the input/output module. Under the "Address" tab, set the start address in the I/O area.
  6. Under the "Consistency" dropdown, select either "Unit" (single byte or single word) or "Consistent over total length" (the entire configured length).
  7. Compile and download the hardware configuration to the CPU.
  8. Repeat for the second station on the other PROFIBUS network, using a different PROFIBUS address for the coupler on that subnet.
Note: The two sides of the coupler are independent PROFIBUS stations. The PROFIBUS address of the coupler on side A does not need to match the PROFIBUS address of the coupler on side B. Each subnet is configured independently.

TIA Portal (V20) Configuration Procedure

In TIA Portal, the procedure is functionally identical but uses the Devices & Networks editor. Per the official TIA Portal documentation, the DP/DP coupler is added to the device catalog and inserted onto the PROFIBUS subnet of the DP master. The slot structure is then configured with input and output modules; for each module, the consistency attribute is set in the Properties pane under "I/O addresses".

The TIA Portal version 20 (and later) hardware catalog entry for the DP/DP coupler is the same as in STEP 7 V5.x, with a standardized module interface. The "Consistency" dropdown in TIA Portal offers the same options as STEP 7. See the TIA Portal V20 reference for the DP/DP coupler.

Programming Example: S7-300/400 Reading and Writing 16 Words

The following STL code reads 16 words (32 bytes) from the input area starting at address 256 (W#16#100) and writes 16 words to the output area starting at address 256. The two operations together implement a simple data pass-through via the DP/DP coupler.

// STL for S7-300/400 in OB1
CALL SFC14
   LADDR    := W#16#100
   RET_VAL  := MW 100
   RECORD   := P#DB 100.DBX 0.0 BYTE 32

CALL SFC15
   LADDR    := W#16#100
   RECORD   := P#DB 101.DBX 0.0 BYTE 32
   RET_VAL  := MW 102

The destination DB (DB100) and source DB (DB101) must each be at least 32 bytes long. The MW 100 and MW 102 are scratch words used to capture the SFC return values; if non-zero, an error has occurred and should be logged or annunciated.

Programming Example: S7-1500 Reading and Writing Consistent Data

S7-1500 CPUs use the same SFC14 and SFC15 system function blocks (renamed in TIA Portal to DPRD_DAT and DPWR_DAT) when interfacing with PROFIBUS DP slaves through a CM 1542-5 or CP 1542-5 communications module. The behavior is identical to the S7-300/400 implementation:

// SCL for S7-1500
"DPRD_DAT"(
   LADDR  := 256,
   RET_VAL := "dbStatus".readStatus,
   RECORD := P#"dbReceive".receiveData
);

"DPWR_DAT"(
   LADDR  := 256,
   RECORD := P#"dbSend".sendData,
   RET_VAL := "dbStatus".writeStatus
);

For S7-1500 CPUs that communicate with each other over PROFINET rather than PROFIBUS, the equivalent functionality is provided by the PUT/GET instructions (open IE communication) or by BSEND/BRCV (S7 communication). These instructions handle consistency at the application level and are not subject to the PROFIBUS DP consistent-data length limits.

OB Execution Context and SFC Call Frequency

SFC14 and SFC15 are designed to be called from a cyclic OB (OB1) or a cyclic interrupt OB (e.g., OB35). Each call to SFC14 or SFC15 consumes one DP cycle on the PROFIBUS network; calling these SFCs from a high-priority OB at a rate faster than the bus cycle can cause the "Number of frames exceeded" error (80C3h). The typical best practice is to call SFC14/SFC15 once per OB1 cycle, or once per OB35 cycle if the application only requires updates at the OB35 interval.

Calling SFC14/SFC15 from OB100 (restart) is not supported because the DP slave is not in data exchange at this point. Calling them from OB101 (hot restart, S7-400 only) requires that the DP master has finished its own initialization and that the slave has reached the data exchange state, which is typically not the case during OB101.

Process Image Update and Direct I/O Access

By default, S7-300 and S7-400 CPUs update the process image (PII, PIQ) at the end of OB1. The SFC14 and SFC15 calls bypass the process image and write directly to the work memory area specified in the RECORD parameter. This means that direct I/O access commands (L PIB, T PQW) on the same addresses will read from the process image, which is not updated by SFC14/SFC15. This is a common source of confusion: if the application uses SFC14 to read the consistent data into a DB, the process image at those addresses is not refreshed by SFC14 and will retain its previous value.

To force a process image update after an SFC14 read, you can call SFC26 (UPDAT_PI) or SFC27 (UPDAT_PO) on the relevant address range. However, this defeats the purpose of using SFC14 in the first place; the recommended pattern is to use the DB as the working copy and treat the process image as a separate, non-consistent view of the same data.

Troubleshooting Matrix

DP/DP Coupler Data Consistency Fault Matrix
Symptom Likely Cause Diagnostic Action Resolution
Data appears mixed (e.g., "THE BRIWN FROG") Direct I/O access to a consistent area, or non-consistent access to logically atomic data Search the program for L PIB / T PQB / MOVE on the affected addresses Replace direct access with SFC14 / SFC15; remove direct access from any OB
SFC14 returns 80A0h intermittently DP slave (coupler) failure or PROFIBUS segment disturbance Check the SF / BF LEDs on the DP master and the coupler; check cable termination and shield grounding Replace damaged cable segments; verify 9.6 kbps to 12 Mbps baud rate is supported by all devices on the segment
SFC14 returns 8093h at first call RECORD ANY pointer length does not match the configured length Compare the BYTE length in the RECORD parameter with the configured input length in HW Config Adjust the RECORD parameter to match the configured length exactly
SFC14 returns 80C3h under heavy load SFC called too frequently from a high-priority OB Add a frequency counter to the calling OB Reduce call frequency; call from OB1 instead of a faster cyclic interrupt OB
Data updates on one side but not the other Address mismatch between the two sides of the coupler Compare the slot configuration on both sides Align the input and output modules on both sides to use the same byte/word counts and slot positions
Coupler SF LED illuminated, BF LED off Configuration mismatch between master and coupler Compare the master's expected configuration with the coupler's actual GSD-rev level Update the GSD file in HW Config, or replace the coupler with a matching model
Data is read correctly but a downstream PLC receives corrupted values Round-trip through a non-consistent access path between the two masters Trace the data from the read point to the downstream write point; identify any non-consistent access Re-establish consistency on the intermediate access path; use PUT/GET or BSEND/BRCV for cross-CPU transfer

Common Configuration Errors

1. Unit consistency mismatch: Configuring 4 words of inputs as "Unit" on side A and as "Consistent over total length" on side B. Both sides will read valid data, but only side A will receive an atomic snapshot. Side B will read word-by-word and can observe mixed values.

2. Direct I/O access in OB1 or OB35: The most common cause of corrupted data. The application logic must not use L PIB or T PQB on the addresses configured for the DP/DP coupler if the master has marked the area as consistent.

3. Address overlap with another module: If the DP/DP coupler input addresses overlap with the input addresses of another DP slave, the process image will be aliased. SFC14 will read the correct consistent data, but direct I/O access will read whichever slave wrote last to the process image.

4. SFC called from the wrong OB: Calling SFC14 from OB100 (restart) or OB101 (hot restart) before the DP slave has reached the data exchange state will return 80B0h or 80A0h.

5. Process image partition mismatch: In TIA Portal, if the input addresses of the coupler are assigned to process image partition 2 but the application's OB35 is assigned to process image partition 1, the OB35 will read the previous process image, not the freshly SFC14-read data.

Alternatives for Cross-Master Data Transfer

If the application is bridging two Siemens S7-300/400 or S7-1500 controllers, the DP/DP coupler is not the only option. Direct cross-CPU communication mechanisms avoid the consistency pitfalls of PROFIBUS DP entirely:

  • PUT/GET (open IE communication over PROFINET/Industrial Ethernet): Suitable for small to medium data volumes; the function blocks handle consistency at the application level. Available for S7-300/400 with CP343-1/CP443-1 and for S7-1500 with native PROFINET interface.
  • BSEND/BRCV (S7 communication): Suitable for large data volumes (up to 64 KB per call). Provides handshake and consistency at the application level.
  • iDevice / I-slave with shared I/O: An S7-1500 CPU can be configured as a shared I-device on PROFINET, allowing another controller to access its I/O area directly without any user-program copy.
  • OPC UA server (S7-1500 native): For plant-bus integration, OPC UA provides a standardized, consistent data view that does not depend on PROFIBUS DP or PROFINET at all.

For non-Siemens masters (e.g., a third-party PLC on one side and an S7-300 on the other), the DP/DP coupler remains the standard integration point, and consistent data handling on the Siemens side is essential.

Specifications: Siemens DP/DP Coupler 6ES7158-0AD01-0XA0

Technical Data
Parameter Value
Catalog number 6ES7158-0AD01-0XA0
Function Gateway between two PROFIBUS DP networks
PROFIBUS DP protocol DP-V0 / DP-V1
Baud rates 9.6 kbps to 12 Mbps (auto-detect)
Max input data per side 244 bytes
Max output data per side 244 bytes
Total max data throughput 244 bytes input + 244 bytes output per direction (bidirectional)
PROFIBUS addresses supported 1 to 126 per side (independent)
Status LEDs Bus fault (BF), device fault (SF), power, DP1 / DP2 status
Diagnostic support Standard DP-V0 diagnostics; extended DP-V1 diagnostics
Power supply 24 V DC (19.2 to 28.8 V); typical 250 mA
Mounting DIN rail (TS35)
Operating temperature 0 °C to 60 °C (horizontal mounting); 0 °C to 40 °C (vertical mounting)
Dimensions (W x H x D) 40 x 125 x 120 mm
Protection class IP20

Data Length and Consistency Reference

Consistent Data Lengths and SFC Pairs
Length (bytes) Length (words) SFC14 / SFC15 call Typical application
1 Optional (direct I/O also works) Single digital I/O byte
2 1 Recommended Single analog input
4 2 Required for atomicity Counter + status, position LSB
8 4 Required for atomicity Position + status word
16 8 Required for atomicity Control block, recipe row
32 16 Required for atomicity DP/DP coupler default block, control + status + 8 parameters
64 32 Required for atomicity S7-300/400 I-slave, FM 350-1 / FM 351

Diagnostic Tools and Bus Monitoring

To diagnose intermittent consistency problems, a PROFIBUS bus monitor is often the only reliable tool. Recommended options include:

  • Siemens BT200 PROFIBUS bus tester: A handheld device that can capture and decode PROFIBUS frames, including the SRD (Send and Request Data) high-level messages used for cyclic data exchange. Can be inserted into a running segment via the diagnostic port on a PROFIBUS connector or repeater.
  • Procentec ProfiHub and ProfiTrace: A PC-based PROFIBUS analyzer that combines a tap on the bus with software for offline frame analysis. ProfiTrace can flag frames with corrupted consistent data and provide cycle time histograms.
  • Softing PROFIbus Diagnostic Toolset: A vendor-neutral PROFIBUS analyzer with detailed frame-level decoding.

When diagnosing, capture at least 1000 bus cycles and inspect the input/output frames for the DP/DP coupler station. A consistent block always appears in a single SRD response; a fragmented block is split across multiple SRD responses if the slave does not support consistent transfer at the configured length. The latter is rare on Siemens PROFIBUS slaves but can occur with some third-party devices.

Standards Reference

The PROFIBUS DP protocol and the consistency rules are defined in IEC 61158 (Industrial communication networks — Fieldbus specifications) and EN 50170 (General purpose field communication system, Volume 2: PROFIBUS). The DP-V0 specification is contained in IEC 61158-6-3; DP-V1 in IEC 61158-6-4; and DP-V2 in IEC 61158-6-5. The maximum consistent data length and the "buffered" vs "non-buffered" access modes are part of the slave's GSD file specification (GSD = General Station Description, defined in IEC 61784-1:2014 profile sets for PROFIBUS and PROFINET).

For SFC14 and SFC15, the authoritative reference is the Siemens "System Software for S7-300/400 System and Standard Functions" manual, which documents the block interfaces, the RET_VAL error codes, and the OB execution restrictions. The "Consistent Data" FAQ published in the Siemens Support knowledge base provides additional background on the atomicity guarantee and on the relationship between the master configuration and the slave firmware.

Verification Checklist

After commissioning a DP/DP coupler with consistent data, verify the following before placing the system in production:

  1. Both sides of the coupler show the same input and output data lengths in HW Config / TIA Portal.
  2. Both sides are configured with the same consistency attribute ("Consistent over total length" if the data is logically atomic).
  3. The application reads inputs exclusively through SFC14 (DPRD_DAT) and writes outputs exclusively through SFC15 (DPWR_DAT).
  4. No direct I/O access (L PIB, T PQB, MOVE from/to process image words) exists on the configured addresses.
  5. The SFC RET_VAL is monitored and annunciated; a non-zero RET_VAL should raise an operator alarm or trigger a controlled shutdown.
  6. A PROFIBUS bus monitor confirms that the consistent block is transferred in a single SRD frame on each cycle.
  7. The OB execution context for SFC14/SFC15 is documented and consistent (typically OB1 for general-purpose reads, OB35 for fixed-interval reads).

FAQ

What does "consistent data" mean in PROFIBUS DP?

Consistent data is a contiguous block of bytes or words that is transferred in a single, indivisible PROFIBUS transaction, so the consumer sees a stable snapshot rather than a mix of old and new values. For standard DP slaves, common consistent block sizes are 1, 2, 4, 8, and 16 words (32 bytes maximum on most devices).

What happens if I access consistent PROFIBUS data with direct I/O commands (L PIB / T PQB)?

The application reads or writes the data word-by-word from the process image while the master is simultaneously overwriting the same memory, producing a transient mixed value. For logically atomic data (control words, positions, recipes) this can cause incorrect control decisions and is a common source of "data corruption" complaints on PROFIBUS systems.

What is the difference between SFC14 and SFC15?

SFC14 (DPRD_DAT) reads a consistent block of inputs from a DP slave into a CPU work-memory area; SFC15 (DPWR_DAT) writes a consistent block from a CPU work-memory area to the outputs of a DP slave. Both must be used whenever the slave's I/O area is configured as consistent over total length.

Why does my DP/DP coupler data appear correct on one side and corrupted on the other?

The two sides of a DP/DP coupler are configured independently. If one side marks the data as consistent and reads it with SFC14 while the other side reads the same data with L PIB, only the first side receives an atomic snapshot; the second side can observe mixed values. The coupler itself does not enforce consistency — it only forwards bytes.

How do I configure consistent data in TIA Portal for a DP/DP coupler?

Add the DP/DP coupler from the device catalog to the PROFIBUS subnet, insert the input and output modules, and in each module's Properties pane under "I/O addresses" set the consistency to either "Unit" (1 byte or 1 word) or "Consistent over total length". For 16-word blocks used with the standard DP/DP coupler, select "Consistent over total length" and read/write the block in the program using SFC14 / SFC15 (DPRD_DAT / DPWR_DAT in TIA Portal).

Back to blog