From f5b8c1ae89286dada20ea433ffac84f4c9e72a29 Mon Sep 17 00:00:00 2001 From: huanghongfeng <huanghongfeng@hnkhzn.com> Date: 星期五, 06 六月 2025 14:31:25 +0800 Subject: [PATCH] 1 --- 代码管理/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs | 369 +++++++++++++++++++++++++--------------------------- 1 files changed, 175 insertions(+), 194 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" index 9795170..9998fa7 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs" @@ -104,13 +104,21 @@ public void RequestInbound(CommonConveyorLine conveyorLine) { - //1妤艰緭閫佺嚎鍒ゆ柇 - HandleEvent2(conveyorLine, "PLC_WCS_B._03_PLC_EVENT", "PLC_WCS_B._03_PLC_LPN", "WCS_PLC_B._03_WCS_TO","鍘熸潗鏂欐壂鐮佺珯鍙�"); //鍒ゆ柇宸烽亾 - HandleEvent2(conveyorLine, "PLC_WCS_C._02_PLC_EVENT", "PLC_WCS_C._02_PLC_LPN", "WCS_PLC_C._02_WCS_TO", "鎴愬搧鎵爜绔欏彴"); //鍒ゆ柇宸烽亾 - CheckForEmptyPallet(conveyorLine, "PLC_WCS_B._02_PLC_EVENT", "PLC_WCS_B._02_PLC_LPN", "PLC_WCS_B._02_PLC_PUT", "R02-002-027-001-01"); //鍒ゆ柇鏄惁鍙栫┖鎵樺嚭搴� - CheckForEmptyPallet(conveyorLine, "PLC_WCS_C._01_PLC_EVENT", "PLC_WCS_C._01_PLC_LPN", "PLC_WCS_C._01_PLC_PUT", "R01-002-041-001-01"); //鍒ゆ柇鏄惁鍙栫┖鎵樺嚭搴� - ProcessConveyorEvent(conveyorLine, "PLC_WCS_B._01_PLC_EVENT", "PLC_WCS_B._01_PLC_LPN", "R02-003-027-001-01", "WCS_PLC_B._03_WCS_TO");// 澶勭悊 B - ProcessConveyorEvent(conveyorLine, "PLC_WCS_C._03_PLC_EVENT", "PLC_WCS_C._03_PLC_LPN", "R01-003-041-001-01", "WCS_PLC_C._02_WCS_TO");// 澶勭悊 C + try + { + //1妤艰緭閫佺嚎鍒ゆ柇 + HandleEvent2(conveyorLine, "PLC_WCS_B._03_PLC_EVENT", "PLC_WCS_B._03_PLC_LPN", "WCS_PLC_B._03_WCS_TO", "鍘熸潗鏂欐壂鐮佺珯鍙�"); //鍒ゆ柇宸烽亾 + HandleEvent2(conveyorLine, "PLC_WCS_C._02_PLC_EVENT", "PLC_WCS_C._02_PLC_LPN", "WCS_PLC_C._02_WCS_TO", "鎴愬搧鎵爜绔欏彴"); //鍒ゆ柇宸烽亾 + CheckForEmptyPallet(conveyorLine, "PLC_WCS_B._02_PLC_EVENT", "PLC_WCS_B._02_PLC_LPN", "PLC_WCS_B._02_PLC_PUT", "R02-002-027-001-01"); //鍒ゆ柇鏄惁鍙栫┖鎵樺嚭搴� + CheckForEmptyPallet(conveyorLine, "PLC_WCS_C._01_PLC_EVENT", "PLC_WCS_C._01_PLC_LPN", "PLC_WCS_C._01_PLC_PUT", "R01-002-041-001-01"); //鍒ゆ柇鏄惁鍙栫┖鎵樺嚭搴� + ProcessConveyorEvent(conveyorLine, "PLC_WCS_B._01_PLC_EVENT", "PLC_WCS_B._01_PLC_LPN", "R02-003-027-001-01", "WCS_PLC_B._03_WCS_TO");// 澶勭悊 B + ProcessConveyorEvent(conveyorLine, "PLC_WCS_C._03_PLC_EVENT", "PLC_WCS_C._03_PLC_LPN", "R01-003-041-001-01", "WCS_PLC_C._02_WCS_TO");// 澶勭悊 C + } + catch (Exception ex) + { + + throw; + } } public void RequestInbound2(CommonConveyorLine conveyorLine) @@ -130,45 +138,53 @@ public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, string SCAddress) { - DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine, SCAddress, "R_StackerCraneLowered"); //璇诲彇杈撻�佺嚎 鈥滃爢鍨涙満鏀句笅鈥� 淇″彿 - if (deviceProDTO2 != null) + try { - byte strsd = GetLine(conveyorLine, deviceProDTO2.DeviceChildCode); - if (strsd == 1) + DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine, SCAddress, "R_StackerCraneLowered"); //璇诲彇杈撻�佺嚎 鈥滃爢鍨涙満鏀句笅鈥� 淇″彿 + if (deviceProDTO2 != null) { - Dt_Task task = _taskService.IngStackerCraneTask2(conveyorLine.DeviceCode); - if (task != null && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) + byte strsd = GetLine(conveyorLine, deviceProDTO2.DeviceChildCode); + if (strsd == 1) { - byte PLCtypeTo = 1; - if (task.TargetAddress == "R02-002-027-011-01") + Dt_Task task = _taskService.IngStackerCraneTask2(conveyorLine.DeviceCode); + if (task != null && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) { - PLCtypeTo = 2; - } - DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletBarcode"); //鍐欏叆鏉$爜 - DeviceProDTO? deviceProDTO4 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletLayers"); //灞傛暟 - DeviceProDTO? deviceProDTO5 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletType"); //绫诲瀷 - DeviceProDTO? deviceProDTO6 = GetDeviceProDTO(conveyorLine, SCAddress, "W_Destination"); //绫诲瀷 - if (deviceProDTO3 != null && deviceProDTO4 != null && deviceProDTO5 != null && deviceProDTO6 != null) - { - if (SetLinestring(conveyorLine, deviceProDTO3.DeviceProDataBlock, task.PalletCode) && SetLine(conveyorLine, deviceProDTO4.DeviceProDataBlock, (byte)task.PalletCodequantity) && SetLine(conveyorLine, deviceProDTO5.DeviceProDataBlock, PLCtypeTo) && SetLine(conveyorLine, deviceProDTO6.DeviceProDataBlock, (byte)task.PLCTo)) + byte PLCtypeTo = 1; + if (task.TargetAddress == "R02-002-027-011-01") { + PLCtypeTo = 2; + } + DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletBarcode"); //鍐欏叆鏉$爜 + DeviceProDTO? deviceProDTO4 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletLayers"); //灞傛暟 + DeviceProDTO? deviceProDTO5 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletType"); //绫诲瀷 + DeviceProDTO? deviceProDTO6 = GetDeviceProDTO(conveyorLine, SCAddress, "W_Destination"); //绫诲瀷 + if (deviceProDTO3 != null && deviceProDTO4 != null && deviceProDTO5 != null && deviceProDTO6 != null) + { + if (SetLinestring(conveyorLine, deviceProDTO3.DeviceProDataBlock, task.PalletCode) && SetLine(conveyorLine, deviceProDTO4.DeviceProDataBlock, (byte)task.PalletCodequantity) && SetLine(conveyorLine, deviceProDTO5.DeviceProDataBlock, PLCtypeTo) && SetLine(conveyorLine, deviceProDTO6.DeviceProDataBlock, (byte)task.PLCTo)) + { - LogSignalStatus($"鍐欏叆鏀捐揣瀹屾垚淇℃伅锛屾墭鐩樻潯鐮侊紝灞傛暟锛岀被鍨嬩俊鎭垚鍔�", deviceProDTO2.DeviceChildCode); + LogSignalStatus($"鍐欏叆鏀捐揣瀹屾垚淇℃伅锛屾墭鐩樻潯鐮侊紝灞傛暟锛岀被鍨嬩俊鎭垚鍔�", deviceProDTO2.DeviceChildCode); + } + else + { + LogSignalStatus($"鍐欏叆鏀捐揣瀹屾垚淇℃伅锛屾墭鐩樻潯鐮侊紝灞傛暟锛岀被鍨嬩俊鎭け璐�", deviceProDTO2.DeviceChildCode); + + } } else { - LogSignalStatus($"鍐欏叆鏀捐揣瀹屾垚淇℃伅锛屾墭鐩樻潯鐮侊紝灞傛暟锛岀被鍨嬩俊鎭け璐�", deviceProDTO2.DeviceChildCode); + LogSignalStatus($"鏈壘鍒拌緭閫佺嚎鍗忚淇℃伅", task.TargetAddress); } } - else - { - LogSignalStatus($"鏈壘鍒拌緭閫佺嚎鍗忚淇℃伅", task.TargetAddress); - - } } } + } + catch (Exception ex) + { + + throw; } } @@ -178,58 +194,72 @@ return conveyorLine.DeviceProDTOs.FirstOrDefault(x => x.DeviceChildCode == SCAddress && x.DeviceProParamName == Interactivet); } - /// <summary> - /// 鐢ㄤ簬鍏ュ簱鍒ゆ柇宸烽亾 - /// </summary> - /// <param name="conveyorLine"></param> - /// <param name="eventTag"></param> - /// <param name="barcodeTag"></param> - /// <param name="writeTag"></param> - private void HandleEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag) + + + //鏂扮殑宸烽亾鍒ゆ柇 + private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag,string Platform) { try { byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 璇诲彇浜嬩欢 - if (events == 1) + string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); // 璇诲彇鏉$爜 + if (events == 1 && barcode != "NoRead" && barcode != "" && barcode != null) { - string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // 璇诲彇鏉$爜 - if (barcode != "1" || barcode != "0") + WebResponseContent content = _taskService.ToPlatform(barcode); + if (content != null) { - if ((_taskService.ToPlatform(barcode)).Status) + if (content.Status) { - if (conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN") == "") + if (content.Data != null) { - // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 - bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //鍘熸潗鏂欏幓鍚� - if (result) + if (content.Data.ToString() == "1") { - WriteLog.GetLog("PLC鏃ュ織").Write("鍐欏叆鍘诲悜锛�3", "鍘诲悜"); + if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") + { + // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 + bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //鍐欏叆鍘诲悜涓洪暱宸烽亾 + if (result) + { + wcs_PLCto01(Platform + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜{barcode},鍐欏叆鍘诲悜锛�1"); + } + } + else + { + wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛屽師鍥狅細褰撳墠闇�鍐欏叆鍘诲悜锛�1锛屼絾璇诲彇杈撻�佺嚎鈥滃爢鍨涙満鍙栬揣绔欏彴鈥濇湁鏉$爜锛屼笉鍙啓鍏ュ幓鍚�"); + } + } + else if (content.Data.ToString() == "3") + { + + if (conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN") == "") + { + // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 + bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //鍐欏叆鍘诲悜涓虹煭宸烽亾 + if (result) + { + wcs_PLCto01(Platform + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜{barcode},鍐欏叆鍘诲悜锛�3"); + } + } + else + { + wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛屽師鍥狅細褰撳墠闇�鍐欏叆鍘诲悜锛�3锛屼絾璇诲彇杈撻�佺嚎鈥滃爢鍨涙満鍙栬揣绔欏彴鈥濇湁鏉$爜锛屼笉鍙啓鍏ュ幓鍚�"); + } + } + else + { + wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ細鏈幏鍙栧埌鍘诲悜"); } } } - } - - - if (barcode == "1") - { - // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 - bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //绌烘墭鍘诲悜 - if (result) + else { - WriteLog.GetLog("PLC鏃ュ織").Write("绌烘墭鍏ュ簱锛屽啓鍏ュ幓鍚戯細1", "鍘诲悜"); + wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ細{content.Message}"); } } - /*else - { - // 鍐欏叆鍘诲悜1鍙峰爢鍨涙満 - bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); - if (result) - { - WriteLog.GetLog("PLC鏃ュ織").Write("鍐欏叆鍘诲悜锛�2", "鍘诲悜"); - } - - WriteLog.GetLog("PLC鏃ュ織").Write("鍏ュ簱澶辫触", "鍏ュ簱缁勭洏"); - }*/ + } + else + { + wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎,鐢宠锛歿events},鏉$爜锛歿barcode}"); } } catch (Exception ex) @@ -239,92 +269,35 @@ } } - //鏂扮殑宸烽亾鍒ゆ柇 - private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag,string Platform) - { - byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 璇诲彇浜嬩欢 - string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); // 璇诲彇鏉$爜 - if (events == 1 && barcode !="NoRead" && barcode !="" && barcode != null) - { - WebResponseContent content = _taskService.ToPlatform(barcode); - if (content != null) - { - if (content.Status) - { - if (content.Data != null) - { - if (content.Data.ToString() == "1") - { - if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") - { - // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 - bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //鍐欏叆鍘诲悜涓洪暱宸烽亾 - if (result) - { - wcs_PLCto01(Platform + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜{barcode},鍐欏叆鍘诲悜锛�1"); - } - } - else - { - wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛屽師鍥狅細褰撳墠闇�鍐欏叆鍘诲悜锛�1锛屼絾璇诲彇杈撻�佺嚎鈥滃爢鍨涙満鍙栬揣绔欏彴鈥濇湁鏉$爜锛屼笉鍙啓鍏ュ幓鍚�"); - } - } - else if (content.Data.ToString() == "3") - { - - if (conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN") == "") - { - // 鍐欏叆鍘诲悜2鍙峰爢鍨涙満 - bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //鍐欏叆鍘诲悜涓虹煭宸烽亾 - if (result) - { - wcs_PLCto01(Platform + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜{barcode},鍐欏叆鍘诲悜锛�3"); - } - } - else - { - wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛屽師鍥狅細褰撳墠闇�鍐欏叆鍘诲悜锛�3锛屼絾璇诲彇杈撻�佺嚎鈥滃爢鍨涙満鍙栬揣绔欏彴鈥濇湁鏉$爜锛屼笉鍙啓鍏ュ幓鍚�"); - } - } - else - { - wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ細鏈幏鍙栧埌鍘诲悜"); - } - } - } - else - { - wcs_PLCto01(Platform + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ細{content.Message}"); - } - } - } - else - { - wcs_PLCto01(Platform+"锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎,鐢宠锛歿events},鏉$爜锛歿barcode}"); - } - } - //鐢ㄤ簬鍒ゆ柇鏄惁琛ョ┖鎵� A鍖� private void CheckForEmptyPallet(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string plcput, string Loc) { - Byte events = conveyorLine.Communicator.Read<Byte>(eventTag); // 璇诲彇浜嬩欢 - if (events == 1) //1涓虹┖锛�0涓烘湁 + try { - WebResponseContent content = _taskService.RequestWMSTask2("", Loc); - // 鐢熸垚鍫嗗灈鏈哄彇绌烘墭浠诲姟 - if (content.Status) + Byte events = conveyorLine.Communicator.Read<Byte>(eventTag); // 璇诲彇浜嬩欢 + if (events == 1) //1涓虹┖锛�0涓烘湁 { - wcs_PLCto02(Loc + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"宸茬敓鎴愮┖鎵樺嚭搴撲换鍔�"); + WebResponseContent content = _taskService.RequestWMSTask2("", Loc); + // 鐢熸垚鍫嗗灈鏈哄彇绌烘墭浠诲姟 + if (content.Status) + { + wcs_PLCto02(Loc + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"宸茬敓鎴愮┖鎵樺嚭搴撲换鍔�"); + } + else + { + wcs_PLCto02(Loc + "锛氶敊璇俊鎭�", "閿欒", $"鏈敓鎴愮┖鎵樺嚭搴撲换鍔★紝閿欒淇℃伅锛歿content.Message}"); + } } else { - wcs_PLCto02(Loc + "锛氶敊璇俊鎭�", "閿欒", $"鏈敓鎴愮┖鎵樺嚭搴撲换鍔★紝閿欒淇℃伅锛歿content.Message}"); + wcs_PLCto02(Loc + "锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎,鐢宠锛歿events}"); } } - else + catch (Exception ex) { - wcs_PLCto02(Loc + "锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎,鐢宠锛歿events}"); + + throw; } } @@ -332,97 +305,105 @@ //鐢ㄤ簬鍒ゆ柇鍏ュ簱绔欏彴 private void ProcessConveyorEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string taskCode, string writeTag) { - byte eventStatus = conveyorLine.Communicator.Read<byte>(eventTag); - if (eventStatus == 1) + try { - string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); - if (barcode != null) + byte eventStatus = conveyorLine.Communicator.Read<byte>(eventTag); + if (eventStatus == 1) { - bool result = conveyorLine.Communicator.Write(writeTag, (byte)0); - wcs_PLCto03("鍘诲悜娓呴櫎", "鎴愬姛", $"鍦板潃锛歿writeTag}锛屽幓鍚戞竻闄や负锛�0"); - WebResponseContent content = _taskService.RequestWMSTask(barcode, taskCode); // 鐢宠鍏ュ簱锛岀敓鎴愬爢鍨涙満浠诲姟 - if (content != null) + string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); + if (barcode != null) { - if (content.Status) + bool result = conveyorLine.Communicator.Write(writeTag, (byte)0); + wcs_PLCto03("鍘诲悜娓呴櫎", "鎴愬姛", $"鍦板潃锛歿writeTag}锛屽幓鍚戞竻闄や负锛�0"); + WebResponseContent content = _taskService.RequestWMSTask(barcode, taskCode); // 鐢宠鍏ュ簱锛岀敓鎴愬爢鍨涙満浠诲姟 + if (content != null) { - wcs_PLCto03(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撴垚鍔�"); + if (content.Status) + { + wcs_PLCto03(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撴垚鍔�"); + } + else + { + wcs_PLCto03(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ紝閿欒淇℃伅锛歿content.Message}"); + } } else { - wcs_PLCto03(taskCode+ "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ紝閿欒淇℃伅锛歿content.Message}"); + wcs_PLCto03(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ紝閿欒淇℃伅content杩斿洖鍊间负绌�"); } } else { - wcs_PLCto03(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鏉$爜锛歿barcode}锛岀敵璇峰叆搴撳け璐ワ紝閿欒淇℃伅content杩斿洖鍊间负绌�"); + wcs_PLCto03(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎淇℃伅涓虹┖"); } } - else + else if (eventStatus == 6) { - wcs_PLCto03(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"璇诲彇鍒拌緭閫佺嚎淇℃伅涓虹┖"); - } - } - else if (eventStatus == 6) - { - if (taskCode == "R02-003-027-011-01") - { - WebResponseContent content = _taskService.RequestWMSTask4(); - if (content != null) + if (taskCode == "R02-003-027-011-01") { - if(content.Status && content.Data != null) + WebResponseContent content = _taskService.RequestWMSTask4(); + if (content != null) { - if (content.Data.ToString() == "1") + if (content.Status && content.Data != null) { - if (conveyorLine.Communicator.Write(writeTag, (byte)1)) + if (content.Data.ToString() == "1") { - wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆鎴愬姛锛屽幓鍚戯細1"); + if (conveyorLine.Communicator.Write(writeTag, (byte)1)) + { + wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆鎴愬姛锛屽幓鍚戯細1"); + } + else + { + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); + } } - else + else if (content.Data.ToString() == "3") { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); - } - } - else if (content.Data.ToString() == "3") - { - if (conveyorLine.Communicator.Write(writeTag, (byte)3)) - { - wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆鎴愬姛锛屽幓鍚戯細3"); + if (conveyorLine.Communicator.Write(writeTag, (byte)3)) + { + wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆鎴愬姛锛屽幓鍚戯細3"); + } + else + { + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細3"); + } } else { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細3"); + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鏈壘鍒板啓鍏ュ幓鍚�"); } } else { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鏈壘鍒板啓鍏ュ幓鍚�"); + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鐢宠鍏ュ簱澶辫触锛岄敊璇俊鎭細{content.Message}"); } } else { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鐢宠鍏ュ簱澶辫触锛岄敊璇俊鎭細{content.Message}"); + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鐢宠鍏ュ簱澶辫触锛岄敊璇俊鎭細content杩斿洖鍊间负绌�"); } - } - else - { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鐢宠鍏ュ簱澶辫触锛岄敊璇俊鎭細content杩斿洖鍊间负绌�"); - } - } - else if (taskCode == "R01-003-041-011-01") - { - if (conveyorLine.Communicator.Write(writeTag, (byte)1)) - { - wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); } - else + else if (taskCode == "R01-003-041-011-01") { - wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); - } + if (conveyorLine.Communicator.Write(writeTag, (byte)1)) + { + wcs_PLCto04(taskCode + "锛氭垚鍔熶俊鎭�", "鎴愬姛", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); + } + else + { + wcs_PLCto04(taskCode + "锛氶敊璇俊鎭�", "閿欒", $"鍐欏叆澶辫触锛屽幓鍚戯細1"); + } + } } } + catch (Exception ex) + { + + throw; + } } public bool SetLine(CommonConveyorLine conveyorLine, string DeviceProDataBlock, byte Pali) { -- Gitblit v1.9.3