13
Command/Response Formats Section 2-2
FCS Calculations The PLC calculates the FCS (Frame Check Sequence) value for each com-
mand frame it receives, and it checks for errors by comparing that value with
the FCS value sent with the command frame. The host computer must calcu-
late the FCS value when sending a command frame.
Also, when checking for errors in response frames, the host computer must
calculate the FCS value for each response frame it receives and compare that
value to the FCS value sent in the response frame.
Note The FCS is an 8-bit value converted into two ASCII characters. The 8-bit
value is the result of an exclusive OR sequentially performed between each
character in a transmission, from the first character in the frame to the last
character of the text in that frame. Non-ASCII data, however, may sometimes
be sent in the text data. If the data length is 7 bits, the leftmost bit of each
character is masked before the FCS is calculated.
Unit number
Header code
Text
FCS
Terminator
FCS calculation range
ASCII
Code
Calculation result
(See note.)
The value is converted to hexadecimal
and handled as ASCII.
@ 40 0100 0000
EOR
1 31 0011 0001
EOR
0 30 0011 0000
EOR
R 52 0101 0010
1 31 0011 0001
0100 0010
4 Hex
2 Hex
•
•
•