Arithmetic instructions
413
Part III FP Instructions
No. IEC address Set If
R9007 %MX0.900.7 permanently
R9008 %MX0.900.8 for an instant
the number of specified bytes for the
target data exceeds the limit of the
specified data area.
001
2
0010
5
1
000
1
1110
D
1
%
001
3
1000
0
0
0
001
3
1000
1
1
1
001
3
1000
0
0
0
.
.
.
Exclusive ORing
etc.
etc.
This calculation result (16#1D)
is stored in d.
Block Check Code (BCC)
calculation
Exclusive ORing
Exclusive ORing
ASCII-HEX-Code
ASCII-BIN-Code
ASCII-HEX-Code
ASCII-HEX-Code
ASCII-HEX-Code
ASCII-HEX-Code
ASCII-BIN-Code
ASCII-BIN-Code
ASCII-BIN-Code
ASCII-BIN-Code
The ASCII BIN code bits of the first two characters are compared with each other to yield an
8-character exclusive OR operation result:
Sign for comparison ASCII BIN code
% 00100101
0 00110000
Exclusive OR result 00010101
Error flags
Example
In this example the function has been programmed in ladder diagram (LD) and structured text
(ST).The same POU header is used for all programming languages.
POU header
All input and output variables used for programming this function have been declared in the POU
header.
Body
A block check code is performed on the value entered for the variable ASCII_String when Start
becomes TRUE. The exclusive OR operation, which is more suitable when large amounts of data
are transmitted, has been chosen for the BCC method.
How the BCC is calculated using the exclusive OR operation: