EasyManua.ls Logo

Delta DTM Series - Page 77

Delta DTM Series
102 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...
Chapter 7: Appendix
DTM temperature controller operating manual
7-13
CRC highest bit
H15
CRC check code:
RTU uses CRC to perform error checking. The following is an explanation of calculation steps and example
program:
Step 1: Enter the 16-bit register of content consisting of FFFFH, and term it the "CRC" register.
Step 2: Perform the Exclusive OR operation on the first byte of the command information and the least byte
of the 16-bit CRC register, and return results to the CRC register.
Step 3: Examined the least significant bit (LSB) in the CRC register; if this bit is 0, move to the bit to its right;
If this bit is 1, after the CRC register value is moved to the right one bit, perform Exclusive OR
operation on A001H.
Step 4: Return to step 3, and perform step 3 8 times before proceeding to step 5.
Step 5: Repeat steps 2-4 on the next byte in the command information, until all bytes have been completely
processed. At this time, the content of the CRC register will be the error detection value.
Example CRC program:
unsigned int reg_crc = 0xffff;
i = 0;
while (length--)
{ reg_crc ^= RTUData[i];
i ++;
for (j = 0; j < 8; j++)
{ if (reg_crc & 0x01) reg_crc = (reg_crc >> 1) ^ 0xA001;
else reg_crc = reg_crc >> 1;
}
}
return(reg_crc);

Table of Contents

Related product manuals