Activation, Start-Up Program And Cyclic Program - Siemens Simatic S7-300 CP 341 User Manual

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

Advertisement

Programming Example for Standard Function Blocks

9.6 Activation, Start-Up Program and Cyclic Program

9.6
Activation, Start-Up Program and Cyclic Program
Activation, start-up program
The start-up program is located in OB 100.
The control bits and the counters are reset in the start-up procedure
Cyclic program
The cyclic program is in OB 1.
In the example, the function blocks 7 P_RCV_RK FB and 8 P_SND_RK FB work with the
functions FC 21 and FC 22 and with data blocks DB 21 and DB 22 as instance DBs and DB
42 and DB 43 as send and receive DBs.
The functions FC 5 V24_STAT and FC 6 V24_SET work with the function FC 14.
In the example the function blocks are assigned parameters partly via constants and partly
via symbolically addressed actual operands.
Description, "CP341 Protocol 3964", "CP341 Protocol RK512"
Data is transferred from the CP 341 in slot 4 to the CP 341 in slot 5. If you are using some
other communication partner, the FC 22 call (RECEIVE) is omitted.
Description of FC 21 (SEND)
Program section "Generate edge P_SND_REQ":
The P_SND_RK is initially executed once with P_SND_RK REQ=0. P_SND_RK REQ is then
set to 1. If a signal state change from 0 to 1 is detected at the P_SND_RK REQ control
parameter, the P_SND_RK request is started.
If P_SND_RK DONE=1 or P_SND_RK_ERROR=1, P_SND_RK REQ is reset to 0.
Program section "P_SND_RK DONE=1":
If a transfer has been successful, the P_SND_RK DONE parameter is set to 1 at the
parameter output of P_SND_RK. To distinguish between consecutive transfers, a send
counter (P_SND_RK COUNTER_OK) is included in data word 0 of source data block DB 42.
Program section "P_SND_RK ERROR=1":
If P_SND_RK is executed with P_SND_RK ERROR=1, the error counter
P_SND_RK COUNTER_ERR is incremented in data word 2. In addition,
P_SND_RK STATUS is copied, since it will be overwritten with 0 during the next cycle,
making it impossible to read it out.
210
www.gkbpx.com
CP 341 Point-to-Point Communication, Installation and Parameter Assignment
该文档是极速PDF编辑器生成,
如果想去掉该提示,请访问并下载:
http://www.jisupdfeditor.com/
Manual, 09/2008, A5E02191071-01

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents