From 81db6d24a676bd71a99b565924fa106942627f2d Mon Sep 17 00:00:00 2001 From: wenjy Date: Mon, 1 Apr 2024 16:02:05 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20=E4=BF=AE=E6=94=B9=E5=8F=91?= =?UTF-8?q?=E6=B3=A1=E7=BA=BF=E4=BA=A7=E9=87=8F=E6=B8=85=E7=A9=BA=E4=BF=A1?= =?UTF-8?q?=E5=8F=B7=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Aucma.Core.BoxFoam/Business/TeamSwitchBusiness.cs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 ? "成功" : "失败")}"); }