Activation, Start-Up Program And Cyclic Program - Siemens SIMATIC CP 340 User Manual

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

Advertisement

Programming Example for Standard Function Blocks

9.7 Activation, Start-Up Program and Cyclic Program

9.7
Activation, Start-Up Program and Cyclic Program
Activation, startup program
The startup program is located in OB 100.
At startup, only the logical base address of the CP 340 is entered in the MW BGADR
(MW 21).
Cyclic program
The cyclic program is located in OB 1.
At the beginning of the program, the inputs used are first mapped onto bit memories, which
are then used during the rest of the program. At the end of the program, the control bit
memories set are transferred to the outputs and displayed.
In the example, the standard function blocks P_RCV (FB 2) and P_SEND (FB 3) work with
functions FC 11 and FC 12, and with data blocks DB 2 and DB 3 as instance DBs, and
DB 10 and DB 20 as send and receive DBs respectively.
The standard function block P_PRINT (FB 4) works with FC 13, with DB 4 as the instance
DB, and with DB 30 to DB 35 as data DBs.
The standard functions V24_STAT (FC 5) and V24_SET (FC 6) work with FC 14.
Cyclic processing is organized in FC 10.
In the example, the standard function blocks are parameterized partly with constants and
partly with symbolically addressed actual addresses.
Description of "point-to-point communication"
For "point-to-point communication", the input I 0.0 must be showing the signal "1" and the
input I 0.1 must be showing the signal "0". You can use inputs I 1.0 and I 1.1 to select one of
two SEND jobs. Job 1 sends the data of DB 10 from DBB 2 to DBB 11, while job 2 sends it
from DBB 14 to DBB 113.
The data is sent to the communication partner when there is a signal change from "0" to "1"
at input I 0.6 (SEND REQ).
For data to be received, the receive enable (EN_R parameter in block P_RCV), input I 0.7,
must have the signal state "1".
If receipt of job 1 has been enabled (I 1.2 = signal "1"), this data is stored in DB 20 as of
DBB 0. If job 2 has been enabled (I 1.3 = signal "1"), the data is stored in DB 20 as of
DBB 50.
If the signal state is "1" at inputs I 0.2 and I 0.3, a RESET SEND or RESET RCV can be sent
to the CP 340. If the signal state is statically "1", the sending or receipt of data has been
deactivated.
156
PtP coupling and configuration of CP 340
Manual, 04/2011, A5E00369892-03

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents