Receiving Data With Fb P_Rcv_Rk (Passive Request) - Siemens Simatic S7-300 CP 341 User Manual

Point-to-point communication, installation and parameter assignment
Table of Contents

Advertisement

6.4.2

Receiving Data with FB P_RCV_RK (Passive Request)

The FB P_RCV_RK transmits data from the CP 341 to an S7 data area. For purposes of
data transmission, the FB P_RCV_RK is called cyclically or, alternatively, statically in a time-
driven program (without conditions).
A (static) signal state "1" at the EN_R parameter enables a check to determine whether data
can be read from the CP 341. An active transmission can be canceled with signal state "0" at
the EN_R parameter. The canceled 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.
The LADDR parameter specifies the address of the CP 341 to be addressed.
If the communication partner specifies the destination "DB", the data is placed in the data
area specified in the RK 512 message frame header. The parameters (L_...) show the user
the destination area type (L_TYP), the destination data block number (L_NO, only relevant
for L_TYP = DB), the offset in the destination area (L_OFFSET), and the length (LEN) of the
transmitted data. If the partner specifies the destination "DX", the data is placed in the data
block (DB) specified by the DB_NO and DBB_NO parameters.
If the function block recognizes signal state "1" at the R parameter, the current transmission
request is canceled and the FB P_RCV_RK is placed in its initial state. Receiving is disabled
as long as the signal state at the R parameter is "1".
The NDR output shows "request completed without errors/data accepted" (all data read).
The L_TYP, L_NO, and L_OFFSET parameters indicate for the duration of one cycle where
the data are stored. In addition, the L_CF_BYT and L_CF_BIT parameters and length LEN of
the respective request are indicated for one cycle.
Error display at the FB P_RCV_RK
ERROR indicates whether an error has occurred. If an event has occurred, the
corresponding event number is displayed in STATUS. If no error has occurred, STATUS has
the value 0. NDR and ERROR/STATUS are also output in response to a RESET of the FB
P_RCV_RK (LEN parameter == 16#00). The binary result BR is reset after an error has
occurred. If the block has been completed without errors, the binary result has the status "1".
Note
The P_RCV_RK function block does not have a parameter check. If the parameter
assignment is incorrect, the CPU can go to STOP mode.
Use of interprocessor communication flags
Prior to data receipt, the interprocessor communication flags specified in the RK 512
message frame header are checked. The data is not transmitted unless the value of the
interprocessor communication flag is "0". When transmission is complete, the function block
sets the interprocessor communication flag to "1" and the interprocessor communication flag
(NDR) is output for one cycle at the function block.
The user program can evaluate the interprocessor communication flag in order to find out if
the transmitted data can be processed. As soon as the data have been processed, the user
must reset the interprocessor communication flag to "0". The communication partner can
now issue a SEND request again.
CP 341 Point-to-Point Communication, Installation and Parameter Assignment
Manual, 09/2008, A5E02191071-01
www.gkbpx.com
6.4 Using the Function Blocks with the RK 512 Computer Connection
该文档是极速PDF编辑器生成,
如果想去掉该提示,请访问并下载:
http://www.jisupdfeditor.com/
Communication via Function Blocks
147

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents