S7 Receives Data From A Communication Partner - Siemens SIMATIC CP 340 User Manual

Ptp coupling and configuration
Hide thumbs Also See for SIMATIC CP 340:
Table of Contents

Advertisement

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)").
PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03
6.3 Using the function blocks for connecting to a communications processor
Communication using function blocks
109

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents