更新
This commit is contained in:
@@ -1053,11 +1053,16 @@ namespace COFTester.Services
|
||||
|
||||
System.Diagnostics.Debug.WriteLine($"[ModbusTCP] 数据采集配置: 最大 {maxPoints} 点, 间隔 {intervalMs:F1}ms");
|
||||
System.Diagnostics.Debug.WriteLine($"[ModbusTCP] 停止条件:D1314力值、D360位移、D12升降位置、D16水平位置全为零");
|
||||
|
||||
bool? m33 = false;
|
||||
// 循环读取传感器数据(包含力值、位移和位置)
|
||||
int i = 0;
|
||||
while (i < maxPoints && !token.IsCancellationRequested)
|
||||
while (!m33.Value && !token.IsCancellationRequested)
|
||||
{
|
||||
m33 = _modbusMaster.ReadCoils(1, 33, 1)[0];
|
||||
if (m33.Value)
|
||||
{
|
||||
break;
|
||||
}
|
||||
// 每隔一定次数检查 M31 状态(避免频繁读取)
|
||||
if (i % 10 == 0) // 每 10 个数据点检查一次
|
||||
{
|
||||
@@ -1593,7 +1598,7 @@ namespace COFTester.Services
|
||||
|
||||
System.Diagnostics.Debug.WriteLine($"[ModbusRTU] 数据采集配置: 最大 {maxPoints} 点, 间隔 {intervalMs:F1}ms");
|
||||
System.Diagnostics.Debug.WriteLine($"[ModbusRTU] 停止条件:D1314力值、D360位移、D12升降位置、D16水平位置全为零");
|
||||
|
||||
bool m33 = true;
|
||||
// 循环读取传感器数据(包含力值、位移和位置)
|
||||
int i = 0;
|
||||
while (i < maxPoints && !token.IsCancellationRequested)
|
||||
@@ -2121,6 +2126,7 @@ namespace COFTester.Services
|
||||
int i = 0;
|
||||
while (i < maxPoints && !token.IsCancellationRequested)
|
||||
{
|
||||
|
||||
// 每隔一定次数检查 M31 状态(避免频繁读取)
|
||||
if (i % 10 == 0) // 每 10 个数据点检查一次
|
||||
{
|
||||
|
||||
@@ -415,16 +415,7 @@ namespace COFTester.ViewModels
|
||||
}
|
||||
}
|
||||
|
||||
public List<TestDataPoint> RealTimePoints
|
||||
{
|
||||
get => _realTimePoints;
|
||||
private set
|
||||
{
|
||||
_realTimePoints = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(DataPointsCount));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int DataPointsCount => _realTimePoints?.Count ?? 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user