EasyManua.ls Logo

Siemens Simatic S7-400 - CP440 1 CYC Program Example; CP440 ASCII BCC Program Example

Siemens Simatic S7-400
140 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
9.6.2 "CP440 1 CYC" Program Example
This example is set up identically to the example "CP440 SEND RECV". However, the FC 21 has
been changed to allow a SEND job to be processed cyclically.
Description of FC 21 (SEND)
The procedure for processing a SEND job cyclically is as follows:
At each block call, SEND_440 is run through with SEND_REQ=0. If neither SEND_DONE nor
SEND_ERROR are present, the block is terminated.
If SEND_DONE is present, SEND_440 is run through again with SEND_REQ=1.
If SEND_ERROR is present, SEND_440 is run through with SEND_REQ=0 and then with
SEND_REQ=1.
To ensure that SEND_440 can be run through with SEND_REQ=1 in the very 󹪝rst pass, the
SEND_STARTUP_ENDED bit is also evaluated in the program section "Check if SEND_DONE or
SEND_ERROR or not 󹪝rst Cycle". This bit is at 0 during the 󹪝rst pass and is then 󹪝xed at 1.
See also
"CP440 SEND RECV" Program Example (Page 111)
9.6.3 "CP440 ASCII BCC" Program Example
Structure of the Program Example
This program example only makes sense for the ASCII driver.
This example is set up identically to the "CP440 SEND RECV" example but also contains the
following:
A block check sum is generated in the send section by calling FC 23 (GEN BCC)
The block check sum is checked in the receive section with the call of FC 24 (CHK BCC)
Description of the FC 23 (GEN BCC)
The "DB_NO" input parameter speci󹪝es the DB in which the data to be sent is stored. The "LEN"
input parameter speci󹪝es the length of the data to be sent. The last two bytes should be reserved
for the block check (stored as an ASCII value).
The block check is executed by means of an XOR logical operation of all the bytes to be sent (LEN
-2). The XOR logical operation occurs in the "LOOP". The relevant byte is loaded with the L DBB
[#d_loop_akt] command. The "#d_loop_akt" o󹪜set must be speci󹪝ed as a bit o󹪜set. After "LOOP"
is executed, the block check is in the low byte of the "#w_bcc_value" variable. The block check
is then encoded in two ASCII characters as described in the example below.
Example
Programming Example for Standard Function Blocks
9.6 Activation, Startup Program and Cyclic Program
Point-to-point connection CP 440 Installation and Parameter Assignment
Equipment Manual, 03/2022, A5E00057742-AE 113

Table of Contents

Other manuals for Siemens Simatic S7-400

Related product manuals