| | |
| | | public void RequestInbound(CommonConveyorLine conveyorLine) |
| | | { |
| | | //1楼è¾éçº¿å¤æ |
| | | HandleEvent(conveyorLine, "PLC_WCS_B._03_PLC_EVENT", "PLC_WCS_B._03_PLC_LPN", "WCS_PLC_B._03_WCS_TO"); //夿巷é |
| | | HandleEvent(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_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 RequestInbound3(CommonConveyorLine conveyorLine) |
| | | { |
| | | ProcessConveyorEvent(conveyorLine, "PLC_WCS_A._02_PLC_EVENT", "PLC_WCS_A._02_PLC_LPN", "R02-003-043-011-01", "WCS_PLC_A._02_WCS_TO");// å¤ç A21 ç«å°äºä»¶å
¥åº |
| | | 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-003-042-011-01", "WCS_PLC_A._03_WCS_TO");// å¤ç A22 ç«å°äºä»¶ å
¥æ |
| | | //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"); //ç¨äºåå
¥è¾é线æ¡ç ä¿¡æ¯ï¼ç¨äºåºåº |
| | | //ConveyorLineInFinish(conveyorLine,"R01-002-044-001-01"); //ç¨äºåå
¥è¾é线æ¡ç ä¿¡æ¯ï¼ç¨äºåºåº |
| | | } |
| | | |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine,string SCAddress) |
| | |
| | | { |
| | | if ((_taskService.ToPlatform(barcode)).Status) |
| | | { |
| | | if(conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN")=="") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //åææå»å |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)3); //åææå»å |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("åå
¥å»åï¼3", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦è¡¥ç©ºæ |
| | | //æ°çå··é夿 |
| | | private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag) |
| | | { |
| | | try |
| | | { |
| | | byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 读åäºä»¶ |
| | | if (events == 1) |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | { |
| | | WebResponseContent content = _taskService.ToPlatform(barcode); |
| | | if ((int)content.Data == 1) |
| | | { |
| | | if (conveyorLine.Communicator.Read<string>("PLC_WCS_B._01_PLC_LPN") == "") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //åå
¥å»å为é¿å··é |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write($"æ¡ç {barcode}ï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | } |
| | | }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; |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦è¡¥ç©ºæ Aåº |
| | | private void CheckForEmptyPallet(CommonConveyorLine conveyorLine,string eventTag, string barcodeTag,string plcput,string Loc) |
| | | { |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦åºç©ºæ |
| | | //ç¨äºå¤ææ¯å¦åºç©ºæ Dåº |
| | | private void CheckForEmptyPallet2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string plcput, string Loc) |
| | | { |
| | | Byte events = conveyorLine.Communicator.Read<Byte>(eventTag); // 读åäºä»¶ |
| | |
| | | if (barcode != null) |
| | | { |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)0); |
| | | if(taskCode== "R01-003-042-011-01") |
| | | if(taskCode== "R01-003-042-001-01") |
| | | { |
| | | if ((_taskService.ToPlatform(barcode)).Status) |
| | | { |