| | |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.DateTime; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Math; |
| | | using OfficeOpenXml.FormulaParsing.Excel.Functions.Text; |
| | | using OfficeOpenXml.Packaging.Ionic.Zip; |
| | | using Quartz; |
| | | using SqlSugar; |
| | | using StackExchange.Profiling.Internal; |
| | |
| | | |
| | | public Task Execute(IJobExecutionContext context) |
| | | { |
| | | |
| | | |
| | | try |
| | | { |
| | | CommonConveyorLine conveyorLine = (CommonConveyorLine)context.JobDetail.JobDataMap.Get("JobParams"); |
| | | if ( conveyorLine != null ) |
| | | if (conveyorLine != null) |
| | | { |
| | | if(conveyorLine.DeviceCode == "1002") |
| | | if (conveyorLine.DeviceCode == "1002") |
| | | { |
| | | RequestInbound(conveyorLine); //䏿¥¼C,Båºä¸å¡ |
| | | } |
| | | if (conveyorLine.DeviceCode == "1003") |
| | | { |
| | | _taskService.RequestWMSTask3("FK240711D2",1, "R02-002-027-011-01"); |
| | | RequestInbound2(conveyorLine); |
| | | } |
| | | if (conveyorLine.DeviceCode == "1004") |
| | | { |
| | | RequestInbound3(conveyorLine); //䏿¥¼C,Båºä¸å¡ |
| | | RequestInbound3(conveyorLine); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | //RequestInNextAddress(conveyorLine); |
| | | |
| | | |
| | | WriteLog.GetLog("Jobæ¥å¿è¿è¡").Write(conveyorLine.DeviceCode + "è¿è¡æ¥å¿ï¼ç»ææ¶é´" + DateTime.Now, "Jobæ¥å¿è¿è¡"); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | //Console.Out.WriteLine(nameof(CommonConveyorLineJob) + ":" + ex.ToString()); |
| | | WriteLog.Write_Log("è¾é线交äº", "é误信æ¯", "é误", new { ä¿¡æ¯ = ex.Message }); |
| | | } |
| | | finally |
| | | { |
| | |
| | | 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"); //夿巷é |
| | | 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 |
| | | } |
| | |
| | | public void RequestInbound2(CommonConveyorLine conveyorLine) |
| | | { |
| | | //顶楼楼è¾éçº¿å¤æ |
| | | HandleEvent(conveyorLine, "PLC_WCS_D._05_PLC_EVENT", "PLC_WCS_D._05_PLC_LPN", "WCS_PLC_D._05_WCS_TO"); //夿å
¥åºå··é |
| | | |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_D._01_PLC_EVENT", "PLC_WCS_D._01_PLC_LPN", "R02-003-027-011-01", "WCS_PLC_D._05_WCS_TO");// å¤ç 1å··é ç«å°äºä»¶å
¥ç©º |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_D._03_PLC_EVENT", "PLC_WCS_D._03_PLC_LPN", "R01-003-041-011-01", "WCS_PLC_D._05_WCS_TO");// å¤ç 2å··é ç«å°äºä»¶ å
¥ç©º |
| | | |
| | | CheckForEmptyPallet2(conveyorLine, "PLC_WCS_D._02_PLC_EVENT", "PLC_WCS_D._02_PLC_LPN", "PLC_WCS_D._02_PLC_PUT", "R02-002-027-011-01"); //åææåºåº è¯»åæ¡ç éåºåºåºåº |
| | | CheckForEmptyPallet2(conveyorLine, "PLC_WCS_D._04_PLC_EVENT", "PLC_WCS_D._04_PLC_LPN", "PLC_WCS_D._04_PLC_PUT", "R01-002-041-011-01"); //åææåºåº è¯»åæ¡ç éåºåºåºåº |
| | | //ConveyorLineInFinish(conveyorLine); //ç¨äºåå
¥è¾é线æ¡ç ä¿¡æ¯ï¼ææ¶æªç¨ |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_D._01_PLC_EVENT", "PLC_WCS_D._01_PLC_LPN", "R01-003-041-011-01", "WCS_PLC_D._01_WCS_TO");// å¤ç 1å··é ç«å°äºä»¶å
¥ç©º |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_D._03_PLC_EVENT", "PLC_WCS_D._03_PLC_LPN", "R02-003-027-011-01", "WCS_PLC_D._03_WCS_TO");// å¤ç 2å··é ç«å°äºä»¶ å
¥ç©º |
| | | } |
| | | |
| | | public void RequestInbound3(CommonConveyorLine conveyorLine) |
| | | { |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_A._02_PLC_EVENT", "PLC_WCS_A._02_PLC_LPN", "R01-002-043-001-01", "WCS_PLC_A._02_WCS_TO");// å¤ç A21 ç«å°äºä»¶å
¥åº |
| | | |
| | | //ProcessConveyorEvent(conveyorLine, "PLC_WCS_A._03_PLC_EVENT", "PLC_WCS_A._03_PLC_LPN", "R01-002-042-001-01", "WCS_PLC_A._03_WCS_TO");// å¤ç A22 ç«å°äºä»¶ å
¥æ |
| | | |
| | | //ConveyorLineInFinish(conveyorLine,"R01-002-044-001-01"); //ç¨äºåå
¥è¾é线æ¡ç ä¿¡æ¯ï¼ç¨äºåºåº |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_A._03_PLC_EVENT", "PLC_WCS_A._03_PLC_LPN", "R01-002-042-001-01", "WCS_PLC_A._03_WCS_TO");// å¤ç A22 ç«å°äºä»¶ å
¥æ |
| | | } |
| | | |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine,string SCAddress) |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, string SCAddress) |
| | | { |
| | | DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine,SCAddress, "R_StackerCraneLowered"); //读åè¾é线 âå åæºæ¾ä¸â ä¿¡å· |
| | | if ( deviceProDTO2 != null ) |
| | | DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine, SCAddress, "R_StackerCraneLowered"); //读åè¾é线 âå åæºæ¾ä¸â ä¿¡å· |
| | | if (deviceProDTO2 != null) |
| | | { |
| | | byte strsd = GetLine(conveyorLine, deviceProDTO2.DeviceChildCode); |
| | | if (strsd == 1) |
| | | { |
| | | Dt_Task task = _taskService.IngStackerCraneTask2(conveyorLine.DeviceCode); |
| | | if(task != null && task.TaskType==(int)TaskOutboundTypeEnum.Outbound) |
| | | if (task != null && task.TaskType == (int)TaskOutboundTypeEnum.Outbound) |
| | | { |
| | | byte PalletType = 2; |
| | | if (task.TargetAddress == "R02-002-027-001-01" || task.TargetAddress == "R01-002-041-001-01") |
| | | byte PLCtypeTo = 1; |
| | | if (task.TargetAddress == "R02-002-027-011-01") |
| | | { |
| | | PalletType = 1; |
| | | PLCtypeTo = 2; |
| | | } |
| | | DeviceProDTO? deviceProDTO3 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletBarcode"); //åå
¥æ¡ç |
| | | DeviceProDTO? deviceProDTO4 = GetDeviceProDTO(conveyorLine, SCAddress, "W_PalletLayers"); //屿° |
| | |
| | | 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, PalletType) && SetLine(conveyorLine, deviceProDTO6.DeviceProDataBlock, (byte)task.PLCTo)) |
| | | 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); |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | //è·åè¾é线å®ä¾ |
| | | public DeviceProDTO? GetDeviceProDTO(CommonConveyorLine conveyorLine, string SCAddress, string Interactivet) |
| | |
| | | /// <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 HandleEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag) |
| | | { |
| | | try |
| | | { |
| | |
| | | if (events == 1) |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if(barcode != "1" || barcode != "0") |
| | | if (barcode != "1" || barcode != "0") |
| | | { |
| | | if ((_taskService.ToPlatform(barcode)).Status) |
| | | { |
| | | if(conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN")=="") |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN") == "") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //åææå»å |
| | |
| | | } |
| | | |
| | | //æ°çå··é夿 |
| | | private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag) |
| | | private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag,string Platform) |
| | | { |
| | | 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).Trim(); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | WebResponseContent content = _taskService.ToPlatform(barcode); |
| | | if (content != null) |
| | | { |
| | | WebResponseContent content = _taskService.ToPlatform(barcode); |
| | | if(content != null) |
| | | if (content.Status) |
| | | { |
| | | if (content.Status) |
| | | if (content.Data != null) |
| | | { |
| | | if(content.Data != null) |
| | | if (content.Data.ToString() == "1") |
| | | { |
| | | if (content.Data.ToString() == "1") |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") |
| | | { |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "") |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //åå
¥å»å为é¿å··é |
| | | if (result) |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //åå
¥å»å为é¿å··é |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {barcode}ï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | wcs_PLCto01(Platform + "ï¼æåä¿¡æ¯", "æå", $"æ¡ç {barcode},åå
¥å»åï¼1"); |
| | | } |
| | | } |
| | | else if (content.Data.ToString() == "3") |
| | | else |
| | | { |
| | | |
| | | 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", "å»å"); |
| | | } |
| | | } |
| | | wcs_PLCto01(Platform + "ï¼é误信æ¯", "é误", $"æ¡ç ï¼{barcode}ï¼åå ï¼å½åéåå
¥å»åï¼1ï¼ä½è¯»åè¾é线âå åæºåè´§ç«å°âææ¡ç ï¼ä¸å¯åå
¥å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | else if (barcode == "1") |
| | | { |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //空æå»å |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("空æå
¥åºï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦è¡¥ç©ºæ Aåº |
| | | private void CheckForEmptyPallet(CommonConveyorLine conveyorLine,string eventTag, string barcodeTag,string plcput,string Loc) |
| | | { |
| | | |
| | | try |
| | | { |
| | | Byte events = conveyorLine.Communicator.Read<Byte>(eventTag); // 读åäºä»¶ |
| | | if (events == 1) //1为空ï¼0为æ |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if(barcode == "") |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"读åå°åºåºå£è¡¥ç©ºæä¿¡å·ï¼{events}", "éè¦ç©ºæ"); |
| | | // çæå åæºå空æä»»å¡ |
| | | byte plcputts = conveyorLine.Communicator.Read<byte>(plcput); |
| | | if (plcputts != 1) |
| | | { |
| | | if ((_taskService.RequestWMSTask2("", Loc)).Status) |
| | | else if (content.Data.ToString() == "3") |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"å·²çæç©ºæåºåºä»»å¡ï¼{events}", "éè¦ç©ºæ"); |
| | | |
| | | 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 |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"æªçæç©ºæåºåºä»»å¡ï¼{events}", "éè¦ç©ºæ"); |
| | | wcs_PLCto01(Platform + "ï¼é误信æ¯", "é误", $"æ¡ç ï¼{barcode}ï¼ç³è¯·å
¥åºå¤±è´¥ï¼æªè·åå°å»å"); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto01(Platform + "ï¼é误信æ¯", "é误", $"æ¡ç ï¼{barcode}ï¼ç³è¯·å
¥åºå¤±è´¥ï¼{content.Message}"); |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | else |
| | | { |
| | | |
| | | throw; |
| | | wcs_PLCto01(Platform+"ï¼é误信æ¯", "é误", $"读åå°è¾é线,ç³è¯·ï¼{events},æ¡ç ï¼{barcode}"); |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦åºç©ºæ Dåº |
| | | private void CheckForEmptyPallet2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string plcput, string Loc) |
| | | //ç¨äºå¤ææ¯å¦è¡¥ç©ºæ 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为æ |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | WebResponseContent content = _taskService.RequestWMSTask2("", Loc); |
| | | // çæå åæºå空æä»»å¡ |
| | | if (content.Status) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"读åå°åææåºåºä¿¡æ¯ï¼æ¡ç ä¿¡æ¯ï¼{barcode}", "åææåºåº"); |
| | | |
| | | byte outCount = conveyorLine.Communicator.Read<byte>(plcput); |
| | | if ((_taskService.RequestWMSTask3(barcode, outCount,Loc)).Status) |
| | | { |
| | | //åå
¥è¾é线æ¸
é¤ä¿¡æ¯ |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"å·²çæåææåºåºä»»å¡ï¼æ¡ç ä¿¡æ¯ï¼{barcode}", "åææåºåº"); |
| | | } |
| | | else |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿åºåºæ¥å¿").Write($"æªçæåææåºåºä»»å¡ï¼æ¡ç ä¿¡æ¯ï¼{barcode}", "åææåºåº"); |
| | | } |
| | | wcs_PLCto02(Loc + "ï¼æåä¿¡æ¯", "æå", $"å·²çæç©ºæåºåºä»»å¡"); |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto02(Loc + "ï¼é误信æ¯", "é误", $"æªçæç©ºæåºåºä»»å¡ï¼é误信æ¯ï¼{content.Message}"); |
| | | } |
| | | } |
| | | |
| | | else |
| | | { |
| | | wcs_PLCto02(Loc + "ï¼é误信æ¯", "é误", $"读åå°è¾é线,ç³è¯·ï¼{events}"); |
| | | } |
| | | } |
| | | |
| | | |
| | | //ç¨äºå¤æå
¥åºç«å° |
| | | private void ProcessConveyorEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string taskCode,string writeTag) |
| | | private void ProcessConveyorEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string taskCode, string writeTag) |
| | | { |
| | | byte eventStatus = conveyorLine.Communicator.Read<byte>(eventTag); |
| | | if (eventStatus == 1) |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"读åå°è¾é线ç³è¯·å
¥åºä¿¡æ¯EVENT为ï¼{eventStatus}ï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | 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 ((_taskService.ToPlatform(barcode)).Status) |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"ç»çæåï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | } |
| | | }*/ |
| | | // æ¿åæçæ¡ç ç³è¯·å
¥åºä¿¡æ¯ |
| | | wcs_PLCto03("å»åæ¸
é¤", "æå", $"å°åï¼{writeTag}ï¼å»åæ¸
é¤ä¸ºï¼0"); |
| | | WebResponseContent content = _taskService.RequestWMSTask(barcode, taskCode); // ç³è¯·å
¥åºï¼çæå åæºä»»å¡ |
| | | if (content !=null) |
| | | if (content != null) |
| | | { |
| | | if (content.Status) |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"ç³è¯·å
¥åºæåï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | wcs_PLCto03(taskCode + "ï¼æåä¿¡æ¯", "æå", $"æ¡ç ï¼{barcode}ï¼ç³è¯·å
¥åºæå"); |
| | | } |
| | | else |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"ç³è¯·å
¥åºå¤±è´¥ï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | wcs_PLCto03(taskCode+ "ï¼é误信æ¯", "é误", $"æ¡ç ï¼{barcode}ï¼ç³è¯·å
¥åºå¤±è´¥ï¼é误信æ¯ï¼{content.Message}"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto03(taskCode + "ï¼é误信æ¯", "é误", $"æ¡ç ï¼{barcode}ï¼ç³è¯·å
¥åºå¤±è´¥ï¼é误信æ¯contentè¿åå¼ä¸ºç©º"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | WriteLog.GetLog("PLCå
¥åºç«å°æ¥å¿").Write($"读åå°è¾é线信æ¯ä¸ºç©ºï¼ç«å°ç¼å·ä¸ºï¼{taskCode}", "ç«å°ä¿¡æ¯"); |
| | | wcs_PLCto03(taskCode + "ï¼é误信æ¯", "é误", $"读åå°è¾é线信æ¯ä¸ºç©º"); |
| | | } |
| | | } |
| | | else if (eventStatus == 6) |
| | | { |
| | | if (taskCode == "R02-003-027-011-01") |
| | | { |
| | | WebResponseContent content = _taskService.RequestWMSTask4(); |
| | | if (content != null) |
| | | { |
| | | if(content.Status && content.Data != null) |
| | | { |
| | | if (content.Data.ToString() == "1") |
| | | { |
| | | if (conveyorLine.Communicator.Write(writeTag, (byte)1)) |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼æåä¿¡æ¯", "æå", $"åå
¥æåï¼å»åï¼1"); |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼é误信æ¯", "é误", $"åå
¥å¤±è´¥ï¼å»åï¼1"); |
| | | } |
| | | } |
| | | else if (content.Data.ToString() == "3") |
| | | { |
| | | |
| | | if (conveyorLine.Communicator.Write(writeTag, (byte)3)) |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼æåä¿¡æ¯", "æå", $"åå
¥æåï¼å»åï¼3"); |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼é误信æ¯", "é误", $"åå
¥å¤±è´¥ï¼å»åï¼3"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼é误信æ¯", "é误", $"æªæ¾å°åå
¥å»å"); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼é误信æ¯", "é误", $"ç³è¯·å
¥åºå¤±è´¥ï¼é误信æ¯ï¼{content.Message}"); |
| | | } |
| | | } |
| | | 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 |
| | | { |
| | | wcs_PLCto04(taskCode + "ï¼é误信æ¯", "é误", $"åå
¥å¤±è´¥ï¼å»åï¼1"); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | return conveyorLine.Communicator.Write(DeviceProDataBlock, Pali); |
| | | } |
| | | |
| | | |
| | | public byte GetLine(CommonConveyorLine conveyorLine, string DeviceProDataBlock) |
| | | { |
| | | return conveyorLine.Communicator.Read<byte>(DeviceProDataBlock); |
| | |
| | | { |
| | | WriteLog.GetLog("å åæºä¸plc交äºä¿¡å·").Write($"ç«å°ç¼å·ï¼{sourceAddress},ä¿¡æ¯ï¼{message}", $"{sourceAddress}"); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void wcs_PLCto01(string SCLLinStack, string Logtype, string Magessadd) |
| | | { |
| | | WriteLog.Write_Log("䏿¥¼æ«ç ç«å°", SCLLinStack, Logtype, new { ä¿¡æ¯ = Magessadd }); |
| | | } |
| | | |
| | | public void wcs_PLCto02(string SCLLinStack, string Logtype, string Magessadd) |
| | | { |
| | | WriteLog.Write_Log("䏿¥¼è¡¥ç©ºæ", SCLLinStack, Logtype, new { ä¿¡æ¯ = Magessadd }); |
| | | } |
| | | public void wcs_PLCto03(string SCLLinStack, string Logtype, string Magessadd) |
| | | { |
| | | WriteLog.Write_Log("å
¥åºç«å°", SCLLinStack, Logtype, new { ä¿¡æ¯ = Magessadd }); |
| | | } |
| | | public void wcs_PLCto04(string SCLLinStack, string Logtype, string Magessadd) |
| | | { |
| | | WriteLog.Write_Log("顶楼空æååº", SCLLinStack, Logtype, new { ä¿¡æ¯ = Magessadd }); |
| | | } |
| | | |
| | | } |
| | | } |