Technical data
Diagnostics
23.8 Flow of Diagnostic Information
Programming with STEP 7
Manual, 05/2010, A5E02789666-01 499
23.8.2 Sending Your Own Diagnostic Messages
You can also extend the standard system diagnostics of SIMATIC S7 by using the system function
SFC 52 WRUSMSG to:
• Enter your own diagnostic information in the diagnostic buffer (for example, information about
the execution of the user program).
• Send user defined diagnostic messages to logged on stations (monitoring devices such as a
PG, OP or TD).
User Defined Diagnostic Events
The diagnostic events are divided into event classes 1 to F. The user defined diagnostic events
belong to event classes 8 to B. These can be divided into two groups, as follows:
• Event classes 8 and 9 include messages with a fixed number and predefined text that you can
call up based on the number.
• Event classes A and B include messages to which you can assign a number (A000 to A0FF,
B000 to B0FF) and text of your own choice.
Sending Diagnostic Messages to Stations
In addition to making a user defined entry in the diagnostic buffer, you can also send your own user
defined diagnostic messages to logged on display devices using SFC52 WRUSMSG. When
SFC52 is called with SEND = 1, the diagnostic message is written to the send buffer and
automatically sent to the station or stations logged on at the CPU.
If it is not possible to send messages (for example, because no display device is logged on or
because the send buffer is full) the user-defined diagnostic event is still entered in the diagnostic
buffer.
Generating a Message with Acknowledgement
If you acknowledge a user defined diagnostic event and want to record the acknowledgement,
proceed as follows:
• When the event enters the event state, write 1 to a variable of the type BOOL, when the event
leaves the event state write 0 to the variable.
• You can then monitor this variable using SFB33 ALARM.