Troubleshooting Profibus Communication Loss Alarms in TIA Portal

David Krause3 min read
ProfibusSiemensTroubleshooting
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

Why OB82 Alone Does Not Hold the Alarm State

On a Siemens 315-2 PN/DP programmed in TIA Portal V13, OB82 (diagnostic interrupt) is called once on the incoming event and once on the outgoing event. If you only test #OB82_EV_CLASS against B#16#39, you react to the event-oncoming call, but the bit you set has no defined reset condition — and depending on the module and alarm source, the call timing can appear to fire only after the fault has already cleared. The correct pattern is to treat the two event classes as set/reset edges of a state, not as a single trigger. Note that the "Asynchronous error interrupts" settings in the hardware configuration are greyed out on this CPU; the interrupt behavior is not user-editable there, so the logic must live in the OB itself.

Set/Reset Alarm Logic in OB82

Use #OB82_EV_CLASS to distinguish oncoming (B#16#39) from outgoing (B#16#38) events, and use #OB82_MDL_ADDR (module base address) to qualify which device raised the diagnostic before setting or resetting your alarm bit:

// Diagnostic event ONCOMING -> set alarm
A(
  L #OB82_EV_CLASS
  L B#16#39
  ==I
)
S M 10.0   // AlarmBit: interrupt active

// Diagnostic event OUTGOING -> reset alarm
A(
  L #OB82_EV_CLASS
  L B#16#38
  ==I
)
R M 10.0   // AlarmBit: interrupt cleared

// Optionally compare #OB82_MDL_ADDR to the base address
// of the failing module to isolate the faulted device

This yields exactly the requested behavior: AlarmBit is on while the diagnostic state is present and off once it passes.

Detecting a Lost DP Slave with OB86

For a complete loss of a Profibus slave (such as the SMC pneumatic island dropping off the subnet), OB86 (rack/station failure) is the appropriate OB rather than OB82. Read local byte LB11 for the address of the failed station and evaluate #OB86_EV_CLASS the same way — B#16#39 for the oncoming failure, B#16#38 for its return — to set and reset the slave-loss alarm bit.

Watchdog Bit for PLC-to-HMI (KTP400) Communication Loss

OB86 covers Profibus station failures, but it does not directly alarm a dead KTP400 panel on the PLC side. The simple workaround is a clock toggle: have the PLC send a 1 s toggle bit to the KTP400, and on the panel monitor whether the on-state or off-state exceeds half the clock period (with a 1 s clock, alarm if a state persists longer than 500 ms). If the time is exceeded, the panel-to-PLC communication is lost and the HMI can raise the alarm immediately. Implement the complementary check in the PLC if the alarm must live on the controller: toggle a bit the HMI echoes or writes, and time how long it goes unchanged.

FAQ

How do I hold a Profibus alarm bit on while the fault is present in TIA Portal?

In OB82, compare #OB82_EV_CLASS to B#16#39 (event oncoming) to SET the alarm bit and to B#16#38 (event outgoing) to RESET it. Use #OB82_MDL_ADDR to qualify the faulting module.

Use OB86 (rack/station failure). Read LB11 for the failed station's address and evaluate #OB86_EV_CLASS for oncoming (B#16#39) versus outgoing (B#16#38) events.

Why are the asynchronous error interrupt settings greyed out in the hardware configuration?

On the 315-2 PN/DP these settings are fixed and protected from modification in TIA Portal V13. Handle the alarm behavior in the OB code (OB82/OB86) instead of trying to change the hardware settings.

How do I alarm when a KTP400 stops communicating with the PLC?

Send a 1 s clock toggle bit from the PLC to the panel and alarm if either the on-state or off-state lasts longer than half the period (500 ms for a 1 s clock). Exceeding that time means communication is lost.

Back to blog