![wtw TresCon UNO A111 Скачать руководство пользователя страница 185](http://html1.mh-extra.com/html/wtw/trescon-uno-a111/trescon-uno-a111_operating-manual_1000694185.webp)
TresCon UNO
Appendix
8 - 7
ba43134e08
05/2017
Message field
This field contains the commands to the "Slave" (see table). The CRC
immediately follows subsequent to the message (2 bytes).
CRC16 field
The CRC is the checksum of all the transmitted bytes. The CRC is
transmitted as 2 binary bytes. The higher value bytes are transmitted
first followed by the lower value bytes. The transmitted CRC 16 is con-
structed so that it always supplements the total CRC to 0000 (hex). A
string is only valid if the CRC calculated over the entire received string
is = 0000 (hex).
Otherwise, the message is ignored.
CRC (C program)
Procedure to create a CRC (C program):
Unsigned short crc16 (unsigned char *bytes, int byte_anz)
{
unsigned short crc;
unsigned char byte;
unsigned short merker;
int i;
crc = 0;
while(byte_anz--)
{
byte = *bytes++;
for(i = 7; i >= 0; i--, byte <<= 1)
{
merker = crc & (1 << 15);
crc <<= 1;
if(byte & (1 << 7))
crc++;
if(merker)
crc ^= 0x1021;
}
}
return crc;
}
7
6
5
4
3
2
1
0
"0"
Cont.
Length of the message field incl. CRC 16
Bit 5,4,3,2,1,0
The length field indicates the length of the message
or the length of the m 2 Bytes (CRC bytes):
max. block length 65 bytes.
Bit 6
Cont.: length of the message field
≤
1 block --> bit
6 = 0
, for length of the message field
> 1 block -->
bit 6 = 1.
The continuation bit is set if another block follows. The last data block
sets the data bit to "0".
Length field
Содержание TresCon UNO A111
Страница 2: ...2 ba43134e08 05 2017 TresCon UNO Copyright 2017 Xylem Analytics Germany GmbH Printed in Germany...
Страница 6: ...Inhaltsverzeichnis TresCon UNO 0 4 ba43134e08 05 2017 9 1 Abbreviations 9 1 9 2 Index 9 1...
Страница 18: ...Safety TresCon UNO 2 4 ba43134e08 05 2017...
Страница 56: ...Initial commissioning TresCon UNO 4 4 ba43134e08 05 2017...
Страница 133: ...TresCon UNO Operation 5 77 ba43134e08 05 2017 9 Select Yes or No with 68 and confirm with 3...
Страница 167: ...TresCon UNO Maintenance 6 11 ba43134e08 05 2017 6 Leave the menu with 4...
Страница 202: ...Appendix TresCon UNO 8 24 ba43134e08 05 2017...
Страница 207: ......