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
155
6.4.4
Fetching Data with P_SND_RK FB (Active Request)
Principle of operation of the FB P_SND_RK function block The FB P_SND_RK function block
can be used with parameter setting SF = F to fetch data from a remote communication
partner and place it in an S7 data area of your programmable controller.
Note
If you fetch data from a CP 341, you must always program a P_RCV_RK function block on
the CP 341.
The data transmission is initiated by a positive edge at the REQ input. A data transmission
operation can run over several calls (program cycles), depending on the amount of data
involved (LEN).
The LADDR parameter specifies the address of the CP 341 to be addressed.
The communication partner from which you want to fetch data is specified by the CPU
number (R_CPU_NO, relevant only for multiprocessor communication). The following data
types (R_TYP) are permissible sources for the data to be fetched: data blocks, extended
data blocks, bit memory, inputs, outputs, counters and timers. The source is fully specified
by the data type (R_TYP), the data block number (R_NO, relevant only for data blocks and
expanded data blocks) and the offset (R_OFFSET) of the first data byte to be sent in this
area.
The interprocessor communication flag byte and bit on the partner CPU are specified in
R_CF_BYT and R_CF_BIT.
The only permissible destination areas are data blocks (DB). The destination is fully
specified by the data block number (DB_NO) and the offset (DBB_NO) of the first data byte
to be written.
The FB P_SND_RK function block can be called cyclically when the signal state at the R
parameter input is "1". This cancels the transmission from the CP 341 and places the
FB P_SND_RK in its initial state. If the signal state at the R input remains static at "1", this
means that fetching is deactivated.
Error display at the FB P_SND_RK
The DONE output shows "request completed without errors". 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, the value of STATUS is 0. DONE and ERROR/STATUS
are also output in response to a RESET of FB P_SND_RK. 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 FB P_SND_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