From 4ff2ef8aabc5a0d94e73eaab236e406861318649 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=A7=E7=9F=B3=E5=A4=B4?= Date: Thu, 12 Dec 2024 11:25:45 +0800 Subject: [PATCH] =?UTF-8?q?v2.4.2024.1212=20IModbus=E5=8D=87=E7=BA=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NewLife.IoT/Controllers/IModbus.cs | 12 +++++------- NewLife.IoT/NewLife.IoT.csproj | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/NewLife.IoT/Controllers/IModbus.cs b/NewLife.IoT/Controllers/IModbus.cs index 4bfaccc..75571be 100644 --- a/NewLife.IoT/Controllers/IModbus.cs +++ b/NewLife.IoT/Controllers/IModbus.cs @@ -1,6 +1,4 @@ -using NewLife.Data; - -namespace NewLife.IoT.Controllers; +namespace NewLife.IoT.Controllers; /// Modbus操作接口 public interface IModbus @@ -11,28 +9,28 @@ public interface IModbus /// 地址。例如0x0002 /// 线圈数量。一般要求8的倍数 /// 线圈状态字节数组 - IPacket ReadCoil(Byte host, UInt16 address, UInt16 count); + Boolean[] ReadCoil(Byte host, UInt16 address, UInt16 count); /// 读离散量输入,0x02 /// 主机。一般是1 /// 地址。例如0x0002 /// 输入数量。一般要求8的倍数 /// 输入状态字节数组 - IPacket ReadDiscrete(Byte host, UInt16 address, UInt16 count); + Boolean[] ReadDiscrete(Byte host, UInt16 address, UInt16 count); /// 读取保持寄存器,0x03 /// 主机。一般是1 /// 地址。例如0x0002 /// 寄存器数量。每个寄存器2个字节 /// 寄存器值数组 - IPacket ReadRegister(Byte host, UInt16 address, UInt16 count); + UInt16[] ReadRegister(Byte host, UInt16 address, UInt16 count); /// 读取输入寄存器,0x04 /// 主机。一般是1 /// 地址。例如0x0002 /// 输入寄存器数量。每个寄存器2个字节 /// 输入寄存器值数组 - IPacket ReadInput(Byte host, UInt16 address, UInt16 count); + UInt16[] ReadInput(Byte host, UInt16 address, UInt16 count); #endregion #region 写入 diff --git a/NewLife.IoT/NewLife.IoT.csproj b/NewLife.IoT/NewLife.IoT.csproj index b6a0475..44a5039 100644 --- a/NewLife.IoT/NewLife.IoT.csproj +++ b/NewLife.IoT/NewLife.IoT.csproj @@ -5,7 +5,7 @@ IoT standard library, which defines various communication protocol standards and specifications in the Internet of Things field, without specific implementation. Used for IoT platform construction and unifying various hardware driver protocols. IoT标准库,定义物联网领域的各种通信协议标准规范,不含具体实现。用于IoT平台建设,以及统一各种硬件驱动协议 新生命开发团队 ©2002-2024 新生命开发团队 - 2.3 + 2.4 $([System.DateTime]::Now.ToString(`yyyy.MMdd`)) $(VersionPrefix).$(VersionSuffix) $(Version) @@ -52,7 +52,7 @@ - +