7 Programming FCs (Functions) and FBs for S7 Ethernet CPs
A-204
S7-CPs for Industrial Ethernet Configuring and Commissioning
Release 01/2007
C79000-G8976-C182-07
Case b: Sequence with newer CP types (S7-300 only!)
When the FC is called, the user program prepares the buffer for the received
data and instructs the CP to enter the received data there.
In contrast to case a, the protocol used here to transfer the data to the receive
buffer requires the FC to be called again for each data segment (240 bytes of
user data).
Depending on the length of the user data, you must therefore continue to call
the FC until transfer of the entire data record is indicated by the parameter NDR
= 1.
The status code in the output parameters NDR, ERROR, and STATUS is
updated in each block call and can be evaluated.
Accept / evaluate
received data “A”
User program (CPU cycle) Ethernet CP Communications Partner
Job completed without error
1)
AG_RECV
AG_RECV
AG_RECV
No data available yet.
1)
Job completed without error
1)
AG_RECV
AG_RECV
Transfer
of ’A’ (e.g. 520
bytes)
active over
Ethernet
Transfer
of ’A’ (e.g. 240
bytes)
active over
Ethernet
Transfer
“C”
active over
Ethernet
Legend:
1)
Parameter transfer NDR, ERROR, STATUS
Time Time Time
Accept / evaluate
received data “B”
.
.
.
Data record A is
entered segment by
segment in the
buffer.
No data available yet.
1)
AG_RECV
Data record B is
entered in the
buffer.
Data record C is
entered segment by
segment in the
buffer.
No data available yet.
1)
FC6 AG_RECV / FC60 AG_LRECV - continued