diff --git a/NewLife.Modbus/Drivers/ModbusDriver.cs b/NewLife.Modbus/Drivers/ModbusDriver.cs index b6a8cfb..4639bfb 100644 --- a/NewLife.Modbus/Drivers/ModbusDriver.cs +++ b/NewLife.Modbus/Drivers/ModbusDriver.cs @@ -262,7 +262,7 @@ internal IDictionary Dispatch(IPoint[] points, IList se var count = GetCount(point); // 找到片段 需要补充类型过滤参数避免不同类型相同地址取值错误问题 - var seg = segments.FirstOrDefault(e => e.Address <= maddr.Address && maddr.Address + count <= e.Address + e.Count && e.ReadCode == maddr.Range.ReadCode); + var seg = segments.FirstOrDefault(e => e.Address <= maddr.Address && maddr.Address + count <= e.Address + e.Count && (maddr.Range == null || e.ReadCode == maddr.Range.ReadCode)); if (seg != null && seg.Data != null) { var code = seg.ReadCode; diff --git a/NewLife.Modbus/NewLife.Modbus.csproj b/NewLife.Modbus/NewLife.Modbus.csproj index c89a3f0..9f5ab7a 100644 --- a/NewLife.Modbus/NewLife.Modbus.csproj +++ b/NewLife.Modbus/NewLife.Modbus.csproj @@ -34,6 +34,7 @@ true true snupkg + Readme.MD @@ -41,15 +42,20 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + + + True + \ + + diff --git a/NewLife.ModbusRTU/NewLife.ModbusRTU.csproj b/NewLife.ModbusRTU/NewLife.ModbusRTU.csproj index 046cddd..838bdee 100644 --- a/NewLife.ModbusRTU/NewLife.ModbusRTU.csproj +++ b/NewLife.ModbusRTU/NewLife.ModbusRTU.csproj @@ -34,6 +34,7 @@ true true snupkg + Readme.MD @@ -41,7 +42,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - @@ -59,6 +59,12 @@ + + + True + \ + + diff --git a/Test/Test.csproj b/Test/Test.csproj index 66f5e9a..6f19c1a 100644 --- a/Test/Test.csproj +++ b/Test/Test.csproj @@ -16,7 +16,7 @@ - + diff --git a/WinModbus/WinModbus.csproj b/WinModbus/WinModbus.csproj index 42b3cc1..efe30c9 100644 --- a/WinModbus/WinModbus.csproj +++ b/WinModbus/WinModbus.csproj @@ -18,7 +18,7 @@ - + diff --git a/XUnitTest/XUnitTest.csproj b/XUnitTest/XUnitTest.csproj index e8ea18b..e1c1870 100644 --- a/XUnitTest/XUnitTest.csproj +++ b/XUnitTest/XUnitTest.csproj @@ -12,11 +12,11 @@ - + - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive