> ## Documentation Index
> Fetch the complete documentation index at: https://fop-50527c4b.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Modbus Protocol for Huawei SUN2000 Inverters

> SUN2000 Modbus primer: byte order, UINT16/INT32 data types, gain scaling, FC 03/04 register reads, and the proprietary FC 0x41 log transfer function.

Huawei SUN2000 inverters expose real-time operational data and historical log files over Modbus RTU (RS-485) and Modbus TCP (Ethernet/Wi-Fi). Both transport modes share the same register map and the same data-type conventions. Understanding a few key concepts — byte order, data types, and gain scaling — lets you read any register correctly on the first attempt.

## Byte order and data types

The inverter transmits all values in **big-endian** order: the most significant byte arrives first. The three native types are:

* **UINT16 / INT16** — occupies 1 register (2 bytes). Read with a single register read.
* **UINT32 / INT32** — occupies 2 consecutive registers (4 bytes). Always read both registers in a single request so the pair is consistent.

## Gain (scaling factor)

Most register values are transmitted as plain integers. To recover the real physical value, divide the raw integer by the register's **gain**. For example, a raw value of `2315` in a voltage register with gain 10 means **231.5 V**.

### Gain quick reference

| Parameter      | Typical gain     | Raw example | Real value       |
| -------------- | ---------------- | ----------- | ---------------- |
| Voltage (V)    | 10               | 2315        | 231.5 V          |
| Current (A)    | 10, 100, or 1000 | 450         | 4.5 A (gain 100) |
| Power (W)      | 1                | 15400       | 15400 W          |
| Energy (kWh)   | 100              | 1245        | 12.45 kWh        |
| Frequency (Hz) | 100              | 5002        | 50.02 Hz         |

Always confirm the gain for each register in the official Modbus Interface Definitions document for your specific model and firmware version.

## Function codes

SUN2000 inverters support both standard Modbus function codes and a proprietary extension for file transfer:

| Function code                       | Purpose                                                                               |
| ----------------------------------- | ------------------------------------------------------------------------------------- |
| **FC 03** — Read Holding Registers  | Read most real-time and configuration registers                                       |
| **FC 04** — Read Input Registers    | Read input registers (some series)                                                    |
| **FC 0x41** — User Defined Function | Proprietary file-transfer protocol for log retrieval (AD.bin, LD.bin, PD.bin, CD.bin) |

Standard FC 03 and FC 04 are limited to 252 bytes per packet, which is sufficient for reading individual registers or small groups. FC 0x41 bypasses this limit by streaming log files in 240-byte chunks, making it possible to retrieve multi-megabyte EMAP log files over RS-485 or TCP. See [Connection Methods](/modbus/connection-methods) for the full FC 0x41 sub-function protocol.

<Note>
  The register map differs significantly across SUN2000 series: L0, L1, M0, M1, M2, M3, MA, and MB0 each have their own Modbus Interface Definitions document. The addresses on these pages match the SUN2000MA and SUN2000-M1/M3 documents (Issue 08, 2024-11-07). Always verify every register address against the Modbus Interface Definitions for your specific model and firmware before writing production code.
</Note>

## Explore the reference

<CardGroup cols={3}>
  <Card title="Register map" icon="table" href="/modbus/register-map">
    Full V2/V3 register reference for DC, AC, energy, temperature, and inverter state.
  </Card>

  <Card title="ESS registers" icon="battery-full" href="/modbus/ess-registers">
    LUNA2000 battery registers for V3 inverters: SOC, charge/discharge power, and more.
  </Card>

  <Card title="Connection methods" icon="plug" href="/modbus/connection-methods">
    RS-485 RTU, SDongle TCP, inverter Wi-Fi AP, SmartLogger, and the FC 0x41 file protocol.
  </Card>
</CardGroup>
