| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using StackExchange.Profiling.Internal; |
| | | using System; |
| | | using System.Collections.Generic; |
| | |
| | | { |
| | | RequestInbound(conveyorLine); //䏿¥¼C,Båºä¸å¡ |
| | | } |
| | | |
| | | if (conveyorLine.DeviceCode == "1003") |
| | | { |
| | | _taskService.RequestWMSTask3("FK240711D2",1, "R02-002-027-011-01"); |
| | | } |
| | | if (conveyorLine.DeviceCode == "1004") |
| | | { |
| | | RequestInbound3(conveyorLine); //䏿¥¼C,Båºä¸å¡ |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | //æ°çå··é夿 |
| | | private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag) |
| | | { |
| | | try |
| | | byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 读åäºä»¶ |
| | | if (events == 1) |
| | | { |
| | | byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 读åäºä»¶ |
| | | if (events == 1) |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | WebResponseContent content = _taskService.ToPlatform(barcode); |
| | | if(content != null) |
| | | { |
| | | WebResponseContent content = _taskService.ToPlatform(barcode); |
| | | if ((int)content.Data == 1) |
| | | 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)1); //åå
¥å»å为é¿å··é |
| | | if (result) |
| | | if (content.Data.ToString() == "1") |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {barcode}ï¼åå
¥å»åï¼1", "å»å"); |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //åå
¥å»å为é¿å··é |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {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) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {barcode},åå
¥å»åï¼3", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }else if ((int)content.Data == 3) |
| | | { |
| | | |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //åå
¥å»å为çå··é |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {barcode},åå
¥å»åï¼3", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | }else if (barcode == "1") |
| | | { |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //空æå»å |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("空æå
¥åºï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | else if (barcode == "1") |
| | | { |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //空æå»å |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("空æå
¥åºï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | if (eventStatus == 1) |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"读åå°è¾é线ç³è¯·å
¥åºä¿¡æ¯EVENT为ï¼{eventStatus}ï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); |
| | | if(barcode == "1") |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); |
| | | /*if(barcode == "1") |
| | | { |
| | | string currentTime = DateTime.Now.ToString("HHmmss"); |
| | | barcode = "KTP" + currentTime; |
| | | |
| | | } |
| | | }*/ |
| | | if (barcode != null) |
| | | { |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)0); |
| | | if(taskCode== "R01-003-042-001-01") |
| | | /*if(taskCode== "R01-003-042-001-01") |
| | | { |
| | | if ((_taskService.ToPlatform(barcode)).Status) |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"ç»çæåï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | } |
| | | } |
| | | }*/ |
| | | // æ¿åæçæ¡ç ç³è¯·å
¥åºä¿¡æ¯ |
| | | WebResponseContent content = _taskService.RequestWMSTask(barcode, taskCode); // ç³è¯·å
¥åºï¼çæå åæºä»»å¡ |
| | | if (content !=null) |