Crc Verification Example; Communication Error Code - ZENEX AUTOMATION RS485-ZDM556-C User Manual

Modbus stepper drive
Table of Contents

Advertisement

User Manual For RS485-ZDM556C Stepper Drive

2.5 CRC Verification Example

The example take C language to calculate CRC
Uint16 Funct_CRC16(unsigned char * puchMsg, Uint16 DataLen)
{
Uint16 i,j,tmp;
Uint16 crcdata=0xFFFF;
for(i=0;i<DataLen;i++)
{
crcdata=(*puchMsg)^crcdata;
puchMsg++;
for(j=0;j<8;j++)
{
tmp=crcdata&0x0001;
crcdata=crcdata>>1;
if(tmp){
crcdata=crcdata^0xA001;
}
}
}
returncrcdata;
}

2.6 Communication error code

The following four situations may occur during communication:
1, communication is normal, the drive can normally receive and return information.
2, the drive due to communication error, can not normally receive the host's information, at this time the host
will be in overtime processing.
Office Add. : C-83, Zaveri Industrial Estate, Kathwada – Singarva Road, Kathwada, Ahmedabad-382430.
Email :
zenex.automation@yahoo.com
,Website :
www.zenexautomation.net
Contact (M) : +91 – 9727764623 / +91 - 9978030413

Advertisement

Table of Contents
loading

Table of Contents