Technical data

Table Of Contents
SFCs for Diagnostics
System Software for S7-300/400 System and Standard Functions - Volume 1/2
13-10
A5E00709327-01
13.4 Writing a User-Defined Diagnostic Event to the
Diagnostic Buffer with SFC 52 "WR_USMSG"
Description
With SFC 52 "WR_USMSG" (write user element in diagnostic buffer), you write a
user-defined diagnostic event to the diagnostic buffer. You can also send the
corresponding diagnostic message to all stations logged on for this purpose (by
setting the input parameter SEND = TRUE). If an error occurs, the output
parameter RET_VAL provides the error information.
Sending a User-Defined Diagnostic Message
SFC 52 writes a user-defined diagnostic event to the diagnostic buffer. You can
then also send the corresponding diagnostic message to any station logged on for
this purpose (by setting the input parameter SEND = TRUE). The user-defined
diagnostic message is then written to the send buffer and automatically sent to the
logged on stations.
You can check whether the sending of user-defined diagnostic messages is
currently possible. To do this, call SFC 51 "RDSYSST" with the parameters
SSL_ID = W#16#0132 and INDEX = W#16#0005. The fourth word of the data
record obtained indicates whether sending a user element is currently possible (1)
or not (0).
CPU
Send buffer
Diagn. buffer
12
. .
. .
SFC52
SEND=
TRUE
Station
e.g. PG, OP
Sending is
asynchronous
to user program
Send Buffer Full
The diagnostic message can only be entered in the send buffer if the send buffer is
not full. The number of entries that can be made in the send buffer depends on the
type of CPU you are using.
If the send buffer is full, then:
The diagnostic event is nevertheless entered in the diagnostic buffer,
The parameter RET_VAL indicates that the send buffer is full
(RET_VAL = W#16#8092).