Communication using function blocks
6.3 Using the function blocks for connecting to a communications processor
PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03
109
6.3.2
S7 receives data from a communication partner
receiving data
The P_RCV FB transmits data from the CP 340 to an S7 data area specified by the
parameters DB_NO, DBB_NO and LEN. The P_RCV FB is called statically (without
conditions) for data transmission in the cycle or alternatively in a time-controlled program.
A (static) signal state "1" at the EN_R parameter enables a check to determine whether data
can be read from the CP 340. An active transmission event can be canceled with signal state
"0" at the EN_R parameter. The aborted receive request is terminated with an error message
(STATUS output). Receiving is disabled as long as the signal state at the EN_R parameter is
"0". A data transmission operation can run over several calls (program cycles), depending on
the amount of data involved.
If the function block detects the signal state "1" at the R parameter, the current send job is
aborted and the P_RCV FB is set to the initial state. Receiving is disabled as long as the
signal state at the R parameter is "1". If the signal state returns to "0", the canceled message
frame is received again from the beginning.
The LADDR parameter defines the CP 340 to be addressed.
The NDR output shows "Request completed without errors/data accepted" (all data read).
ERROR indicates whether an error has occurred. If an error has occurred, the corresponding
event number is displayed in STATUS (see Chapter "Diagnostics Messages of the Function
Blocks P_SEND, P_RCV and P_PRINT (Page 134)"). If there were no errors, STATUS has
the value "0". NDR and ERROR/STATUS are also output when the P_RCV FB is reset
(parameter LEN == 16#00). In the event of an error, the binary result BR is reset. If the block
is terminated without errors, the binary result has the status "1".
Note
The function block P_RCV does not have a parameter check, i.e. if there are invalid
parameters, the CPU can branch to STOP mode.
Before the CP 340 can receive a request after the CPU has changed from STOP to RUN
mode, the CP-CPU start-up mechanism of the P_RVC function block must be completed
(see Chapter "General Information on Program Processing (Page 124)").
Содержание SIMATIC CP 340
Страница 6: ...Preface PtP coupling and configuration of CP 340 6 Manual 04 2011 A5E00369892 03 ...
Страница 10: ...Table of contents PtP coupling and configuration of CP 340 10 Manual 04 2011 A5E00369892 03 ...
Страница 186: ...Accessories and Order Numbers PtP coupling and configuration of CP 340 186 Manual 04 2011 A5E00369892 03 ...
Страница 190: ...Literature on SIMATIC S7 PtP coupling and configuration of CP 340 190 Manual 04 2011 A5E00369892 03 ...
Страница 200: ...Index PtP coupling and configuration of CP 340 200 Manual 04 2011 A5E00369892 03 ...