> For the complete documentation index, see [llms.txt](https://support.powerio.com/hub/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.powerio.com/hub/powerio-r-system/en/h1.m300/feldbus-protokolle/modbus.md).

# Modbus

#### Description

The device is used as a gateway between Modbus TCP and Modbus RTU. The serial port configuration for Modbus RTU can be set flexibly.

The Unit ID of the Modbus device to be addressed must be specified by the Modbus client (typically a controller). An automatic scan assigns the Modbus devices to the corresponding serial ports. This assignment is stored in an internal list.

**Special features:**

* **Behavior with unavailable devices**\
  With unavailable devices, no blocking timeouts are generated, allowing communication with other participants to continue uninterrupted.
* **Testing connected devices**\
  The connected devices can be tested and checked independently via an internal Modbus test, without prior completed Modbus TCP client logic.
* **Modbus trace log for error analysis**\
  A Modbus trace log is provided for error analysis. This records the queries from all Modbus TCP clients. Performance values are also provided.
* **Support for multi-master queries**\
  Queries from multiple Modbus TCP clients can be carried out in parallel. The queries are processed in a queue and assigned to the corresponding Modbus TCP client.

#### Selection for Modbus protocol

* Modbus is always selected as the default setting for a serial port. However, if another protocol was previously selected, the Modbus mode can be selected via the "Fieldbus" drop-down menu.

<figure><img src="/files/579c117137f0a0e02d0877a3302efce50b84f7c4" alt=""><figcaption><p>Serial Settings overview - selection via drop-down menu "Fieldbus"</p></figcaption></figure>

#### Modbus Test

A complete Modbus Test Client is implemented on the device. This works even when accessed by another existing Modbus TCP client.

<figure><img src="/files/bc39b71d60583b744dd18cccd14afe5fefd655d9" alt=""><figcaption></figcaption></figure>

**Supported function codes of the Modbus Test**

Reading:

* FC 1 - Read Coil Status
* FC 2 - Read Input Status
* FC 3 - Read Holding Register
* FC 4 - Read Input Register

Writing:

* FC 5 - Write Coil
* FC 6 - Write Register
* FC 15 - Write Multiple Coil
* FC 16 - Write Multiple Register

{% hint style="info" %}
It should be noted that the Modbus stack supports all Modbus function codes that are available and supported by the connected Modbus RTU devices. However, the Modbus test only supports the most common function codes.
{% endhint %}

**Additional functions**

* Display for different data types: *boolean, byte, sbyte,* *uint16, int16,* *uint32, int32,* *float32, uint64, int64,* *float64*, *double*, *string*
* Byte Swapping
* Little and Big Endian

#### Modbus Log

The Modbus trace log makes it possible to monitor and analyze Modbus communication data in real time. Filters can be used to display specific data, and the log data can be exported for further analysis.

<figure><img src="/files/9fc0225aa55e60a3bfd3cf48b510b711f17e4e0d" alt=""><figcaption></figcaption></figure>

**Activation/deactivation of the Modbus log:**

* Modbus logging is disabled via the **"DISABLE MODBUS LOG"**-button.
* The timer in the top right indicates the remaining time before logging is automatically disabled.

**Filter options:** Various filter options are provided for targeted analysis of the log data:

* **State**: Filtering by status (successful/failed).
* **Unit ID**: Restriction by a specific device ID.
* **Type**: Serial or internal register of the Modbus TCP gateway
* **Serial Port**: Assigned serial port
* **Function Code**: Filter by function code
* **Start Address**: The register address
* **Quantity**: The number of registers

The displayed logs are adjusted accordingly based on the selected filters.

**Actions:**

* **RESET FILTER**: All filter settings are reset.
* **CLEAR DATA**: The displayed log data is cleared from the interface.
* **EXPORT DATA**: The filtered log data is exported in CSV format so it can be processed further externally.

**Display of log data**

The displayed logs contain the following information:

* **Timestamp**: The timestamp of the Modbus request is displayed.
* **State**: The status of the request is displayed (e.g. ✅ for successful).
* **Info**: Details about the request are provided, including:
  * Unit ID: The Unit ID
  * Type: Device type (e.g. T1.B100, H1.M300 or Serial with port assignment).
* **Request Data**:
  * FC (Function Code): The Modbus command used is displayed.
  * Address: The start address of the access is specified.
  * Quantity: The number of registers read is displayed.
* **Response Data**:
  * Read Value: The values returned by the target device are displayed (RTU).
* **Processing Time**: The duration of the request processing is specified in milliseconds.

### Internal register

The H1.M300 has an internal Modbus TCP Unit ID. This Unit ID is **248**

{% hint style="warning" %}
**Difference to the T1.B100:**\
The H1.M300 does not have internal power supply monitoring or additional system temperature sensors. The registers for current/voltage/power (1150-1156), the associated fault registers (1160-1166), the system temperatures (1073-1075), and the register for Port 5 (2025) are not available on the H1.M300 **not available**.

A read access to unsupported registers is **Exception Code 02 (Illegal Data Address)** responded to.
{% endhint %}

FC3 / FC4

<table><thead><tr><th>Address</th><th>Length</th><th width="376">Description</th><th>Data type</th></tr></thead><tbody><tr><td>1000</td><td>20</td><td>Hostname</td><td>string</td></tr><tr><td>1020</td><td>20</td><td>Box Name</td><td>string</td></tr><tr><td>1040</td><td>20</td><td>Box Comment</td><td>string</td></tr><tr><td>1060</td><td>1</td><td>CPU utilization</td><td>UINT16 (0,1)</td></tr><tr><td>1061</td><td>1</td><td>RAM utilization</td><td>UINT16 (0,1)</td></tr><tr><td>1062</td><td>6</td><td>System time</td><td>UINT16</td></tr><tr><td>1068</td><td>4</td><td>Uptime</td><td>UINT16</td></tr><tr><td>1072</td><td>1</td><td>CPU temperature</td><td>UINT16 (0,1)</td></tr><tr><td>1080</td><td>20</td><td>Serial number</td><td>string</td></tr><tr><td>1100</td><td>20</td><td>System ID1</td><td>string</td></tr><tr><td>1120</td><td>20</td><td>System ID2</td><td>string</td></tr><tr><td>2021</td><td>1</td><td>Bus Port 1 configuration</td><td>UINT16</td></tr><tr><td>2022</td><td>1</td><td>Bus Port 2 configuration</td><td>UINT16</td></tr><tr><td>2023</td><td>1</td><td>Bus Port 3 configuration</td><td>UINT16</td></tr><tr><td>2024</td><td>1</td><td>Bus Port 4 configuration</td><td>UINT16</td></tr><tr><td>3000</td><td>20</td><td>Ethernet Adapter</td><td>string</td></tr><tr><td>3020</td><td>20</td><td>Link</td><td>string</td></tr><tr><td>3040</td><td>20</td><td>Mode</td><td>string</td></tr><tr><td>3060</td><td>20</td><td>MAC</td><td>string</td></tr><tr><td>3080</td><td>1</td><td>Link</td><td>UINT16</td></tr><tr><td>3081</td><td>1</td><td>Network mode (number)</td><td>UINT16</td></tr><tr><td>3090</td><td>6</td><td>MAC</td><td>string</td></tr><tr><td>3100</td><td>4</td><td>IP address</td><td>UINT16</td></tr><tr><td>3104</td><td>4</td><td>Subnet mask</td><td>UINT16</td></tr><tr><td>3108</td><td>4</td><td>Gateway IP</td><td>UINT16</td></tr><tr><td>3112</td><td>4</td><td>DNS1 IP</td><td>UINT16</td></tr><tr><td>3116</td><td>4</td><td>DNS2 IP</td><td>UINT16</td></tr><tr><td>3120</td><td>4</td><td>Broadcast IP</td><td>UINT16</td></tr><tr><td>3130</td><td>10</td><td>IP Address</td><td>string</td></tr><tr><td>3140</td><td>10</td><td>Subnet mask</td><td>string</td></tr><tr><td>3150</td><td>10</td><td>Gateway IP</td><td>string</td></tr><tr><td>3160</td><td>10</td><td>DNS1 IP</td><td>string</td></tr><tr><td>3170</td><td>10</td><td>DNS2 IP</td><td>string</td></tr><tr><td>3180</td><td>10</td><td>Broadcast IP</td><td>string</td></tr></tbody></table>

Example - Query IP Address

<figure><img src="/files/a916d62a4091a8a87e469325ec65d514c32fcb26" alt=""><figcaption><p>Example Query IP Address</p></figcaption></figure>

#### Modbus Exception Codes

| **Code** | **Name**                                | **Description**                                                                                                                      |
| -------- | --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| 01       | Illegal Function                        | The function code is not supported by the slave.                                                                                     |
| 02       | Illegal Data Address                    | The requested address is invalid. The length may be incorrect, or it may be an invalid register address.                             |
| 03       | Illegal Data Value                      | A value in the request data field is invalid. The structure of the request is faulty, e.g. incorrect length or impermissible values. |
| 04       | Slave Device Failure                    | An unrecoverable error occurred during processing.                                                                                   |
| 05       | Acknowledge                             | The request was accepted, but processing takes longer. The master should request again later to see whether processing is complete.  |
| 06       | Slave Device Busy                       | The device is currently busy and cannot execute the request. The master should retry the request later.                              |
| 07       | Negative Acknowledge                    | The device cannot execute the request, e.g. for faulty programming requests.                                                         |
| 08       | Memory Parity Error                     | A consistency error was detected in memory. The device can retry the request, but service may be required.                           |
| 10 (0A)  | Gateway Path Unavailable                | This error usually occurs when the TCP query to the gateway is successful, but the device cannot be assigned.                        |
| 11 (0B)  | Gateway Target Device Failed to Respond | This error code occurs when the device has already been assigned, but no longer responds.                                            |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://support.powerio.com/hub/powerio-r-system/en/h1.m300/feldbus-protokolle/modbus.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
