Skip to content

Commit

Permalink
v2.4.2024.1212 IModbus升级
Browse files Browse the repository at this point in the history
  • Loading branch information
nnhy committed Dec 12, 2024
1 parent 44a27df commit 4ff2ef8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
12 changes: 5 additions & 7 deletions NewLife.IoT/Controllers/IModbus.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using NewLife.Data;

namespace NewLife.IoT.Controllers;
namespace NewLife.IoT.Controllers;

/// <summary>Modbus操作接口</summary>
public interface IModbus
Expand All @@ -11,28 +9,28 @@ public interface IModbus
/// <param name="address">地址。例如0x0002</param>
/// <param name="count">线圈数量。一般要求8的倍数</param>
/// <returns>线圈状态字节数组</returns>
IPacket ReadCoil(Byte host, UInt16 address, UInt16 count);
Boolean[] ReadCoil(Byte host, UInt16 address, UInt16 count);

/// <summary>读离散量输入,0x02</summary>
/// <param name="host">主机。一般是1</param>
/// <param name="address">地址。例如0x0002</param>
/// <param name="count">输入数量。一般要求8的倍数</param>
/// <returns>输入状态字节数组</returns>
IPacket ReadDiscrete(Byte host, UInt16 address, UInt16 count);
Boolean[] ReadDiscrete(Byte host, UInt16 address, UInt16 count);

/// <summary>读取保持寄存器,0x03</summary>
/// <param name="host">主机。一般是1</param>
/// <param name="address">地址。例如0x0002</param>
/// <param name="count">寄存器数量。每个寄存器2个字节</param>
/// <returns>寄存器值数组</returns>
IPacket ReadRegister(Byte host, UInt16 address, UInt16 count);
UInt16[] ReadRegister(Byte host, UInt16 address, UInt16 count);

/// <summary>读取输入寄存器,0x04</summary>
/// <param name="host">主机。一般是1</param>
/// <param name="address">地址。例如0x0002</param>
/// <param name="count">输入寄存器数量。每个寄存器2个字节</param>
/// <returns>输入寄存器值数组</returns>
IPacket ReadInput(Byte host, UInt16 address, UInt16 count);
UInt16[] ReadInput(Byte host, UInt16 address, UInt16 count);
#endregion

#region 写入
Expand Down
4 changes: 2 additions & 2 deletions NewLife.IoT/NewLife.IoT.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Description>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平台建设,以及统一各种硬件驱动协议</Description>
<Company>新生命开发团队</Company>
<Copyright>©2002-2024 新生命开发团队</Copyright>
<VersionPrefix>2.3</VersionPrefix>
<VersionPrefix>2.4</VersionPrefix>
<VersionSuffix>$([System.DateTime]::Now.ToString(`yyyy.MMdd`))</VersionSuffix>
<Version>$(VersionPrefix).$(VersionSuffix)</Version>
<FileVersion>$(Version)</FileVersion>
Expand Down Expand Up @@ -52,7 +52,7 @@
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'!='net40'">
<PackageReference Include="NewLife.Core" Version="11.0.2024.1201" />
<PackageReference Include="NewLife.Core" Version="11.1.2024.1206" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)'=='net40'">
<PackageReference Include="NewLife.Core" Version="10.10.2024.801-net40" />
Expand Down

0 comments on commit 4ff2ef8

Please sign in to comment.