In the SIMATIC S5-CPU, the active FETCH and WRITE functions are triggered
independently of each other every second.
OB21/OB22 (STARTUP OBs)
The following functions are implemented in the startup of the SIMATIC S5-CPU:
• The set interface (interface no. = 0) of the CP1430 TCP is initialized and
synchronized via the handling block "HTB_Synchron” (FB 249).
• An internal startup bit (M 199.0) and the initial count value are reset.
• After each restart, a deletion identifier (sample = "A1A1”) is set in the FETCH
data area (DB113). This deletion identifier has the effect that a count value in
the WRITE data area (DB 114) is reset.
OB1 (cyclic OB)
The following functions are processed in the cyclic OB1 of the SIMATIC S5-CPU:
• Call of the user communication block FET_WRI (FB 40) containing the active
FETCH and WRITE functions. This example scenario 1 is started by setting an
enable bit (M 130.5).
• Call of the handling blocks SEND ALL and RECEIVE ALL for data transfer to
the CP1430 TCP.
FB40 (FET_WRI)
The function block FB 40 contains the active FETCH and WRITE communication
functions in which a simple simulation program demonstrates the exchange of
data.
• A restart of the communication is initiated via the startup bit M 199.0
(OB21/22).
• Every second (FB99/M 152.0), a count value is written to the target DB of the
S7-1500 CPU via a WRITE connection.
• In the S7-1500, this count value is checked, incremented by +1, requested
again from the S7-1500 with the next FETCH trigger in the S5-CPU and then
stored in the FETCH_DB (DB 114).
• After the value has been checked, it is incremented again by +1 and written to
the S7-1500 via the WRITE connection in a new storage cycle.
• A simple error analysis regarding the connection status is done by storing the
indicator words and parameter error bytes.
HTB_FETCH block: ANZW: MW70 PAFE: MB74
HTB_WRITE block: ANZW: MW75 PAFE: MB79