EasyManuals Logo

Algodue ELETTRONICA UPM307 Protocol Manual

Algodue ELETTRONICA UPM307
32 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
3-6
ENGLISH
Description
MODBUS protocol manual
unsigned short ModBus_CRC16( unsigned char * Buffer, unsigned short Length )
{
unsigned char CRCHi = 0xFF;
unsigned char CRCLo = 0xFF;
int Index;
unsigned short ret;
while( Length-- )
{
Index = CRCLo ^ *Buffer++ ;
CRCLo = CRCHi ^ CRC_Table_Hi[Index];
CRCHi = CRC_Table_Lo[Index];
}
ret=((unsigned short)CRCHi << 8);
ret|= (unsigned short)CRCLo;
return ret;
}
OR CAN BE USED CALCULATED METHOD WITHOUT TABLE
/* ModBus_CRC16 Calculatd CRC16 with polynome 0xA001 and init value 0xFFFF
Input *Buffer - pointer on data
Input Lenght - number byte in buffer
Output - calculated CRC16
*/
/*
cur_crc=0xFFFF;
do
{
unsigned int i = 8;
cur_crc = cur_crc ^ *Buffer++;
do
{
if (0x0001 & cur_crc)
{
cur_crc >>= 1;
cur_crc ^= 0xA001;
}
else
{
cur_crc >>= 1;
}
}
while (--i);
}
while (--Length);
return cur_crc;
*/

Other manuals for Algodue ELETTRONICA UPM307

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Algodue ELETTRONICA UPM307 and is the answer not in the manual?

Algodue ELETTRONICA UPM307 Specifications

General IconGeneral
BrandAlgodue ELETTRONICA
ModelUPM307
CategoryMeasuring Instruments
LanguageEnglish