Technical data

Table Of Contents
SFCs for Diagnostics
System Software for S7-300/400 System and Standard Functions - Volume 1/2
13-18
A5E00709327-01
13.6 Diagnosis of the Current Connection Status with
SFC 87 "C_DIAG"
Description
You can use SFC 87 "C_DIAG" to determine the current status of all S7
connections and of all fault-tolerant S7 connections (or their partial connection).
Suitable evaluation of these connection data lets you recognize failures of S7
connections as well as of current S7 connections and report these, should the
occasion arise, to an operating and visualization system. Monitored connections
can be a connection between automation systems as well as the connection of an
automation system to an operating and visualization system.
Note
A change in the operating state of the CPU: RUN -> STOP ->RUN, does not affect
the state of the configured connections. Exception: When an H station changes
from the Redundant system state to the Stop system state, the partial connections
of all fault-tolerant connections to the standby CPU will be disconnected.
After a power failure, on the other hand, all configured connections will be
reestablished and this changes the connection status.
The first time SFC 87 is called during or after startup, the connection information
will differ, depending on whether the last operating mode of the CPU was STOP or
POWER OFF.
Operating Mode
The SFC 87 "C_DIAG" is an asynchronous SFC operation, that is to say,
processing can be extended over multiple SFC calls.
You start the job by calling the SFC 87 with REQ=1.
If it was possible to execute the job immediately, the SFC returns the value 0 in the
output parameter BUSY. If BUSY is 1 the job is still active.
When Do You Call the SFC 87?
To recognize the failure of S7 connections and current S7 connections, call the
SFC87 in a cyclic interrupt OB that is started, for example, every 10 seconds by the
operating system.
Since the status of a connection normally does not change, it is appropriate to copy
the connection data to the user program with these cyclic calls only if they have
changed since their last call (call with MODE=B#16#02, see below).