Admin
10 天以前 96a77e69b0577c50adfaacd5fd8b89009242d3bd
´úÂë¹ÜÀí/WCS/WIDESEAWCS_Server/WIDESEAWCS_Tasks/ConveyorLineJob/CommonConveyorLineJob.cs
@@ -79,11 +79,11 @@
                    }
                    if (conveyorLine.DeviceCode == "1003")
                    {
                        RequestInbound2(conveyorLine);
                        RequestInbound2(conveyorLine);  //D区业务
                    }
                    if (conveyorLine.DeviceCode == "1004")
                    {
                        RequestInbound3(conveyorLine);
                        RequestInbound3(conveyorLine);      //A区业务
                    }
@@ -125,15 +125,65 @@
        {
            //顶楼楼输送线判断
            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._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 ç«™å°äº‹ä»¶ å…¥æ–™
            HandleEvent2(conveyorLine, "PLC_WCS_A._05_PLC_EVENT", "PLC_WCS_A._05_PLC_LPN", "WCS_PLC_A._05_WCS_TO", "成品U型弯扫码站台");  //判断巷道
            CheckForEmptyPallet(conveyorLine, "PLC_WCS_A._02_PLC_EVENT", "PLC_WCS_A._02_PLC_LPN", "PLC_WCS_A._02_PLC_PUT", "R01-002-043-001-01"); //判断是否取空托出库
            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._05_WCS_TO");// å¤„理 A22 ç«™å°äº‹ä»¶ å…¥æ–™
            //判断是否有1楼出空托任务
            MassiveOutboundShipments(conveyorLine, "WCS_PLC_A._01_WCS_TYPE");
        }
        public void MassiveOutboundShipments(CommonConveyorLine conveyorLine, string OutPLCAddress)
        {
            try
            {
                bool WetiOuttaskinfo = _taskService.ObtainOutTaskInfo();
                if (WetiOuttaskinfo)
                {
                    bool result = conveyorLine.Communicator.Write(OutPLCAddress, (byte)1);   //写入去向为短巷道
                    if (result)
                    {
                        WriteLog.Write_Log("U型成品出库", "成品出库写入信息", "成功", new { ä¿¡æ¯ = "写入交互信息,写入成功,写入值:1" });
                        return;
                    }
                    else
                    {
                        WriteLog.Write_Log("U型成品出库", "成品出库写入信息", "失败", new { ä¿¡æ¯ = $"写入失败,地址:{OutPLCAddress}" });
                        return;
                    }
                }
                else
                {
                    bool result = conveyorLine.Communicator.Write(OutPLCAddress, (byte)0);   //写入去向为短巷道
                    if (result)
                    {
                        WriteLog.Write_Log("U型成品出库", "成品出库写入信息", "成功", new { ä¿¡æ¯ = "写入清除信息,写入成功,写入值:0" });
                        return;
                    }
                    else
                    {
                        WriteLog.Write_Log("U型成品出库", "成品出库写入信息", "失败", new { ä¿¡æ¯ = $"写入失败,地址:{OutPLCAddress}" });
                        return;
                    }
                }
            }
            catch (Exception ex)
            {
                WriteLog.Write_Log("U型成品出库", "成品出库写入信息", "失败", new { ä¿¡æ¯ = $"系统错误信息,写入失败,地址:{OutPLCAddress}" });
                throw;
            }
        }
        public void ConveyorLineInFinish(CommonConveyorLine conveyorLine, string SCAddress)
@@ -212,8 +262,22 @@
                        {
                            if (content.Data != null)
                            {
                                if (Platform == "成品U型弯扫码站台")
                                {
                                    // å†™å…¥å޻向2号堆垛机
                                    bool result = conveyorLine.Communicator.Write(writeTag, (byte)3);   //写入去向为短巷道
                                    if (result)
                                    {
                                        wcs_PLCto01(Platform + ":成功信息", "成功", $"条码{barcode},写入去向:3");
                                        return;
                                    }
                                }
                                if (content.Data.ToString() == "1")
                                {
                                    if (conveyorLine.Communicator.Read<string>("PLC_WCS_C._03_PLC_LPN") == "")
                                    {
                                        // å†™å…¥å޻向2号堆垛机
@@ -257,14 +321,14 @@
                        }
                    }
                }
                else
                /*else
                {
                    wcs_PLCto01(Platform + ":错误信息", "错误", $"读取到输送线,申请:{events},条码:{barcode}");
                }
                }*/
            }
            catch (Exception ex)
            {
                wcs_PLCto01(Platform + ":错误信息", "错误", $"故障信息:{ex.Message}");
                throw;
            }
        }
@@ -289,10 +353,10 @@
                        wcs_PLCto02(Loc + ":错误信息", "错误", $"未生成空托出库任务,错误信息:{content.Message}");
                    }
                }
                else
                /*else
                {
                    wcs_PLCto02(Loc + ":错误信息", "错误", $"读取到输送线,申请:{events}");
                }
                }*/
            }
            catch (Exception ex)
            {
@@ -308,10 +372,10 @@
            try
            {
                byte eventStatus = conveyorLine.Communicator.Read<byte>(eventTag);
                if (eventStatus == 1)
                if ((eventStatus == 1 && taskCode != "R01-002-043-001-01") ||  (eventStatus == 6 && taskCode== "R01-002-043-001-01"))
                {
                    string barcode = conveyorLine.Communicator.Read<string>(barcodeTag).Trim();
                    if (barcode != null)
                    if (barcode != null && barcode != "0")
                    {
                        bool result = conveyorLine.Communicator.Write(writeTag, (byte)0);
                        wcs_PLCto03("去向清除", "成功", $"地址:{writeTag},去向清除为:0");
@@ -334,12 +398,13 @@
                    }
                    else
                    {
                        wcs_PLCto03(taskCode + ":错误信息", "错误", $"读取到输送线信息为空");
                        wcs_PLCto03(taskCode + ":错误信息", "错误", $"读取到输送线信息条码信息为空或为0,读取到输送线信息:{barcode}");
                    }
                }
                else if (eventStatus == 6)
                else if (eventStatus == 6 && taskCode != "R01-002-043-001-01")
                {
                    if (taskCode == "R02-003-027-011-01")
                    //if (taskCode == "R02-003-027-011-01" )  ä¹‹å‰ç‰ˆæœ¬é…åˆelse进行使用
                    if (taskCode == "R01-003-041-011-01" || taskCode == "R02-003-027-011-01")
                    {
                        WebResponseContent content = _taskService.RequestWMSTask4();
                        if (content != null)
@@ -385,23 +450,23 @@
                        }
                    }
                    else if (taskCode == "R01-003-041-011-01")
                    /*else if (taskCode == "R01-003-041-011-01")
                    {
                        if (conveyorLine.Communicator.Write(writeTag, (byte)1))
                        {
                            wcs_PLCto04(taskCode + ":成功信息", "成功", $"写入失败,去向:1");
                            wcs_PLCto04(taskCode + ":成功信息", "成功", $"写入成功,去向:1");
                        }
                        else
                        {
                            wcs_PLCto04(taskCode + ":错误信息", "错误", $"写入失败,去向:1");
                        }
                    }
                    }*/
                }
            }
            catch (Exception ex)
            {
                wcs_PLCto04(taskCode + ":错误信息", "错误", $"原因:{ex.Message}");
                throw;
            }
        }