EasyManuals Logo

Datakom DKM-411 Applications Manual

Datakom DKM-411
16 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
Page #10 background imageLoading...
Page #10 background image
DKM-411 Modbus Application Manual V3.0 (15.01.2017)
- 10 -
Here is a procedure for generating a CRC:
1) Load a 16–bit register with FFFF hex (all 1’s). Call this the CRC register.
2) Exclusive OR the first 8bit byte of the message (the function code byte) with the loworder byte of the
16bit CRC register, putting the result in the CRC register.
3) Shift the CRC register one bit to the right (toward the LSB), zerofilling the MSB. Extract and examine
the LSB. The LSB is the least significant bit of the CRC before the shift operation.
4) If the LSB is 1: Exclusive OR the CRC register with the polynomial value A001 hex.
5) Repeat Steps 3 and 4 until 8 shifts have been performed. Thus, a complete 8bit byte will be processed.
6) Repeat Steps 2 through 5 for the next 8bit byte of the message. Continue doing this until all bytes have
been processed.
7) The final contents of the CRC register is the CRC value.
8) Place the CRC into the message such that the low byte is transmitted first. The algorithm should give
the correct CRC for below messages:
01 03 00 20 00 10 45 CC
01 06 00 40 00 10 89 D2
Error codes
Only 3 error codes are used:
01: illegal function code
02: illegal address
10: write protection (attempt to write a read_only register)
Data types
Each register consists of 16 bits (2 bytes)
If the data type is a byte, only the low byte will contain valid data. High byte is don’t care.
For data type longer than 16 bits, consecutive registers are used. The least significant register
comes first.
16bit variables: These variables are stored in a single register. Bit_0 denotes the LSB and bit 15 denotes
the MSB.
32 bit variables: These variables are stored in 2 consecutive registers. The high order 16 bits are in the
first register and the low order 16 bits are in the second register
Bit arrays: Arrays larger than 16 bits are stored in multiple registers. The LSB of the first register is bit_0.
The MSB of the first register is bit_15. The LSB of the second register is bit_16. The MSB of the second
register is bit_31, and so on.
DATA FORMATS
CRC CALCULATION

Other manuals for Datakom DKM-411

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Datakom DKM-411 and is the answer not in the manual?

Datakom DKM-411 Specifications

General IconGeneral
BrandDatakom
ModelDKM-411
CategoryMeasuring Instruments
LanguageEnglish