Panasonic FP Series Programming Manual page 414

Hide thumbs Also See for FP Series:
Table of Contents

Advertisement

Error flags
No.
IEC address
%MX0.900.7
R9007
%MX0.900.8
R9008
In this example the function has been programmed in ladder diagram (LD) and structured text
Example
(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:
ASCII-HEX-Code
%
ASCII-BIN-Code
ASCII-HEX-Code
0
ASCII-BIN-Code
ASCII-HEX-Code
1
ASCII-BIN-Code
ASCII-HEX-Code
0
ASCII-BIN-Code
Block Check Code (BCC)
ASCII-HEX-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
%
0
Exclusive OR result
Set
permanently
for an instant
2
5
Exclusive ORing
0 0 1
0 0 1 0
1
3
0
0 0 1
1 0 0 0
0
3
1
0 0 1
1 0 0 0
1
.
.
etc.
.
3
0
0 0 1
1 0 0 0
0
calculation
This calculation result (16#1D)
1
D
is stored in d.
0 0 0
1 1 1 0
1
ASCII BIN code
00100101
00110000
00010101
If
 the number of specified bytes for the
target data exceeds the limit of the
specified data area.
Exclusive ORing
etc.
Exclusive ORing
Arithmetic instructions
413

Advertisement

Table of Contents
loading

Table of Contents