Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 98210758, Entry date: 08/15/2019

Diagnostics in User Program with S7-1500

  • Entry
  • Associated product(s)
The diagnostics of devices, modules and networks play an ever-increasing role in automation technology. By diagnosing with a user program, faulty modules can be detected. This enables you to also program responses to diagnostic messages.

All SIMATIC products have integrated diagnostic functions that allow you to detect and clear faults. The components automatically report a fault during operation and provide additional detailed information. Plant-wide diagnostics can minimize unscheduled downtimes.

This application example describes how to monitor a PROFINET IO system and a PROFIBUS DP master system with different devices in the user program. The devices are connected to an S7-1500 controller via PROFINET IO / PROFIBUS DP. The devices detect faults on their modules and send the diagnostic data to the assigned controller. The controller evaluates this diagnostic information with the diagnostic instructions in the user program and saves it to a global data block. The operator panel graphically displays the evaluated diagnostic information in one view per IO system or in a device view.

It considers the following states:

  • State OK  
  • State FAULTY  
  • State WAS FAULTY

If diagnostic information is only displayed on different visual display devices and not used in the user program, it is recommended to use the S7-1500 controllers’ integrated system diagnostics. For more information about integrated system diagnostics, please refer to the following application example:
Application - System Diagnostics with S7-1500 and TIA Portal

The following screen shows the most important components of the solution with an S7-1500:

Documentation and example project for diagnostics in the user program
This example shows the diagnosis of a PROFINET IO and a PROFIBUS DP system in the user program with up to 128 devices. The visualization of the diagnostic information is displayed on an operator panel.

Documentation and example project for use of alarm instructions in the TIA Portal

This example shows the use of the alarm instructions "Program_Alarm, Get_AlarmState, Gen_UsrMsg" in the user program.

Further Information
Application - Diagnostics in User Program with S7-1200
Application - System Diagnostics with S7-1500 and TIA Portal
Application - Configuration of Messages and Alarms in WinCC (TIA Portal)
Application - Creating and using user-defined web pages on S7-1500

Last Changes
HMI: Reset of "ioSlot Diagnostics Loaded"

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
Rate entry
no rating
Requests and feedback
What do you want to do?
Note: The feedback always relates to the current entry / product. Your message will be forwarded to our technical editors working in the Online Support. In a few days, you will receive a response if your feedback requires one. If we have no further questions, you will not hear from us.
Support to the statistics
With this function the IDs found are listed according to number (format .txt).

Generate list
Copy URL
Display page in new design
mySupport Cockpit