diff --git a/Service/Station/MonitorService.cs b/Service/Station/MonitorService.cs index 5a28cd2..671bd6a 100644 --- a/Service/Station/MonitorService.cs +++ b/Service/Station/MonitorService.cs @@ -66,7 +66,6 @@ public class MonitorService : null, Break = StationSoftMgr.SwappingStateMachine.BoxCarInfoModel?.CarStatus?.Break, Gear = StationSoftMgr.SwappingStateMachine.BoxCarInfoModel?.CarStatus?.Gear, - }, BatteryInfo = new() { @@ -173,15 +172,29 @@ public class MonitorService return Result.Fail(); } - result = PlcMgr.ReadTaskStatus(2); + int count = 3; + while (count > 0) + { + result = PlcMgr.ReadTaskStatus(2); + if (result) + { + break; + } + + count--; + Thread.Sleep(1000); + } + if (!result) { + Log.Error("BatteryRelocation PlcMgr.ReadTaskStatus(2) =false"); return Result.Fail(); } result = PlcMgr.HoldOn(); if (!result) { + Log.Error("BatteryRelocation PlcMgr.HoldOn() =false"); return Result.Fail(); }