SIMOCODE Profibus Bus Fault Diagnostics: SFC13 vs Cyclic Signal

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

When integrating Siemens SIMOCODE pro motor management devices on a PROFIBUS DP network, engineers must distinguish between two distinct fault signals that both indicate a problem with the field device:

  • The bus fault bit inside the SIMOCODE cyclic I/O data, configured in HW Config / TIA Portal device configuration.
  • The DP slave diagnostic frame retrieved acyclically with the SFC 13 (DPNRM_DG) system function block in STEP 7 / TIA Portal.

Both originate from the slave, but they report different things and have different latency, reliability, and applicability. Selecting the wrong one for an emergency stop chain, an alarm, or a maintenance page is a common source of misleading fault displays in the HMI. This article explains the underlying PROFIBUS mechanism, contrasts the two signals at the bit and frame level, and shows how to wire them into STEP 7 with verified behavior. Reference documentation is the SIMATIC S7-300/400 System and Standard Functions reference manual and the SIMOCODE pro PROFIBUS System Manual.

SIMOCODE Profibus Interface Architecture

SIMOCODE pro is the Siemens motor management system (3UF7 generation) that replaces classical overload relays and contactor-control wiring. The PROFIBUS-capable variants (SIMOCODE pro V DP, 3UF7010-1AU00-0; SIMOCODE pro S DP, 3UF7020-1AU01-0; SIMOCODE pro C DP, 3UF7000-1AU00-0) expose a class-1 PROFIBUS DP-V0/V1 slave on the RS-485 isolated front bus port.

The device implements the standard PROFIBUS DP slave state machine and supports the following communication services relevant to fault detection:

  • Cyclic data exchange (MS0, DP-V0): 1 byte of consistent input, 2 bytes of consistent output in the default configuration; can be expanded up to 32 bytes input / 32 bytes output by adjusting the SIMOCODE pro parameter set in SIMOCODE ES (TIA Portal) or the legacy SIMOCODE pro parameterization tool.
  • Acyclic read/write (MS1, DP-V1): Used by SIMOCODE ES for parameterization, online diagnostics, and firmware updates via data records in the range 0–255.
  • Diagnostic telegram (MS0, DP-V0): Standard 6-byte diagnostic frame plus device-specific extension of up to 238 bytes, automatically transmitted by the slave on state change.
  • Sync/Freeze (DP-V0): Supported but rarely used in motor control.

The PROFIBUS interface is galvanically isolated (test voltage 707 V DC for 1 minute per IEC 61131-2) and terminates the segment with a built-in 220 Ω resistor that can be switched in/out of circuit via the rotary switch on the device base unit.

Conceptual Difference: Bus Fault vs. Slave Diagnostics

A bus fault on PROFIBUS DP means the physical or data-link layer has failed. Typical causes are broken cable, missing or wrong termination, EMC injection, address conflict, master failure, repeater loss of power, or a slave whose transceiver has died. While a bus fault is active, the master cannot exchange user data with that slave and cannot read its diagnostic frame either: the DP-V0 master polls each configured slave, and if the slave does not respond within the slot time, the master sets a slave-local "station failure" flag and reports it through its own diagnostic resources.

By contrast, slave diagnostics are an application-level report generated by the still-functional slave firmware when it detects an internal anomaly: motor overload, phase failure, thermistor trip, ground fault, number of starts exceeded, blocked rotor, or a process-side warning. The slave pushes a 6-byte (or extended) DP diagnostic frame to the master, which the master stores in the slave's diagnostic buffer. The user code then pulls this frame with SFC 13 (DPNRM_DG) for parsing.

The two states are not equivalent and do not exclude each other:

  • During a bus fault there is no communication, so SFC 13 returns RET_VAL = 0x8091 ("bus communication error") and the destination buffer is unchanged. Only the master's "slave failed" flag is updated, which propagates into the cyclic bus fault bit of other slaves if the segment is shared.
  • During a slave diagnostic event (e.g., overload trip), PROFIBUS is healthy, cyclic data flows normally, and the diagnostic frame is queued for SFC 13 to read.

The Cyclic Bus Fault Bit in SIMOCODE Pro

The SIMOCODE pro cyclic input area always carries a "Status / Bus Fault" bit independent of the user-configured process data. The bit position depends on the configured telegram length, but in the default 1-byte input / 2-byte output telegram the layout is:

Byte Bit Designation Meaning
Input byte 0 (SST) 0 Status (S) 0 = Fault, 1 = Run / Ready
Input byte 0 1 Bus fault (BF) 1 = PROFIBUS communication failure, 0 = OK
Input byte 0 2–6 Process, control, mode, ready Application-specific (start command, mode, etc.)
Input byte 0 7 Reserved / Not connected Always 0

The Bus Fault (BF) bit in input byte 0 is set by the SIMOCODE firmware when the PROFIBUS state machine has not reached Data Exchange within T_trdy (typically 100 ms after power-up) or when the cyclic watchdog has expired. It is not a reflection of the master's view: SIMOCODE derives it from the local chip-level bus monitor, which makes the bit useful even if the PLC is in STOP and the segment is shared with other controllers on a Y-link.

Because the cyclic bus fault bit is part of the standard SIMOCODE cyclic profile, no extra configuration is needed; it is always present from firmware version E03 (3UF7010/3UF7020) onward. The bit is updated on every DP cycle, so the detection latency equals the configured PROFIBUS bus cycle time (1.5–10 ms in a typical plant).

SFC13 (DPNRM_DG) – Acyclic Slave Diagnostics Read

SFC 13 "DPNRM_DG" is the STEP 7 system function block that reads the most recent DP diagnostic frame from a slave. It is defined in IEC 61131-3 as part of the SIMATIC standard library and documented in the SIMATIC S7-300/400 System and Standard Functions reference manual (entry ID 44240604). The call interface is:

// SFC 13 call (English keyword form)
CALL "DPNRM_DG"
REQ    := TRUE                       // rising edge triggers read
LADDR  := W#16#0104                   // PROFIBUS diagnostic address of slave (HW Config)
RET_VAL := MW100                      // return value (0 = OK, see error table)
RECORD := P#M 200.0 BYTE 26           // destination ANY pointer (>= 6 bytes for std. diag, up to 244 for extended)
BUSY   := M110.0                      // TRUE while read is in progress

Key parameters:

  • LADDR – diagnostic address (not the I/O address) of the DP slave, as assigned in HW Config. For a SIMOCODE pro at PROFIBUS address 4 the LADDR is typically W#16#0104 (decimal 260 = 256 + address). Mixing I/O address with diagnostic address is a common commissioning error and causes RET_VAL = 0x8090.
  • RECORD – destination ANY pointer with byte length ≥ 6 (standard DP diagnostic) and ideally ≥ 26 to accommodate the SIMOCODE-specific extension. SFC 13 writes exactly the number of bytes present in the diagnostic buffer of the slave; it never truncates, but it does not return more than the buffer length.
  • RET_VAL – 0 on success; otherwise one of the error codes listed below.
  • BUSY – must be polled; the read takes 1–3 PROFIBUS cycles.

RET_VAL error codes for SFC 13 (per the Siemens standard reference):

RET_VAL (hex) Meaning Typical Cause with SIMOCODE
0000 Job completed, no error, no warning Diagnostic frame received and stored in RECORD
0001 Job completed, no error, but RECORD too small — output truncated to RECORD length RECORD ANY length < diagnostic frame length; standard 6-byte RECORD with SIMOCODE only returns the standard 6 bytes, status bits OK
7000 REQ = 0 / first call with REQ = 1 Normal idle; BUSY = 0
7001 First call still in progress Wait; polling continues
7002 Subsequent call, job still active Continue polling BUSY
8090 Specified LADDR not configured Diagnostic address not in HW Config; module pulled; project mismatch
8091 Bus communication error (no parameterization frame received) Cable break, terminator missing, slave powered down, master not in run
8092 Slave has not parameterized or configured GSD file mismatch; SIMOCODE still booting; wrong module in slot
80A2 DP protocol error at layer 2 Heavy EMC; faulty repeater; duplicate address
80A3 DP protocol error on user I/O User data length mismatch (cyclic config vs. GSD)
80B0 "Slave failure" — slave does not respond Segment powered off; bus fault condition; address conflict
80B1 "Length error" in parameter or configuration frame SIMOCODE in IDENT mismatch; wrong GSD revision
80B2 Slave in fault state (DPV0 state WAIT-PRM / WAIT-CFG) SIMOCODE firmware detected internal error; replace base unit
80B3 Slave not yet ready for data exchange SIMOCODE in startup; check "DEVICE" LED on basic unit
80C0 HCI / module access error Diagnostic buffer locked by another SFC job (avoid concurrent calls)
80C1 Resources exhausted Too many concurrent acyclic jobs on the same PROFIBUS line
80C2 Time-out reading diagnostic buffer Intermittent bus; check repeater power; check connector pins
80C3 Other resource error Internal stack overflow on CP 342-5 / IM 153; reduce polling rate

SFC 13 is acyclic: it does not run on every OB1 scan, only when REQ has a rising edge. For SIMOCODE, a 500 ms poll from OB35 (cyclic interrupt) is sufficient; faster polling does not yield new data and steals bus bandwidth.

Technical Comparison: SFC13 vs. Cyclic Bus Fault

Attribute Cyclic Bus Fault (SIMOCODE input byte 0, bit 1) SFC 13 (DPNRM_DG) Slave Diagnostic
Source Local to SIMOCODE base unit; set by firmware when DP state machine is not in Data Exchange Standard DP-V0 diagnostic frame generated by the slave firmware and forwarded by the master
Reported condition Bus fault (communication failure) only Any DP-standard diagnostic event: bus fault, external fault, module fault, channel-specific diagnostic, identifier-related diagnostic, status messages
Latency 1 PROFIBUS cycle (1.5–10 ms) Acyclic; latency = SFC 13 poll period + 1–3 DP cycles (typically 500 ms + 5 ms)
Direction Cyclic (always transmitted) Acyclic, on demand
Code path in PLC Direct I/O read: IB 100 / %IB100 SFC 13 call, parse RECORD bytes
Configuration None (always present in default 1-byte / 2-byte profile) None on SIMOCODE side; diagnostic address must be set in HW Config on the master side
Bandwidth cost on PROFIBUS Zero (part of the configured cyclic telegram) One acyclic read per call; on a 12 Mbit/s segment with 32 slaves this is negligible, but on 9.6 kbit/s / 93.75 kbit/s segments with many slaves it is measurable
Survives PLC STOP / master failure Yes — derived from the SIMOCODE local bus monitor; bit remains set as long as no master polls the slave No — SFC 13 needs the master to be in RUN and the slave to respond
Distinguishes overload vs. wire break vs. phase loss No Yes — bytes 4–5 of the standard diagnostic plus SIMOCODE-specific extension bytes 6–25 carry the cause
Reliability for safety chain Acceptable; but the bit toggles on short DP retries, so debounce 3–5 cycles for hardwired ESD signals Acceptable for diagnostics, not for hardwired safety — use the dedicated safe PROFIsafe profile (SIMOCODE pro V PN with PROFIsafe) for safety

When to Use Each Method (Decision Matrix)

Use the cyclic bus fault bit for:

  • Indication in the HMI/SCADA top-level status page ("Device not communicating").
  • Automatic input to the alarm subsystem where only the binary "communicating / not communicating" state is needed.
  • PLC logic that depends on data validity, e.g., gating setpoints to zero when bus fault is active.
  • Code paths that must work while the master CPU is in STOP (e.g., transferring the signal to a Y-link partner's HMI).

Use SFC 13 (DPNRM_DG) for:

  • Detailed diagnostic display in the HMI: which SIMOCODE event caused the trip (overload, phase failure, thermistor, ground fault, blocked rotor, asymmetry, number-of-starts limit, etc.).
  • Centralized maintenance station: log the diagnostic frame with timestamp when the bus fault toggles.
  • Cross-checking whether the cyclic bus fault bit is genuine or merely a transient retry failure.

For maximum coverage, use both: the cyclic bit drives the "device OK" indicator and the safety latch; SFC 13 enriches the operator message with the cause. The two signals are independent and complementary — using one does not make the other redundant.

STEP 7 / TIA Portal Implementation

Drop the SIMOCODE pro GSD file (Siemens file name SIMOCODE_0B11.GSD for pro V/S, SIEM8171.GSD for older releases; current rev. ~V2.5) into TIA Portal under Options → Manage Device Description Files. In the device configuration, place the SIMOCODE in the PROFIBUS subnet, set the station address, and accept the default 1-byte input / 2-byte output module. The cyclic bus fault bit is exposed at %IB<slot> in the PLC tag table.

For SFC 13, declare a tag array of at least 26 bytes in a global DB:

DATA_BLOCK "DB_Diag_SIMOCODE"
{ S7_Optimized_Access := 'FALSE' }
VERSION : 0.1
STRUCT
  StdDiag : ARRAY[0..5]  OF BYTE;   // bytes 0..5, standard DP-V0 diagnostic
  ExtDiag : ARRAY[0..19] OF BYTE;   // bytes 6..25, SIMOCODE-specific extension
END_STRUCT;
END_DATA_BLOCK

Call SFC 13 from OB1 (or OB35 if you want to throttle to 100 ms):

// LADDR = 256 + PROFIBUS address
// Example: address 4 -> LADDR = 260 (W#16#0104)
CALL "DPNRM_DG"
REQ    := "Diag_Trig"                       // 1-Hz pulse from clock memory
LADDR  := W#16#0104
RET_VAL := "Diag_RET"
RECORD := P#"DB_Diag_SIMOCODE".StdDiag
BUSY   := "Diag_Busy"
IF "Diag_Busy" = FALSE AND "Diag_RET" = 0 THEN
  // bytes 4..5 carry the standard DP diagnostic
  "Diag_StationFailure" := "DB_Diag_SIMOCODE".StdDiag[4].%X0;
  "Diag_ExtDiagPresent" := "DB_Diag_SIMOCODE".StdDiag[4].%X3;
  "Diag_PrmFault"       := "DB_Diag_SIMOCODE".StdDiag[5].%X0;
  // bytes 6..25 are SIMOCODE-specific; see next section
END_IF;

Diagnostic Data Record Layout

The standard DP-V0 diagnostic frame returned by SFC 13 is parsed per IEC 61158-6 / EN 50170. The first 6 bytes are fixed; bytes 7 onward are vendor-specific. For SIMOCODE pro the layout is:

Byte Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0
0 Station status 1 (0x00 = reserved, 0x10 = freeze, 0x20 = sync, 0x40 = watchdog, 0x80 = sum/identifier-related diag active)
1 Station status 2 (0x01 = parameterization required, 0x02 = configuration required, 0x04 = ext. diag flag, 0x08 = WD on, etc.)
2 Station status 3 (0x10 = ext. diag overflow, 0x20 = ext. channel diag present)
3 Master address (PROFIBUS address of the master that parameterized the slave)
4 Identifier-related diagnostic (0x05 = vendor-specific, 0x10 = channel-specific)
5 Module status / extended module status
6 Header byte: 0x00 (SIMOCODE specific)
7 Status block 1: SIMOCODE internal event flags (overload, phase, thermistor, etc.)
8–25 Additional status, command, and warning bits per SIMOCODE pro PROFIBUS System Manual

Byte 4 bit 3 ("ext_diag") is the master telltale that further bytes contain a vendor extension. The SIMOCODE-specific bytes 6–25 then carry the detailed cause. Refer to the SIMOCODE pro PROFIBUS System Manual (entry ID 109750635) for the exact mapping in your firmware revision (the layout is stable from E03 firmware onward, but the bit positions for new events such as "Number of starts limit reached" were extended in E05).

Configuration Procedure

  1. Open TIA Portal (V16 or later recommended for the latest SIMOCODE pro GSD). Open the device configuration of the S7-300/400/1500 CPU.
  2. Open the PROFIBUS subnet and add SIMOCODE pro from the catalog. Assign the PROFIBUS address matching the rotary switch on the device (default 126; change to 3, 4, 5, … as required).
  3. Insert the standard "SIMOCODE pro 1 Byte In / 2 Byte Out" module (or the larger 4-byte / 8-byte variant if your user data requires it). Confirm the cyclic I/O addresses.
  4. Open the PLC tag table and create tags for the input byte and the bus fault bit. The bus fault bit is at %IX<slot>.1.
  5. For SFC 13 diagnostics, note the diagnostic address shown in the device view under "PROFIBUS address → Diagnostic address" (default 256 + PROFIBUS address). This is the value to pass to SFC 13's LADDR input.
  6. Add SFC 13 to the project (Libraries → Standard Library → System Function Blocks → SFC 13). Drop it into OB1 or a cyclic interrupt OB.
  7. Create a global DB of at least 26 bytes to receive the diagnostic frame. Allocate the DB at a non-optimized access area (or with "Set in IDB" disabled) so it can be addressed by SFC 13.
  8. Wire the REQ input to a clock-memory bit (e.g., M10.7 for 0.5 Hz) so the call rate is throttled to once per 2 s — this is sufficient for diagnostic refresh and keeps the PROFIBUS acyclic load below 1% on a 1.5 Mbit/s segment.
  9. Download the project to the CPU and the SIMOCODE. Cycle power to the SIMOCODE so it re-parameterizes from the new GSD.
  10. Open the SIMOCODE ES online view (PROFIBUS → Online → Assign PROFIBUS address if needed). Confirm that the device shows the green "Device OK" LED and the cyclic "Status" bit is 1.

Verification and Field Commissioning

After the project has been loaded, perform the following checks in order:

  1. Healthy state check: With the motor stopped and SIMOCODE powered, the cyclic status bit (input byte 0, bit 0) should be 1 and the bus fault bit (bit 1) should be 0. The "DEVICE" LED on the SIMOCODE basic unit should be solid green, and the "BUS" LED should be off.
  2. Offline simulation: In PLCSIM (TIA Portal) or the S7-PLCSIM advanced, force the PROFIBUS diagnostic to simulate a slave failure and confirm that the cyclic bus fault bit goes high within one OB1 cycle, and that SFC 13 returns RET_VAL = 0x80B0 with BUSY = 0.
  3. Live test – pull the bus connector: Disconnect the PROFIBUS connector at the SIMOCODE end. The "BUS" LED should flash red, the cyclic bus fault bit should go high within 200 ms, and SFC 13 should return RET_VAL = 0x8091 within one poll cycle.
  4. Live test – force a trip: Cause a real overload or use the SIMOCODE ES "Test → Trip" function. The cyclic status bit should go to 0 (fault), the bus fault bit should remain 0 (PROFIBUS is healthy), and SFC 13 should return a non-zero extended diagnostic with the overload flag set in byte 7.
  5. Diagnostic latching: Confirm that the diagnostic is latched in the master even after the SIMOCODE returns to healthy state. The standard DP-V0 diagnostic is buffered per slave until read; once SFC 13 reads it, the next read may return zeros until the next event. Implement a latching block in the PLC that captures the diagnostic on the rising edge of "ext_diag" so the HMI does not show a blank screen after the event is acknowledged.
  6. Bandwidth check: With all slaves polling SFC 13 at 1 Hz, observe the PROFIBUS utilization via the diagnostic counters of the CP 443-5 Extended or CM 1542-5. Utilization should remain below 50% on a 1.5 Mbit/s segment; if it is higher, throttle the poll to 0.5 Hz or 0.2 Hz.
  7. Cold start test: Power-cycle the SIMOCODE. The bus fault bit should be high during the boot phase (T_trdy = 100 ms typical), then clear once the DP state machine reaches Data Exchange.

Troubleshooting Matrix

Symptom Cyclic Bus Fault Bit SFC 13 RET_VAL Most Likely Cause Action
SIMOCODE appears OK, but cyclic bus fault is high 1 0x8091 PROFIBUS segment broken, terminator missing, slave powered down Check terminator (220 Ω ON at both ends only); check 24 V supply to base unit; check D-sub pin 6 (P5V) for short
All slaves on the segment have bus fault at once 1 0x8091 for every slave Master CP failure or repeater loss of power Check DP master module LEDs; check repeater 24 V; cycle master CPU
Bus fault bit toggles every 1–2 s 1 (toggling) 0x8091 (toggling) Loose connector, oxidized contacts, intermittent power Replace D-sub connector with Siemens 6ES7972-0BA52-0XA0 (with PG socket); retorque; check shield contact
Bus fault bit stays 0, but motor does not run 0 0x0000 SIMOCODE process-level trip (overload, phase loss, etc.) Inspect SFC 13 byte 7+; clear trip via SIMOCODE ES or local "RESET" button
SFC 13 returns 0x80B0, but other slaves on the same segment are fine 0 (briefly, until 200 ms debounce) 0x80B0 SIMOCODE internal fault, hardware failure on base unit Cycle power; if persistent, replace basic unit (3UF7011-1A.00-0); check firmware version against GSD
SFC 13 returns 0x8090 after a project change 0 0x8090 LADDR points to wrong address; diagnostic address not in HW Config Cross-check with device view; LADDR must be 256 + PROFIBUS address, not the I/O address
SFC 13 returns 0x80C1 under heavy load 0 0x80C1 Too many concurrent acyclic jobs on the same CP Throttle SFC 13 calls; serialize via a single job queue; do not call SFC 13 from multiple OBs
Diagnostic shows "station_failure" but bus fault bit is 0 0 Byte 4 bit 0 = 1 Slave momentary drop out, recovered before next cycle Implement a latch; correlate with the CP's diagnostic buffer entry (event ID 0x001E "DP slave failure")

FAQ

What is the precise difference between a PROFIBUS bus fault and a SIMOCODE diagnostic event?

A bus fault means the physical or data-link layer is broken: cable, terminator, power, or transceiver. SFC 13 will return RET_VAL 0x8091 or 0x80B0 because the master cannot read the diagnostic buffer. A SIMOCODE diagnostic event is a still-functional slave reporting an internal condition (overload, phase failure, thermistor, ground fault, etc.). PROFIBUS is healthy, cyclic data flows, and SFC 13 returns RET_VAL 0x0000 with a non-zero extended diagnostic in bytes 6–25.

Can the cyclic bus fault bit and SFC 13 ever give contradictory information?

Yes, briefly. The cyclic bus fault bit is updated every 1.5–10 ms (PROFIBUS cycle). SFC 13 polls at 500 ms–2 s. If a slave recovers between two SFC 13 calls, the cyclic bit will already be back to 0 while the previous diagnostic buffer still holds the slave_failure flag from the last read. Implement a latching block in the PLC to avoid false alarms in the HMI.

Which signal should drive the safety chain or hardwired ESD?

Neither, in a SIL-rated application. PROFIBUS DP-V0 communication is not safety-rated. For safety, use SIMOCODE pro V PN with PROFIsafe (PROFIBUS profile PROFIsafe on PROFIBUS or PROFINET with PROFIsafe) and a fail-safe CPU such as the S7-1500F or S7-300F. The cyclic bus fault bit is acceptable for non-safety indications only.

What is the minimum SFC 13 RECORD length to capture a SIMOCODE pro diagnostic?

6 bytes covers the standard DP-V0 diagnostic. To capture the SIMOCODE-specific extension (overload, phase, thermistor, ground fault, etc.) allocate at least 26 bytes. A 32-byte buffer is a common conservative choice and aligns with the maximum DP-V0 diagnostic length per IEC 61158-6.

Why does SFC 13 sometimes return RET_VAL 0x0001 with RECORD too short?

0x0001 means the diagnostic frame was longer than the RECORD area. SFC 13 stores the first N bytes equal to RECORD length and discards the rest. Increase the RECORD length to the actual diagnostic length reported in the SIMOCODE ES online view (typically 26 bytes for SIMOCODE pro firmware ≥ E03).

Safety disclaimer: PROFIBUS DP-V0 communication is not fail-safe. Do not use either the cyclic bus fault bit or the SFC 13 diagnostic for safety functions. Use SIMOCODE pro V PN with PROFIsafe, an F-CPU, and a certified safety configuration per IEC 61508 / IEC 62061.
Back to blog