CookTek MCD3000 Specifications Page 16

  • Download
  • Add to my manuals
  • Print
  • Page
    / 50
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 15
MCD3000 Series
MG.15.A4.22 - VLT is a registered Danfoss trademark 15
Installation
these parameters are uploaded to the MCD3000 there
will be no effect and no error generated.
Serial communications – calculating the
check sum (LRC)
Each command string sent to and from the MCD3000
includes a check sum. The form used is the
Longitudinal Redundancy Check (LRC) in ASCII hex.
This is an 8-bit binary number represented and
transmitted as two ASCII hexadecimal characters.
To calculate LRC:
1. Sum all ASCII bytes
2. Mod 256
3. 2’s complement
4. ASCII convert
For example Command String (Start);
ASCII STX B 1 0
or 02h 42h 31h 30h
ASCII Hex Binary
STX 02h 0000 0010
B 42h 0100 0010
1 31h 0011 0001
0 30h 0011 0000
A5h 1010 0101 SUM (1)
A5h 1010 0101 MOD 256 (2)
5Ah 0101 1010 1’s COMPLEMENT
01h 0101 1011 + 1 =
5Bh 0101 1011
2’s COMPLEMENT (3)
ASCII 5 B ASCII CONVERT (4)
or 35h 42h LRC CHECKSUM
The complete command string becomes
ASCII STX B 1 0 5 B ETX
or 02h 42h 31h 30h 35h 42h 03h
To verify a received message containing an LRC;
1. Convert last two bytes of message from ASCII to
binary.
2. Left shift 2
nd
to last byte 4 bits.
3. Add to last byte to get binary LRC.
4. Remove last two bytes from message.
5. Add remaining bytes of message.
6. Add binary LRC.
7. Round to one byte.
8. The result should be zero.
Response or status bytes are sent from the MCD3000
as an ASCII string.
STX [d1]h [d2]h [d3]h [d4]h LRC1 LRC2 ETX
d1 = 30h
d2 = 30h
d3 = 30h plus upper nibble of status byte right
shifted by four binary places.
d4 = 30h plus lower nibble of status byte.
For example status byte = 1Fh, response is
STX 30h 30h 31h 46h LRC1 LRC2 ETX
Page view 15
1 2 ... 11 12 13 14 15 16 17 18 19 20 21 ... 49 50

Comments to this Manuals

No comments