| | |
| | | |
| | | public void RequestInbound(CommonConveyorLine conveyorLine) |
| | | { |
| | | 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_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) |
| | |
| | | } |
| | | |
| | | public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, string SCAddress) |
| | | { |
| | | try |
| | | { |
| | | DeviceProDTO? deviceProDTO2 = GetDeviceProDTO(conveyorLine, SCAddress, "R_StackerCraneLowered"); //读åè¾é线 âå åæºæ¾ä¸â ä¿¡å· |
| | | if (deviceProDTO2 != null) |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | |
| | | } |
| | | //è·åè¾é线å®ä¾ |
| | |
| | | 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) |
| | | { |
| | | try |
| | | { |
| | | byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 读åäºä»¶ |
| | | if (events == 1) |
| | | { |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag); // è¯»åæ¡ç |
| | | if (barcode != "1" || barcode != "0") |
| | | { |
| | | if ((_taskService.ToPlatform(barcode)).Status) |
| | | { |
| | | 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("åå
¥å»åï¼3", "å»å"); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | if (barcode == "1") |
| | | { |
| | | // åå
¥å»å2å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); //空æå»å |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("空æå
¥åºï¼åå
¥å»åï¼1", "å»å"); |
| | | } |
| | | } |
| | | /*else |
| | | { |
| | | // åå
¥å»å1å·å åæº |
| | | bool result = conveyorLine.Communicator.Write(writeTag, (byte)1); |
| | | if (result) |
| | | { |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("åå
¥å»åï¼2", "å»å"); |
| | | } |
| | | |
| | | WriteLog.GetLog("PLCæ¥å¿").Write("å
¥åºå¤±è´¥", "å
¥åºç»ç"); |
| | | }*/ |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | //æ°çå··é夿 |
| | | private void HandleEvent2(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string writeTag,string Platform) |
| | | { |
| | | try |
| | | { |
| | | byte events = conveyorLine.Communicator.Read<byte>(eventTag); // 读åäºä»¶ |
| | | string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim(); // è¯»åæ¡ç |
| | |
| | | wcs_PLCto01(Platform+"ï¼é误信æ¯", "é误", $"读åå°è¾é线,ç³è¯·ï¼{events},æ¡ç ï¼{barcode}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | //ç¨äºå¤ææ¯å¦è¡¥ç©ºæ 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为æ |
| | | { |
| | |
| | | wcs_PLCto02(Loc + "ï¼é误信æ¯", "é误", $"读åå°è¾é线,ç³è¯·ï¼{events}"); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | |
| | | |
| | | //ç¨äºå¤æå
¥åºç«å° |
| | | private void ProcessConveyorEvent(CommonConveyorLine conveyorLine, string eventTag, string barcodeTag, string taskCode, string writeTag) |
| | | { |
| | | try |
| | | { |
| | | byte eventStatus = conveyorLine.Communicator.Read<byte>(eventTag); |
| | | if (eventStatus == 1) |
| | |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | |
| | | throw; |
| | | } |
| | | } |
| | | public bool SetLine(CommonConveyorLine conveyorLine, string DeviceProDataBlock, byte Pali) |
| | | { |
| | | return conveyorLine.Communicator.Write(DeviceProDataBlock, Pali); |