Programming Example For Data Transmission Via Cyclic I/O - Siemens SIMATIC S5 Manual

Interface of the programmable controller
Hide thumbs Also See for SIMATIC S5:
Table of Contents

Advertisement

Data Transmission Using Cyclic I/O
7.4

Programming Example for Data Transmission via Cyclic I/O

This section explains the structure of the control programs for cyclic I/O.
The data are exchanged cyclically without request to transmit or request to receive: The data
exchange is controlled within the control program only by the status byte.
Example:
An S5-95U (ZP master) is to supply data to three S5-95Us (ZP slaves, passive stations) and to
receive data from them.
The control program in FB202 for ZP master is structured as illustrated below.
yes
yes
Call-up of FB L2-RECEIVE; ZP slave life list is fetched.
no
Evaluate ZP slave life list entry
End
Cyclic Program for Station 1 (ZP Master)
In FB202, FB L2-RECEIVE scans the ZP slave life list for updated entries.
FB202 is called up from OB1.
The ZP slave life list is located in DB202. ZP DB for the ZP master is DB100. The status byte for
the ZP slave life list is flag byte FY101. The status byte for the ZP master is flag byte FY100.
Proceed as follows:
Assign parameters for programmable controller 1 as the ZP master as described in section 7.2.
Program the individual blocks as described in the following section.
Transfer blocks OB1, FB202, DB202, and DB100 to programmable controller 1.
OB1 for PLC 2 (ZP Slave)
NETZWERK 1
0000
:
0002
: JU
0004
Name : ZP-ST-LI
0006
SL40 : F 4.0
0008
SL41 : F 4.1
000A
SL42 : F 4.2
000C
FEHL : F 4.3
000E
: BE
7-12
Are ZP data in ZP DB and ZP slave life list valid (STB-ZPMS bit 4)?
"RECEIVE viable"? (ZP slave life list, STB bit 0=1?)
Did a PAFE or STB error occur as ZP slave
life list was fetched?
0000
FB 202
Station error bit, is set if PLC 2 (TLN 40) failed
Station error bit, is set if PLC 3 (TLN 41) failed
Station error bit, is set if PLC 4 (TLN 42) failed
Error when reading out ZP slave life list, indicated in
STB/PAFE
Reset ZP
station error
bits
yes
Set station error bit
Explanation
S5-95U, SINEC L2
no
no
EWA 4NEB 812 6112-02

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Sinec l2S5-95u

Table of Contents