EasyManua.ls Logo

SATO s86ex - Calculation Example of CRC

SATO s86ex
452 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
422
7.4 Calculation Example of CRC
A part of CRC calculation procedures when sending print speed set <CS> is shown below as an example.
The send data is STX <A> <CS>2 <Z> ETX. In HEX, the above will be 02 1B 41 1B 43 53 32 1B 5A 03. The underlined part is the
calculation range of CRC. Generating function is described as 1010 0000 0000 0001 in BIN. 1B is the first calculation target and
it is described as 0001 1011 in BIN. Initial value of CRC is set to "0".
(1) Take exclusive-OR of CRC and target data
(1B), and assign its result to CRC.
0000 0000 0000 0000 (CRC)
XOR) 0000 0000 0001 1011 (1B)
CRC = 0000 0000 0001 1011
(1-1) Take AND of CRC and 0001, and
assign its result to A. Shift CRC 1 bit
to the right and assign it to CRC.
A = 1
CRC = 0000 0000 0000 1101
(1-2) If A = 1, take exclusive-OR of CRC
and generating polynomial, and
assign its result to CRC. If A = 0, no
calculation is made.
0000 0000 0000 1101 (CRC)
XOR) 1010 0000 0000 0001 (polynomial)
CRC = 1010 0000 0000 1100
(2-1) Perform the same calculations as
(1-1). And then, perform calculations
of (1-1) and (1-2) for 7 times (8 bit in
total).
A = 0
CRC = 0101 0000 0000 0110
(2-2) Perform the same calculations as
(1-2). A = 0; therefore, leave CRC as
it is.
CRC = 0101 0000 0000 0110
(3-1) Perform the same calculations as
(1-1).
A = 0
CRC = 0010 1000 0000 0011
(3-2) Perform the same calculations as
(1-2).
CRC = 0010 1000 0000 0011
(4-1) Perform the same calculations as
(1-1).
A = 1
CRC = 0001 0100 0000 0001
(4-2) Perform the same calculations as
(1-2).
0001 0100 0000 0001 (CRC)
XOR) 1010 0000 0000 0001 (polynomial)
CRC = 1011 0100 0000 0000
(5-1) Perform the same calculations as
(1-1).
A = 0
CRC = 0101 1010 0000 0000
(5-2) Perform the same calculations as
(1-2).
CRC = 0101 1010 0000 0000
(6-1) Perform the same calculations as
(1-1).
A = 0
CRC = 0010 1101 0000 0000
(6-2) Perform the same calculations as
(1-2).
CRC = 0010 1101 0000 0000
(7-1) Perform the same calculations as
(1-1).
A = 0
CRC = 0001 0110 1000 0000
(7-2) Perform the same calculations as
(1-2).
CRC = 0001 0110 1000 0000
(8-1) Perform the same calculations as
(1-1).
A = 0
CRC = 0000 1011 0100 0000
(8-2) Perform the same calculations as
(1-2).
CRC = 0000 1011 0100 0000
Calculation of CRC up to 1B has
completed. In the same manner, perform
calculations of the next target data 41, and
continue calculating up to 03. In this case,
it will be EC 5E.
Calculation result up to 03
CRC = 1110 1100 0101 1110

Table of Contents

Other manuals for SATO s86ex

Related product manuals