Omron e5ck User Manual page 132

Digital controller (programmable type)
Hide thumbs Also See for e5ck:
Table of Contents

Advertisement

CHAPTER 6 USING THE COMMUNICATIONS FUNCTION
How to Calculate
FCS
F ASCII ³ Hex
ASCII
Hex
F Exclusive OR
F Conversion to ASCII code at each digit of the calculation result and setting to FCS
ASCII
Hex
F Completed frame (with appended terminator)
ASCII
Hex
6–6
• End code
Sets the communication results. For details on the types and meanings
of end codes, see 6.5 How to Read Communications Error Information
(page 6 12).
• FCS (Frame Check Sequence)
Set the frame check results from the start character to the data area. For
details on the frame check, see 6.6 Program Example (page 6 18).
• *" CR (Carriage Return) code"
Indicates the end (terminator) of the command or response block.
Calculate the exclusive OR from the start character to the data section. The follow
ing describes an example of how to calculate the FCS for @001000000".
(1) Convert the ASCII codes of each character to Hexadecimal 40H, 30H, ...,
30H".
(2) Calculate the exclusive OR of all characters.
(3) Convert to ASCII code. (³ 4B")
(4) Set the result as FCS.
@
0
0
1
0
40H
30H
30H
31H
30H
40H30H30H31H30H30H30H30H30H30H=71H
@
0
0
1
0
40H
30H
30H
31H
30H
@
0
0
1
0
40H
30H
30H
31H
30H
0
0
0
0
0
30H
30H
30H
30H
30H
0
0
0
0
0
30H
30H
30H
30H
30H
0
0
0
0
0
30H
30H
30H
30H
30H
7
1
37H
31H
FCS
7
1
*
CR
37H
31H
2AH 0DH
FCS
Terminator

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents