Shenzhen Hpmont Technology Co., Ltd. Appendix B Modbus Communication Protocol
HD5L-PLUS Series User Manual V1.0 123
Address Function Address Group No.
0x3339
No-load auto-tuning encoder pulse
change judgment variable
0x333E
SINCOS encoder AB signal synthesis
amplitude
0x333C Current position signal (Q13 format) 0x333F
SINCOS encoder CD signal synthesis
amplitude
0x333D Current position signal (Q16 format) 0x3348 Software built-in number
5. Special Instruction
• For the data frame in ASCII mode, if the frame length is an even number, the frame is abandoned.
• Group F07, Group F10 and Group F14 (SCI communication parameters) are the controller
parameters which can be read but cannot be modified by the host computer.
• If many multi-function input terminals setting are the same, it may cause dysfunction. Therefore,
the user should avoid this case when modify the multi-function terminal function via the Modbus.
6. CRC Checking
Code of online calculating CRC is shown below:
unsigned int crc_check(unsigned char *data,unsigned char length)
{
int i;
unsigned crc_result=0xffff;
while(length - - )
{
crc_result^=*data++;
for(i=0;i<8;i++)
{
if(crc_result&0x01)
crc_result=(crc_result>>1)^0xa001;
else
crc_result=crc_result>>1;
}
}
return (crc_result=((crc_result&0xff)<<8)|(crc_result>>8));
}