# Modbus

### Description

The powerIO box T1.B100 is used as a gateway between Modbus TCP and Modbus RTU. The configuration of the serial ports for Modbus RTU can be performed flexibly.

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

#### Special features:

* **Behavior with unavailable devices**\
  For unavailable devices, no blocking timeouts are generated, allowing communication with other participants to continue uninterrupted.
* **Testing of connected devices**\
  The connected devices can be tested and checked autonomously via an internal Modbus test without a previously completed Modbus-TCP client logic.
* **Modbus trace log for error analysis**\
  For error analysis, a Modbus trace log is provided. This records queries from all Modbus-TCP clients. Performance values are also provided.
* **Support for multi-master queries**\
  Queries from multiple Modbus-TCP clients can be performed 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 for a serial port. However, if another protocol was previously selected, Modbus mode can be chosen via the "Fieldbus" dropdown 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 powerIO box T1.B100. This works even if it is accessed by another existing Modbus TCP client.

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

#### Supported function codes of the Modbus test

Read:

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

Write:

* 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 %}

#### Further functions

* Representation 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 enables monitoring and analyzing 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>

**Enabling/disabling the Modbus log:**

* Modbus logging is disabled via the **"DISABLE MODBUS LOG"**&#x62;utton.
* The timer at 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**: Narrowing down by a specific device ID.
* **Type**: Serial or internal registers of the Modbus TCP gateway T1.B100
* **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 according to the filter selection.

**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 for further external processing.

**Display of log data**

The displayed logs contain the following information:

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

### Internal registers

The powerIO box T1.B100 has an internal Modbus TCP Unit ID. This Unit ID is **248**

{% hint style="danger" %}
**Attention:**\
**From firmware version v4.0** the Unit ID was changed to **248** In earlier firmware versions (before v4.0) the Unit ID was 240.

This change was made because the Unit ID 240 is a valid serial Unit ID. The value range for serial Unit IDs is between 1 and 247.
{% 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>1073</td><td>1</td><td>System temperature 1</td><td>UINT16 (0.1)</td></tr><tr><td>1074</td><td>1</td><td>System temperature 2 5V</td><td>UINT16 (0.1)</td></tr><tr><td>1075</td><td>1</td><td>System temperature 3 compute module</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>1150</td><td>1</td><td>Current 24V power supply</td><td>UINT16 (0.01)</td></tr><tr><td>1151</td><td>1</td><td>Voltage 24V power supply</td><td>UINT16 (0.01)</td></tr><tr><td>1152</td><td>1</td><td>Power 24V power supply</td><td>UINT16 (0.01)</td></tr><tr><td>1153</td><td>1</td><td>Voltage 5V power supply</td><td>UINT16 (0.01)</td></tr><tr><td>1154</td><td>1</td><td>Voltage 3.3V power supply</td><td>UINT16 (0.01)</td></tr><tr><td>1155</td><td>1</td><td>Voltage 3.3V compute module</td><td>UINT16 (0.01)</td></tr><tr><td>1156</td><td>1</td><td>Voltage 1.8V compute module</td><td>UINT16 (0.01)</td></tr><tr><td>1160</td><td>1</td><td>Fault current 24V power supply</td><td>UINT16</td></tr><tr><td>1161</td><td>1</td><td>Fault voltage 24V power supply</td><td>UINT16</td></tr><tr><td>1162</td><td>1</td><td>Fault power 24V power supply</td><td>UINT16</td></tr><tr><td>1163</td><td>1</td><td>Fault voltage 5V power supply</td><td>UINT16</td></tr><tr><td>1164</td><td>1</td><td>Fault voltage 3.3V power supply</td><td>UINT16</td></tr><tr><td>1165</td><td>1</td><td>Fault voltage 3.3V compute module</td><td>UINT16</td></tr><tr><td>1166</td><td>1</td><td>Fault voltage 1.8V compute module</td><td>UINT16</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>2025</td><td>1</td><td>Bus port 5 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 wrong, or it is an invalid register address.                                        |
| 03       | Illegal Data Value                      | A value in the data field of the request is invalid. The structure of the request is faulty, e.g. wrong length or not permitted values. |
| 04       | Slave Device Failure                    | A non-recoverable error occurred during processing.                                                                                     |
| 05       | Acknowledge                             | The request has been accepted, but processing takes longer. The master should query later 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. in case of faulty programming requests.                                                     |
| 08       | Memory Parity Error                     | A consistency error was detected in memory. The device can try the request again, but a 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 is already assigned but no longer responds.                                                      |


---

# Agent Instructions: 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:

```
GET https://support.powerio.com/hub/powerio-r-system/en/t1.b100/feldbus-protokolle/modbus.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
