User`s manual

40
Doppler MPT Users Manual
Revision A
COMMAND AND DATA STRUCTURE
Every DDF7001 command and the data coming from the DDF7001 conform to the data
structure as shown in the following table.
Byte # Definition Comments
0 0x02 STX indicates the start of the message
1 Length (LSB) LSB of the total length of the message (from byte 3
through byte n)
2 Length (MSB) MSB of the total length of the message
3 Message ID (LSB) LSB of the message identifier
4 Message ID (MSB) MSB of the message identifier
5 - n Message data Any data sent with the message
n + 1 CRC (LSB) LSB of CRC check sum
n + 2 CRC (MSB) MSB of CRC check sum
n + 3 0x03 ETX indicates the end of the message
* CRC is defined as CRC16 standard using 8005 for the generating polynomial see "A Painless
Guide to CRC Error Detection Algorithms". CRC is calculated on bytes 1 through n.
An example CRC algorithm written in the C language is shown in the listing below.
short CRCTable[] =
{
0x0000, 0xC0C1, 0xC181, 0x0140, 0xC301, 0x03C0, 0x0280, 0xC241, 0xC601,
0x06C0, 0x0780,
0xC741, 0x0500, 0xC5C1, 0xC481, 0x0440, 0xCC01, 0x0CC0, 0x0D80, 0xCD41,
0x0F00, 0xCFC1,
0xCE81, 0x0E40, 0x0A00, 0xCAC1, 0xCB81, 0x0B40, 0xC901, 0x09C0, 0x0880,
0xC841, 0xD801,
0x18C0, 0x1980, 0xD941, 0x1B00, 0xDBC1, 0xDA81, 0x1A40, 0x1E00, 0xDEC1,
0xDF81, 0x1F40,
0xDD01, 0x1DC0, 0x1C80, 0xDC41, 0x1400, 0xD4C1, 0xD581, 0x1540, 0xD701,
0x17C0, 0x1680,
0xD641, 0xD201, 0x12C0, 0x1380, 0xD341, 0x1100, 0xD1C1, 0xD081, 0x1040,
0xF001, 0x30C0,
0x3180, 0xF141, 0x3300, 0xF3C1, 0xF281, 0x3240, 0x3600, 0xF6C1, 0xF781,
0x3740, 0xF501,
0x35C0, 0x3480, 0xF441, 0x3C00, 0xFCC1, 0xFD81, 0x3D40, 0xFF01, 0x3FC0,
0x3E80, 0xFE41,
0xFA01, 0x3AC0, 0x3B80, 0xFB41, 0x3900, 0xF9C1, 0xF881, 0x3840, 0x2800,
0xE8C1, 0xE981,