FB 225 "F_SENDS7" and FB 226 "F_RCVS7": Communication via S7
Connections
Introduction
You use the F_SENDS7 and F_RCVS7 F-application blocks for fail-safe sending and receiving data via S7
connections.
Note In S7 Distributed Safety, S7 connections are generally permitted over Industrial Ethernet only! Safety-related
communication via S7 connections is possible from and to the following CPUs: · CPU 315F-2 PN/DP (only via PN
interface of the CPU ) · CPU 317F-2 PN/DP (only via PN interface of the CPU) · CPU 416F-3 PN/DP (only via PN
interface of the CPU ) · CPU 416F-2 firmware V 4.0 or higher
Connections of F-Application Block F_SENDS7
Parameter Data Type Description Default
Inputs SEND_DB BLOCK_DB Number of F-communication DB 0
TIMEOUT TIME Monitoring time for safety-related communication in [ms] (see also Safety Engineering in
SIMATIC S7 system description) 0 ms
EN_SEND BOOL 1= Send enable 1
ID WORD Local ID of S7 connection (from NetPro) 0
R_ID DWORD Network-wide unique value for address association between F_SENDS7 and F_RCVS7 0
Outputs: ERROR BOOL 1=Communication error 0
SUBS_ON BOOL 1=Receiver outputs fail-safe values 1
STAT_RCVWORD Error code of SFB/FB URCV (SFB 9/FB 9) (For a description of error codes, refer to online
Help for SFB 9) 0
STAT_SNDWORD Error code of SFB/FB USEND (SFB 8/FB 8) (For a description of error codes, refer to online
Help for SFB 8) 0
DIAG BYTE Service information 0
Connections of F-Application Block F_RCVS7
Parameters Data type Description Default
Inputs: ACK_REI BOOL Acknowledgment for reintegration of send data following communication error 0
RCV_DB BLOCK_DB Number of the F-communication DB 0
TIMEOUT TIME Monitoring time in ms for safety-related communication (see also Safety Engineering in
SIMATIC S7 system description) 0 ms
ID WORD Local ID of the S7 connection (from NetPro) 0
R_ID DWORD Unambiguous network address correlation between F_SENDS7 and F_RCVS7 0
Outputs: ERROR BOOL 1 = communication error 0
SUBS_ON BOOL 1=Fail-safe values are output 1
ACK_REQ BOOL 1=Acknowledgment for reintegration of send data required 0
SENDMODE BOOL 1=F-CPU with F_SENDS7 in deactivated safety mode 0
STAT_RCV WORD Error code of SFB/FB URCV (SFB9/FB9) (for a description of error codes, refer to the
Online Help for SFB9) 0
STAT_SND WORD Error code of SFB/FB USEND USEND (SFB 8/FB 8) (For a description of error codes, refer
to online Help for SFB 8) 0
DIAG BYTE Service information 0
Principle of Operation
F_SENDS7 sends the send data contained in an F-communication DB to the F-communication DB of the
associated F_RCVS7 in a fail-safe manner via an S7 connection.
An F-communication DB is an F-DB for safety-related CPU-CPU communication with special properties. The
properties, creation, and editing of F-communication DBs are described in Programming Safety-Related CPU-CPU
Communication via S7 Connections.
You must specify the numbers of the F-communication DBs at inputs SEND_DB and RCV_DB of F-application
blocks F_SENDS7 and F_RCVS7.
The operating mode of the F-CPU with the F_SENDS7 is provided at output SENDMODE of F_F_RCVS7. If the F-
CPU with the F_SENDS7 is in deactivated safety mode, output SENDMODE = 1.
To reduce the bus load, you can temporarily shut down communication between the F-CPUs. To do so, supply input
EN_SEND of F_SENDS7 with "0" (default = "1"). Then, send data are no longer sent to the F-communication DB of
the associated F_RCVS7 and the receiver F_RCVS7 provides fail-safe values for this period (default F-
communication DB). If communication was already established between the partners, a communication error is
detected.
For F-CPU purposes, the local ID of the S7 connection (from connection table in NetPro) must be specified at input
ID of F_SENDS7 or F_RCVS7.
Communication between F-CPUs takes place hidden in the background by means of a special safety protocol. You
must define a communication association between an F_SENDS7 in one F-CPU and an F_RCVS7 in the other F-
CPU by assigning an odd number at the R_ID inputs of the F_SENDS7 and F_RCVS7. Associated F_SENDS7s
and F_RCVS7s receive the same value for R_ID.
Warning The value for each address association (input parameter R_ID; data type: DWORD) is user-defined;
however, it must be unique from all other safety-related communication connections in the network. The value R_ID +
1 is internally assigned and must not be used. You must supply inputs ID and R_ID with constant values when calling
the F-application block. Direct read or write access in the associated instance DB is not permitted in the safety
program!
Note A separate instance DP must be used for each call of an F SENDS7 or F_RCVS7 block. You must not call
these F-application blocks as multiple instances. The input and output parameters of F_RCVS7 must not be supplied
with local data of the F-program block. You must not use an actual parameter for an output parameter of an
F_RCVS7, if it is already being used for an input parameter of the same or another F_RCVS7 or F_RCVDP call. The
F-CPU can go to STOP if this is not observed. One of the following diagnostic events is then entered in the diagnostic
buffer of the F-CPU: · "Data corruption in the safety
program prior to output to F-I/O" · "Data corruption in the safety program prior to output to partner F-CPU" · "Safety
Program: internal CPU fault; internal error information: 404"
Startup behavior
After the sending and receiving F-systems are started up, communication must be established initially between
communication peers F_SENDS7 and F_RCVS7. Receiver F_RCVS7 provides fail-safe values for this time period
(default in its F-communication DB).
F_SENDS7 and F_RCVS7 signal this at output SUBS_ON with 1. Output SENDMODE of the F_RCVS7 has a
default of 0 and is not updated, as long as output SUBS_ON = 1.
Behavior in Event of Communication Errors
If a communication error occurs, for example, due to a test-value error (CRC) or when monitoring time TIMEOUT
expires, outputs ERROR and SUBS_ON are set to 1 at F_SENDS7 and F_RCVS7 . Receiver F_RCVS7 then
provides the fail-safe values (default in its F-communication DB). Output SENDMODE is not updated while output
SUBS_ON = 1.
The send data present in the F-communication DB of F_SENDS7 are only output again when the communication
error is no longer detected (ACK_REQ = 1) and you acknowledge with a positive edge at input ACK_REI of
F_RCVS7.
Warning For the user acknowledgement, you must interconnect the ACK_REI input with a signal generated by
the operator input. An interconnection with an automatically generated signal is not allowed.
Note that when a communication error occurs, the ERROR output (1=communication error) is set for the first time if
communication has already been established between communication peers F-SENDS7 and F_RCVS7. If
communication cannot be established after startup of the sending and receiving F-systems, check the configuration
of the safety-related CPU-CPU communication, F-SENDS7 and F_RCVS7 parameter assignment, and the bus
connection. You can also find possible causes of error by evaluating the STAT_RCV and STAT_SND outputs.
In general, always evaluate STAT_RCV and STAT_SND, since only one of the two outputs may be able to receive
error information.
If one of the DIAB bits is set at output DIAG, also check whether the length and structure of the associated F-
communication DB on the sender side match.
Time Diagram F_SENDS7 and F_RCVS7
Output DIAG
The DIAG output provides non-fail-safe information on the type of communication errors that occurred for service
purposes. You can read out this information by means of operator control and monitoring systems or, if applicable,
you can evaluate it in your standard user program. The DIAG bits are saved until acknowledgment at input
ACK_REI of the associated F_RCVS7.
Structure of DIAG
Bit No. Assignment F_SENDS7 and F_RCVS7 Possible Causes of Problems Remedies
Bit 0 Reserved - -
Bit 1 Reserved - -
Bit 2 Reserved - -
Bit 3 Reserved - -
Bit 4 Timeout detected by F_SENDS7 and F_RCVS7 Interference in bus connection to partner F-
CPU Check bus connection and ensure that no external interference sources are present.
Monitoring time setting for F-CPU and partner F-CPU is too low Check assigned monitoring
time parameter TIMEOUT at F_SENDS7 and F_RCVS7 of both F-CPUs. If necessary, set a higher value. Recompile safety
program.
CPs in STOP mode, or internal fault in CPs Switch CPs to RUN mode Check diagnostic
buffer of CPs Replace CPs, if necessary
F-CPU/partner F-CPU in STOP mode, or internal fault in F-CPU/partner F-CPU Switch F-
CPUs to RUN mode Check diagnostic buffer of F-CPUs Replace F-CPUs, if necessary
Communication was shut down with EN_SEND = 0. Enable communication again at associated
F_SENDS7 with EN_SEND = 1
S7 connection has changed, the IP address of the CP has changed, for example Recompile
the safety programs and download them to the F-CPUs.
Bit 5 Sequence numbers detected by F_SENDS7 and F_RCVS7 See description for Bit 4 See the
description of bit 4
Bit 6 CRC-error detected by F_SENDS7 and F_RCVS7 See the description of bit 4 See the
description of bit 4
Bit 7 Reserved - -
Note Access to outputs DIAG, STAT_RCV, and STAT_SND is not permitted in the safety program!
Additional Information
You will find more information about configuring and programming safety-related communication via S7
connections in the references provided under "See also."
See also
Implementing User Acknowledgment in the Safety Program of a I-Slave F-CPU
Implementing User Acknowledgment in the Safety Program of a DP Master F-CPU or IO Controller
Overview of safety-related communication
Configuring safety-related communication using S7 connections