mirror of
https://gitee.com/ThingsGateway/ThingsGateway.git
synced 2025-10-22 03:24:29 +08:00
release:6.0.3.71
fix(s7): 打包时pdulength不需要再次减去其他字节量 fix(s7): 打包时尝试连接一次
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<Project>
|
||||
<PropertyGroup>
|
||||
<Version>6.0.3.71-beta.2</Version>
|
||||
<Version>6.0.3.71</Version>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@@ -177,7 +177,7 @@ internal static class PackHelper
|
||||
|
||||
while (maxAddress >= minAddress) // 循环,直到最大地址小于最小地址
|
||||
{
|
||||
int readLength = siemensS7Net.PduLength == 0 ? 200 : siemensS7Net.PduLength - 28; // 读取长度为PDU长度减去28,避免超出限制
|
||||
int readLength = siemensS7Net.PduLength == 0 ? 200 : siemensS7Net.PduLength; // 读取长度为PDU长度减去28,避免超出限制
|
||||
|
||||
List<SiemensAddress> tempAddresses = new(); // 临时地址列表用于存储分配给单个数据包的地址
|
||||
|
||||
|
@@ -102,6 +102,13 @@ public partial class SiemensS7Master : ProtocolBase
|
||||
/// <inheritdoc/>
|
||||
public override List<T> LoadSourceRead<T>(IEnumerable<IVariable> deviceVariables, int maxPack, int defaultIntervalTime)
|
||||
{
|
||||
try
|
||||
{
|
||||
this.Channel.Connect();
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
return PackHelper.LoadSourceRead<T>(this, deviceVariables, maxPack, defaultIntervalTime);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user