beautypg.com

Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 423

background image

8 Application Instructions API 100-149

DVP-PLC Application Manual

8-21

The operation of CRC checksum:

Step 1: Make the 16-bit register (CRC register) = FFFFH

Step 2: Exclusive OR the first 8-bit byte message instruction and the low-bit 16-bit CRC register. Store the

result in CRC register.

Step 3: Shift the CRC register one bit to the right and fill 0 in the higher bit.

Step 4: Check the value that shifts to the right. If it is 0, store the new value from Step 3 into the CRC register,

otherwise, Exclusive OR A001H and the CRC register, and store the result in the CRC register.

Step 5: Repeat Step 3 ~ 4 and finish calculating the 8 bits.

Step 6: Repeat Steps 2 ~ 5 for obtaining the next 8-bit message instruction until all the message instructions

are calculated. In the end, the obtained CRC register value is the CRC checksum. Be aware that

CRC checksum should be placed in the checksum of the message instruction.