Communication via Function Blocks
6.4 Using the Function Blocks with the RK 512 Computer Connection
CP 341 Point-to-Point Communication, Installation and Parameter Assignment
Manual, 09/2008, A5E02191071-01
151
6.4.3
Readying Data with FB P_RCV_RK (Passive Request)
The FB P_RCV_RK function block must be called if the communication partner executes a
"Fetch data" request (FETCH request)..
The FB P_RCV_RK provides data from an S7 data area for the CP 341. 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 provided to the CP 341. An active transmission can be canceled with signal state "0"
at the EN_R parameter. The canceled request is terminated with an error message
(STATUS output). The request 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 type of source area (L_TYP), the source data block number (L_NO, relevant only when
L_TYP = DB), the offset in the source area (L_OFFSET), and the length (LEN) of the data to
be provided are determined from the first RK 512 message frame. The function block
evaluates the information from this message frame and transfers the requested data to the
CP 341. The DB_NO and DBB_NO parameters are irrelevant for the FB P_RCV_RK function
block.
The LADDR parameter specifies the address of the CP 341 to be addressed.
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. The request 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 the
location from which the data were fetched (possible data types: data blocks, input bytes,
output bytes, timers and counters). In addition, the L_CF_BYT and L_CF_BIT parameters
and length LEN of the respective request are indicated for one cycle.
Note
When the communication partner fetches timers or counters from the CP 341, the length is
limited to a maximum of 32 bytes (16 timers or counters, each consisting of 2 bytes).
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.
长沙工控帮教育科技有限公司
www.gkbpx.com