Programming Example – Standard Blocks
9-8
Point-to-point connection CP 440 Installation and Parameter Assignment
A5E00057742-02
9.6
Activation, Startup Program and Cyclic Program
Activation, Startup Program
The startup program is located in the OB 100.
At startup the control bits and the counter are reset.
9.6.1
“CP440 SEND RECV” Program Example
Cyclic Program
The cyclic program is in OB 1.
In the example, the function blocks FB 9 “RECV_440” and FB 10 “SEND_440”
work together with the functions FC 21 and FC 22 as well as with the data blocks
DB 21 and DB 22 as instance DBs and DB 42 and DB 43 as send or receive DBs.
In the example, the function blocks are parameterized partly via constants and
partly via symbolically addressed actual parameters.
Data Transmission
Data transmission takes place from the CP 440 on slot 4 to the CP 440 on slot 5. If
you work with other communication partners, the FC 22 (RECEIVE) is not called.
Description of the FC 21 (SEND)
The “Generate edge P_SEND_REQ” program section:
SEND_440 is run through once at the start with SEND_REQ=0.
SEND_REQ is then set to 1. The SEND_440 job is started when a signal state
change from “0” to “1” is detected at the SEND_REQ control parameter.
When SEND_DONE=1 or SEND_ERROR=1, SEND_REQ is reset to 0.
“SEND_DONE=1” program section:
If the transfer is successful, SEND_DONE is set to “1” at the parameter output of
SEND_440.
To distinguish between consecutive transfers, a send counter
(SEND_COUNTER_OK) is included in data word 0 of the source block DB 42.
Содержание SIMATIC CP 440
Страница 10: ...Contents x Point to point connection CP 440 Installation and Parameter Assignment A5E00057742 02 ...
Страница 134: ...Diagnostics with the CP 440 8 16 Point to point connection CP 440 Installation and Parameter Assignment A5E00057742 02 ...
Страница 164: ...Accessories and Order Numbers D 2 Point to point connection CP 440 Installation and Parameter Assignment A5E00057742 02 ...