From 67f54fd5f720263e8a2937b0f0b0a610141bef08 Mon Sep 17 00:00:00 2001 From: cjs <2216046164@qq.com> Date: 星期三, 11 六月 2025 17:20:28 +0800 Subject: [PATCH] 111 --- ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs | 93 +++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 91 insertions(+), 2 deletions(-) diff --git a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs index cced9a5..9c3767a 100644 --- a/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs +++ b/ams/Hanhe.iWCS.JingmenGEMTwoProtocol/PLCControl.cs @@ -183,7 +183,6 @@ if (trayCode.errCode == 0 && trayCode.result.Length == 95) { //鑾峰彇鎵樼洏鐮佺瓑淇℃伅 璇诲彇閫氶亾 11銆�2銆�3鐨勬暟鎹綔涓烘墭鐩樼爜 璇诲彇鍏跺畠閫氶亾 閲嶉噺 鍙犲寘绛変俊鎭�鎵�湁鏁版嵁瀛樺叆MachineInfo琛�- string flLoc = ""; string location = ""; GetMachineData(pmInfo,ref location, trayCode.result, false, "1"); @@ -731,7 +730,7 @@ internal static void PickUpFullDoorComplete(string ip, string taskNo) { var plc = Settings.GetPlcInfo().Where(a => a.ip == ip).FirstOrDefault(); - if (plc != null) + if (plc != null && !plc.location.Contains("FLZT")) { //鍐欏叆鍖呰鏈�-瀹夊叏闂ㄥ叧闂ㄦ寚浠� var writeRes = OITcpHelper.RegisterWriteOutPut(new OITcpHelper.RegisterWriteOutPutModel @@ -4478,6 +4477,96 @@ CMMLog.Info($"鍦ㄩ�閬搟plc.writeAddr + 2}涓啓鍏JsonConvert.SerializeObject(num)}锛宨p锛歿plc.ip}锛岀鍙o細{plc.port}"); } + /// <summary> + /// 鍥涢挻A锛堟礂鏉跨儤骞叉満缁勶級璁惧涓婄┖涓嬫弧 + /// </summary> + /// <param name="plc"></param> + /// <exception cref="NotImplementedException"></exception> + internal static void AMachine(Settings.PlcInfo plc) + { + if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location)) + { + try + { + var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel + { + dataNum = 1, + addr = plc.readAddr, + host = plc.ip, + port = plc.port + }); + if (result != null && result.errCode == 0) + { + if (result.result[0] == 1) + { + //閫佺┖ + bool req = WMSHelper.WMSOut(plc.location, "", ""); + if (req) CMMLog.Debug($"鍥涢挻A璁惧 璋冪敤WMS鑾峰彇绌烘墭鍑哄簱鐢熸垚浠诲姟鎴愬姛锛�);//鐜板湪浠诲姟鐢盬MS鑷繁涓嬪彂锛孉MS鍋氭嫤鎴鐞嗭紙鏌ヨext1閲岄潰瀵瑰簲鐨勪换鍔$被鍨嬶紝骞舵洿鏀逛换鍔$被鍨嬶級 + else CMMLog.Debug($"鍥涢挻A璁惧 璋冪敤WMS鑾峰彇绌烘墭鍑哄簱鐢熸垚浠诲姟澶辫触锛�); + } + if (result.result[0] == 2) + { + //鍙栨弧 + string wmstaskno = ""; + string traycode = ""; + bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode); + if (req) CMMLog.Debug($"鍥涢挻A璁惧 璋冪敤WMS鑾峰彇婊℃墭鍏ュ簱鐢熸垚浠诲姟鎴愬姛锛�);//鐜板湪浠诲姟鐢盬MS鑷繁涓嬪彂锛孉MS鍋氭嫤鎴鐞嗭紙鏌ヨext1閲岄潰瀵瑰簲鐨勪换鍔$被鍨嬶紝骞舵洿鏀逛换鍔$被鍨嬶級 + else CMMLog.Debug($"鍥涢挻A璁惧 璋冪敤WMS鑾峰彇婊℃墭鍏ュ簱鐢熸垚浠诲姟澶辫触锛�); + } + } + } + catch (Exception ex) + { + CMMLog.Info($"鍥涢挻A璁惧 err:{ex.Message}"); + } + } + } + + /// <summary> + /// 鍥涢挻C锛堥挻鏉垮壀鍒囨満缁勶級璁惧涓婃弧涓嬬┖ + /// </summary> + /// <param name="a"></param> + /// <exception cref="NotImplementedException"></exception> + internal static void CMachine(Settings.PlcInfo plc) + { + if (PickUpStartFree(plc.location) && PickUpEndFree(plc.location)) + { + try + { + var result = OITcpHelper.RegisterReadOutPut(new OITcpHelper.RegisterReadOutPutModel + { + dataNum = 1, + addr = plc.readAddr, + host = plc.ip, + port = plc.port + }); + if (result != null && result.errCode == 0) + { + if (result.result[0] == 1) + { + //閫佹弧 + bool req = WMSHelper.WMSOut(plc.location, "", ""); + if (req) CMMLog.Debug($"鍥涢挻C璁惧 璋冪敤WMS鑾峰彇婊℃墭鍑哄簱鐢熸垚浠诲姟鎴愬姛锛�);//鐜板湪浠诲姟鐢盬MS鑷繁涓嬪彂锛孉MS鍋氭嫤鎴鐞嗭紙鏌ヨext1閲岄潰瀵瑰簲鐨勪换鍔$被鍨嬶紝骞舵洿鏀逛换鍔$被鍨嬶級 + else CMMLog.Debug($"鍥涢挻C璁惧 璋冪敤WMS鑾峰彇婊℃墭鍑哄簱鐢熸垚浠诲姟澶辫触锛�); + } + if (result.result[0] == 2) + { + //鍙栫┖ + string wmstaskno = ""; + string traycode = ""; + bool req = WMSHelper.WMSIn(plc.location, "", ref wmstaskno, ref traycode); + if (req) CMMLog.Debug($"鍥涢挻C璁惧 璋冪敤WMS鑾峰彇绌烘墭鍏ュ簱鐢熸垚浠诲姟鎴愬姛锛�);//鐜板湪浠诲姟鐢盬MS鑷繁涓嬪彂锛孉MS鍋氭嫤鎴鐞嗭紙鏌ヨext1閲岄潰瀵瑰簲鐨勪换鍔$被鍨嬶紝骞舵洿鏀逛换鍔$被鍨嬶級 + else CMMLog.Debug($"鍥涢挻C璁惧 璋冪敤WMS鑾峰彇绌烘墭鍏ュ簱鐢熸垚浠诲姟澶辫触锛�); + } + } + } + catch (Exception ex) + { + CMMLog.Info($"鍥涢挻C璁惧 err:{ex.Message}"); + } + } + } + #endregion public class WMS_STOCK_VIEW -- Gitblit v1.9.1