Appendix 2 Modbus Communication Protocol 55
EV3200 Door Control Inverter User Manual
Request format:
Protocol data unit
Data length (bytes)
Range
Function parameter
1
0x06
Initial register address
2
0x0000 ~ 0xFFFF
Operation register quantity
2
0x0000 ~ 0x016
Register bytes number
1
2* operation register quantity
Register contents
2*operation register quantity
Depending on parameter range
Response format:
Protocol data unit
Data length (bytes)
Range
Function parameter
1
0x06
Register address
2
0x0000 ~ 0xFFFF
Operation register quantity
2
0x0000 ~ 0x016
Example:
Request frame: initial address F1.01, change two function parameters, the change contents in the sequence from low to high,
as in the table below.
Modification contents
Address
Function
parameter
Initial
address
Register quantity
Bytes
F1.01
F1.02
Check sum
05 10
01
01
00
02
04
00
64
02
58
68
86
Response frame:
Address
Function parameter
Register address
Register quantity
Check sum
0x05 0x10
0x01
0x01
0x00 0x02
0x10 0x70
In RTU mode, when changing multiple function parameters, the max number is 22. In ASCII mode, the max number is halved.
If the operation request fails, error code and exception code forming the protocol data unit will be replied. The error code is
(Par 0x80). For the error code, refer to the above description.
Modbus error detection mechanism:
Check sum of ASCII mode: LRC check sum covers the information part from slave address to data, equal to the complement
the of sum of the check data characters. For example: The complement of (01H+06H+00H+03H+03H+0xE8H) is 0AH
。
Check sum of RTU mode: CRC-16 check sum covers information from slave address to data. The calculation 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));}