diff --git a/Aucma.Core.BoxFoam/Business/TeamSwitchBusiness.cs b/Aucma.Core.BoxFoam/Business/TeamSwitchBusiness.cs index 51fe91cb..aeaebb03 100644 --- a/Aucma.Core.BoxFoam/Business/TeamSwitchBusiness.cs +++ b/Aucma.Core.BoxFoam/Business/TeamSwitchBusiness.cs @@ -178,9 +178,12 @@ namespace Aucma.Core.BoxFoam.Business #endregion #region Add By wenjy 2024-03-30 10:56:00 清空PLC产量,写true保持500毫秒后写false - ClearPlcOutPut(true); - Thread.Sleep(3000); - ClearPlcOutPut(false); + ClearPlcOutPut("1"); + Task.Run(() => + { + Thread.Sleep(3000); + ClearPlcOutPut("0"); + }); #endregion //小时统计报表数据存至记录表,清空小时统计报表 @@ -284,14 +287,14 @@ namespace Aucma.Core.BoxFoam.Business /// 清空PLC产量数据 /// /// - private void ClearPlcOutPut(bool value) + private void ClearPlcOutPut(string value) { var obj1 = PlcHelper.siemensList.FirstOrDefault(d => d.EquipName.Equals("foamLine1Plc")); if (obj1 != null) { if (obj1.plc.IsConnected) { - var flag = obj1.plc.WriteBool("M6.0", value);//换班 数据清空 + var flag = obj1.plc.WriteInt16("DB16.DBW40", value);//换班 数据清空 log.Warn($"班组切换清空A区产量数据写{value}:{(flag == true ? "成功" : "失败")}"); Console.WriteLine($"班组切换清空A区产量数据写{value}:{(flag == true ? "成功" : "失败")}"); } @@ -301,7 +304,7 @@ namespace Aucma.Core.BoxFoam.Business { if (obj2.plc.IsConnected) { - bool flag = obj2.plc.WriteBool("M6.0", value);//换班 数据清空 + bool flag = obj2.plc.WriteInt16("DB16.DBW40", value);//换班 数据清空 log.Warn($"班组切换清空B区产量数据写{value}:{(flag == true ? "成功" : "失败")}"); Console.WriteLine($"班组切换清空B区产量数据写{value}:{(flag == true ? "成功" : "失败")}"); }