Technical data

Example
Checking the checksum of the system program
Function block FB 111 is programmed for checking the checksum of the
system program.
FB 111 generates the checksum of the contents of all system program
memory words and compares this checksum via OB 227 with the system
program checksum stored in the system memory. If the checksums are not
identical, the FB terminates in a STOP operation.
FW 250 = checksum
FD 252 = address counter
FB111
NAME: CHECKSUM
:
:
:L KH 0000
:T FW 250 clear checksum flags
:T FD 252 clear address counter
:
M001 :JU OB 222 restart the cycle monitoring time
:L FD 252 load the address of the memory cell to be read
:JU OB 226 read word
:L FW 250 load the checksum flags
:+F add
:T FW 250 store the checksum flags
:
:L FD 252 increment the address counter
:L KF+1
:+D add double word
:T F D 252
:
:L DH 0001E000 if address counter is not equal to ’1E000H’
:>< D
:JC =M001 jump to label M001
:
:JU OB 227 read checksum if address counter equals ’1E000H’,
:
:L FW 250 load checksum flags
:!=F if equal, block end
:BEC
:
:STP if not equal, stop operation
:BE
6
OB 227: Reading the Checksum of the System Program
CPU 928B Programming Guide
C79000-B8576-C898-01
6 - 97