From f317d342e8be25fc64cc83b4f5923201aede3fc1 Mon Sep 17 00:00:00 2001 From: hxy7yx <1595670487@qq.com> Date: Sun, 29 Jun 2025 18:55:03 -0700 Subject: [PATCH] modbus:support 8-byte Endianness --- .../configuration/south-devices/modbus-rtu/modbus-rtu.md | 9 +++++++++ .../configuration/south-devices/modbus-tcp/modbus-tcp.md | 9 +++++++++ .../configuration/south-devices/modbus-rtu/modbus-rtu.md | 9 +++++++++ .../configuration/south-devices/modbus-tcp/modbus-tcp.md | 9 +++++++++ 4 files changed, 36 insertions(+) diff --git a/en_US/configuration/south-devices/modbus-rtu/modbus-rtu.md b/en_US/configuration/south-devices/modbus-rtu/modbus-rtu.md index 3eea726a..1d63d8f8 100644 --- a/en_US/configuration/south-devices/modbus-rtu/modbus-rtu.md +++ b/en_US/configuration/south-devices/modbus-rtu/modbus-rtu.md @@ -28,6 +28,7 @@ After clicking **Create**, you will be redirected to the **Device Configuration* | **Baud Rate** | Only for the **Serial** mode, the serial connection parameter. | | **Data Bits** | Only for the **Serial** mode, the serial connection parameter. | | **Connection Mode** | Only for the **Ethernet** mode, you can choose Neuron as the TCP client or server. | +| **8-byte Endianness** | Byte order of tags with 64 bits, with each number representing one byte. | | **IP Address** | Only for the **Ethernet** mode, the IP address of the device when using TCP connection with Neuron as the client, or the IP address of Neuron when using TCP connection with Neuron as the server. The default value is 0.0.0.0. | | **Port** | Only for the **Ethernet** mode, the port number of the device when using TCP connection with Neuron as the client, or the port number of Neuron when using TCP connection with Neuron as the server. | | **Maximum Retry Times** | The maximum number of retries after a failed attempt to send a read command.| @@ -108,6 +109,14 @@ Optional, byte order, applicable to data types int16/uint16/int32/uint32/float, | #BL | 3,4,1,2 | int32/uint32/float | | | #BB | 4,3,2,1 | int32/uint32/float | | +Byte order also applies to int64/uint64/double data types. Each digit represents one byte. See the following table for detailed information. +| Symbol | Byte Order | Supported Data Types | Note | +| --- | ------- | ------------------ | ----- | +| #LL | 12,34,56,78 | int64/uint64/double | Default byte order if not specified | +| #LB | 21,43,65,87 | int64/uint64/double | | +| #BL | 78,56,34,12 | int64/uint64/double | | +| #BB | 87,65,43,21 | int64/uint64/double | | + ::: tip The byte order can be illustrated using the notation ABCD, which corresponds directly to the sequence 1234. As an example, the ABCD designation represents the standard or default Endianness 1234. (#LL). ::: diff --git a/en_US/configuration/south-devices/modbus-tcp/modbus-tcp.md b/en_US/configuration/south-devices/modbus-tcp/modbus-tcp.md index 776d5074..5898ac9d 100644 --- a/en_US/configuration/south-devices/modbus-tcp/modbus-tcp.md +++ b/en_US/configuration/south-devices/modbus-tcp/modbus-tcp.md @@ -24,6 +24,7 @@ After clicking **Create**, you will be redirected to the **Device Configuration* | -------------------- | ------------------------------------------------------- | | **Transport Mode** | TCP transfer or UDP transfer | | **Connection Mode** | Only for **TCP** mode, When selecting TCP, you can choose Neuron as the TCP client or server. | +| **8-byte Endianness** | Byte order of tags with 64 bits, with each number representing one byte. | | **Maximum Retry Times** | The maximum number of retries after a failed attempt to send a read command. | | **Retry Interval** | Resend reading instruction interval(ms) after a failed attempt to send a read command. | | **Send Interval** | The waiting time between sending each read/write command. Some serial devices may discard certain commands if they receive consecutive commands in a short period of time. | @@ -114,6 +115,14 @@ Optional, byte order, applicable to data types int16/uint16/int32/uint32/float, | #BL | 3,4,1,2 | int32/uint32/float | | | #BB | 4,3,2,1 | int32/uint32/float | | +Byte order also applies to int64/uint64/double data types. Each digit represents one byte. See the following table for detailed information. +| Symbol | Byte Order | Supported Data Types | Note | +| --- | ------- | ------------------ | ----- | +| #LL | 12,34,56,78 | int64/uint64/double | Default byte order if not specified | +| #LB | 21,43,65,87 | int64/uint64/double | | +| #BL | 78,56,34,12 | int64/uint64/double | | +| #BB | 87,65,43,21 | int64/uint64/double | | + ::: tip The byte order can be illustrated using the notation ABCD, which corresponds directly to the sequence 1234. As an example, the ABCD designation represents the standard or default Endianness 1234. (#LL). ::: diff --git a/zh_CN/configuration/south-devices/modbus-rtu/modbus-rtu.md b/zh_CN/configuration/south-devices/modbus-rtu/modbus-rtu.md index 697d32fc..b29b31d4 100644 --- a/zh_CN/configuration/south-devices/modbus-rtu/modbus-rtu.md +++ b/zh_CN/configuration/south-devices/modbus-rtu/modbus-rtu.md @@ -25,6 +25,7 @@ Modbus RTU 协议采用二进制编码,可以在 RS-232、RS-485 或其他串 | **波特率** | 串口模式下,串口连接参数。 | | **数据位** | 串口模式下,串口连接参数。 | | **连接模式** | Ethernet 模式下,可以选择 Neuron 作为 TCP 的客户端或是服务端。 | +| **8 字节字节序** | 64 位数据类型字节序,每个数字代表一字节。 | | **IP 地址** | Ethernet 模式下,设备的 IP 地址(Neuron 作为客户端);或是 Neuron 本机的 IP 地址(Neuron 作为服务端),默认可填 0.0.0.0。 | | **端口** | Ethernet 模式下,设备的端口号(Neuron 作为客户端);或是 Neuron 本机的端口(Neuron 作为服务端)。 | | **最大重试次数** | 发送读取指令失败后最大重试次数。| @@ -98,6 +99,14 @@ Modbus RTU 协议采用二进制编码,可以在 RS-232、RS-485 或其他串 | #BL | 3,4,1,2 | int32/uint32/float | | | #BB | 4,3,2,1 | int32/uint32/float | | +字节顺序同样适用于 int64/uint64/double 数据类型,每个数字代表一字节,详细说明见下表。 +| 符号 | 字节顺序 | 支持的数据类型 | 备注 | +| --- | ------- | ------------------ | ----- | +| #LL | 12,34,56,78 | int64/uint64/double | 不填,默认字节顺序 | +| #LB | 21,43,65,87 | int64/uint64/double | | +| #BL | 78,56,34,12 | int64/uint64/double | | +| #BB | 87,65,43,21 | int64/uint64/double | | + ::: tip 字节顺序可能用 ABCD 表示,只需将 1234 对应 ABCD 即可。例如 ABCD 对应默认字节序 1234 (#LL)。 ::: diff --git a/zh_CN/configuration/south-devices/modbus-tcp/modbus-tcp.md b/zh_CN/configuration/south-devices/modbus-tcp/modbus-tcp.md index ec8c8676..2bdb0f71 100644 --- a/zh_CN/configuration/south-devices/modbus-tcp/modbus-tcp.md +++ b/zh_CN/configuration/south-devices/modbus-tcp/modbus-tcp.md @@ -19,6 +19,7 @@ Neuron 的 Modbus TCP 插件除了支持以 TCP 客户端的模式主动接入 |