![Alpha ALPHA6000 Series Скачать руководство пользователя страница 227](http://html1.mh-extra.com/html/alpha/alpha6000-series/alpha6000-series_manual_2905270227.webp)
Appendix 4 MODBUS Communication
http://www.acdrive-china.com
227
10H
Write-in to holding
register
11 11 8 8 5 5
CRC check
: CRC-16 is calculated as follows:
1.
The initial value of general CRC-16 calculation result is "0", the initial value of the
communication terminal is "1" (every bit of the 16-bit is "1").
2. The LSB of the communication frame is the MSB of calculation result, the MSB is
the LSB of calculation result. To calculate the CRC-16, switch the MSB and LSB.
3. The CRC-16 of the response messages must be calculated to be compared with the
received CRC-16 of the communication frame.
unsigned int CRC16(unsigned char*uptr, unsigned int ulenth)
{
unsigned int crc=0xffff ;
unsigned char uindex ;
if(ulenth>=9)
{
ulenth=9;
}
while(ulenth!=0)
{
crc^=*uptr ;
for(uindex=0; uindex<8;+)
{
if((crc&0x0001)==0)
{
crc=crc>>1 ;
}
else
{
crc=crc>>1 ;
crc^=0xa001 ;
}
}
ulenth-=1 ;
uptr++;
}
return(((crc&0x00FF)<<8)|((crc&0xFF00)>>8));
}
Содержание ALPHA6000 Series
Страница 7: ...Chapter 2 Installation and Wiring http www acdrive china com 7...
Страница 38: ...Chapter 2 Installation and Wiring http www acdrive china com 38 Fig 2 33 3R75GB 3004GB Wiring diagram...
Страница 239: ...Appendix 4 MODBUS Communication http www acdrive china com 239 25H for the user debugging...