From 8111f0b69161ca7be2246c03e9ffba1e2fe989e9 Mon Sep 17 00:00:00 2001 From: cjs <2216046164@qq.com> Date: 星期三, 11 六月 2025 17:19:46 +0800 Subject: [PATCH] 111 --- ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/ProcessHelper.cs | 30 ++++++++++++++++++++++++++---- 1 files changed, 26 insertions(+), 4 deletions(-) diff --git a/ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/ProcessHelper.cs b/ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/ProcessHelper.cs index c65ff93..3a45058 100644 --- a/ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/ProcessHelper.cs +++ b/ams/Hanhe.iWCS.TaizhouGEMTwoProtocol/ProcessHelper.cs @@ -254,6 +254,7 @@ if (mst.CN_S_BUSS_TYPE == "鍖呰绾胯ˉ绌�) PLCControl.PackingLineComplete(plc.ip); if (mst.CN_S_BUSS_TYPE == "鐢垫鍙栬揣") PLCControl.LiftAction(plc, mst.CN_S_TASK_NO,false); if (mst.CN_S_BUSS_TYPE == "鍥涢挻鎴愬搧鍑哄簱" || mst.CN_S_BUSS_TYPE == "鍥涢挻杈呮潗鍑哄簱") PLCControl.productOutWare(mst.CN_S_END_BIT, mst.CN_S_TASK_NO, false); + if (mst.CN_S_BUSS_TYPE == "3妤肩紦瀛樻灦鍏ュ彔鎵�) PLCControl.CacheStackingMouth6(plc); } } } @@ -406,6 +407,7 @@ result = true; } } + var bussTypeInfo = Settings.GetHouWeiCodeo().Where(a => a.location == mst.Ext1).FirstOrDefault(); if (bussTypeInfo != null) { @@ -470,7 +472,7 @@ { #region 鍒ゆ柇杈撻�绾挎ā寮�鍙樻洿娉ㄩ噴 bool action = true; - plc.ForEach(a => + foreach(var a in plc) { var modeResult = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel { @@ -486,6 +488,7 @@ { action = false; CMMLog.Debug($"OutWareTask:杈撻�绾夸负 鍏ュ簱妯″紡锛岃緭閫佺嚎鐐逛綅锛歿a.location}"); + break; } else { @@ -497,6 +500,18 @@ { action = false; CMMLog.Debug($"OutWareTask:涓棿琛�ModeList涓�鍏ュ簱妯″紡"); + + } + else + { + int[] num = new int[1] { 1 }; + var writeRes = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti + { + host = a.ip, + addr = a.writeAddr, + data = num, + port = a.port + }); } } else @@ -506,7 +521,7 @@ } } } - }); + }; if (!action) { return false; @@ -593,7 +608,6 @@ //鍏ュ簱杈撻�绾夸笂鏈変袱涓緭閫佸彛 //鍒ゆ柇杈撻�绾挎ā寮忓拰涓棿琛ㄦā寮忛兘鏄叆搴撴ā寮�- try { string endMachLoc = ""; @@ -612,7 +626,7 @@ }); if (modeResult != null && modeResult.errCode == 0) { - CMMLog.Debug($"InWareTask锛氳鍙栨粴绛掓満{plc.ip}閫氶亾鍙蜂负锛歿plc.readAddr}鐨勫�涓猴細{modeResult.result[0]}"); + CMMLog.Debug($"InWareTask锛氳鍙栨粴绛掓満{plc.ip}閫氶亾鍙蜂负锛歿plc.readAddr}鐨勫�涓猴細{JsonConvert.SerializeObject(modeResult.result)}"); if (modeResult.result[0] == 1) { action = false; @@ -631,6 +645,14 @@ } else { + int[] num = new int[1] { 2 }; + var writeRes = OITcpHelper.RegisterWriteOutPutMulti(new OITcpHelper.RegisterWriteOutPutModelMulti + { + host = plc.ip, + addr = plc.writeAddr, + data = num, + port = plc.port + }); return true; } } -- Gitblit v1.9.1