---
title: "Modbus Client | Examples | N3uron KB V1.22"
slug: "modbus-client-examples"
description: "Modbus Client is a N3uron module that allows users to quickly and easily connect N3uron to any Modbus compatible device. Some of the main…"
updated: 2025-12-27T22:15:44Z
published: 2025-12-27T22:15:44Z
---

> ## Documentation Index
> Fetch the complete documentation index at: https://docs.n3uron.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Examples

## Connecting to an Inverter using Modbus Client

In this example,****the**Modbus Client** module is used to connect to an inverter acting as a slave over **TCP**. The inverter has the following memory map:

| **Template: PV inverter** |
| --- |
| **Communication protocol: Modbus TCP** |
| **Tag same Modbus** | **Modbus Address** | **Data type** | **Access** | **Units** | **Scaling** | **Description** |
| ALARMS/FAN_ERROR | 400108.2 | boolean | R |  | 1 | Alarm: Fan diagnostics error |
| ALARMS/IGBT_HIGH_TEMP | 400108.3 | boolean | R |  | 1 | Alarm: High temperature in drive |
| ENERGY_TODAY_VAL | 400101 | Int32 | R | W/h | 0.1 | Energy generated on current day |
| ERROR_CODE | 400103 | Int16 | RW |  | 1 | Error Code: 0 - No error, 1 - AC error, 2-DC error |
| FREQUENCY_VAL | 400104 | Int16 | R | Hz | 0.01 | Grid Frequency |
| POWER_SP | 400105 | Int16 | RW | kW | 1 | Active power setpoint |
| POWER_VAL | 400106 | Int16 | R | kW | 0.1 | Active power generated |
| STATUS_CODE | 400107 | Int16 | R |  | 1 | Status code |

Follow the below steps to set up the connection correctly:

- **Step 1:** After creating a **Modbus Client** module instance, a connection with the device needs to be configured, as depicted in the below image.

For this example, the following fields have been configured:

- **Host:**10.101.9.42, which is the device's IP address.
- **TCP port:** By default, port 502 is used.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2011-%20TCP%20Connection%20configuration.png)

- **Step 2:** Once the connection has been set up, the device must be created and configured. In this example, a device has been created named Device01.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2012-%20Create%20and%20configure%20a%20new%20device.png)

The remaining parameters have been left at their default settings. With the connection now established, we can proceed to create new tags based on the memory map outlined above.

- **Step 3:** In the **Explorer** panel, select **Tags.** In the **Model** panel, create a new group and name it INV01.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2013-%20Create%20a%20new%20group%20of%20tags.png)

- **Step 4:** Create a tag inside the group and name it POWER_VAL.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2014-%20Create%20a%20new%20tag(2).png)

- **Step 5:** Set the configuration parameters properly:
  - **Type:**Number.
  - **Format:** Integer.
  - **Client Access:** R.
  - **Details:**
    - **Description:**Active power generated.
  - **Scaling:**
    - **Enabled:** Yes.
    - **Raw Range:**
      - **Minimum:** 0.
      - **Maximum:** 1.
  - **Source:**
    - **Enabled:** Yes.
    - **Module type:** ModbusClient.
    - **Module name:** ModbusClient.
    - **Config:**
      - **Device:** This option must follow the format **<channel>/<device>**. In this case, Channel01/Device_01.
      - **Modbus Address:** The **Modbus Address** for the **POWER_VAL** is 400106, as shown in the memory map table.
      - **Data type:** Int16.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2015a-Tag%20configured.png)

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/Figure%2015b-%20Tag%20configured.png)

Create the remaining tags associated with the inverter by following the same procedure outlined above.

Now, go to the **Data/Real-Time section** in the **Navigation** panel, where you should be able to see the data read from the device.

![](https://cdn.document360.io/54093ab5-6b22-4542-a265-04377931f11a/Images/Documentation/realtime.png)
