Command Type And Format At The Application Layer; Function Code List; Crc Checking Algorithm - Huawei UPS2000 Development Manual

Modbus protocol
Hide thumbs Also See for UPS2000:
Table of Contents

Advertisement

UPS2000-(6 kVA-20 kVA)
Modbus Protocol Development Guide

1.5 Command Type and Format at the Application Layer

1.5.1 Function Code List

Function Code
0x03
0x06
0x2B

1.5.2 CRC Checking Algorithm

unsigned short count_CRC(unsigned char *addr, int num)
{
}
Issue 02 (2016-03-10)
unsigned short CRC = 0xFFFF;
int i;
while (num--)
{
CRC ^= *addr++;
for (i = 0; i < 8; i++)
{
if (CRC & 1)
{
CRC >>= 1;
CRC ^= 0xA001;
}
else
{
CRC >>= 1;
}
}
}
return CRC;
Huawei Proprietary and Confidential
Copyright © Huawei Technologies Co., Ltd.
Meaning
Read command
Write single register
command
Read device identifier
command
1 Communication Protocol
Remarks
Continuously read a single
or multiple registers.
Write commands to a single
register.
N/A
9

Advertisement

Table of Contents
loading

Table of Contents