diff --git a/FeiYu/FeiYu.csproj b/FeiYu/FeiYu.csproj index c24d71b..1387120 100644 --- a/FeiYu/FeiYu.csproj +++ b/FeiYu/FeiYu.csproj @@ -231,9 +231,7 @@ - - Always - + diff --git a/ViewModel/MainWindowVM.cs b/ViewModel/MainWindowVM.cs index 1e8f382..a3f9568 100644 --- a/ViewModel/MainWindowVM.cs +++ b/ViewModel/MainWindowVM.cs @@ -1335,7 +1335,14 @@ namespace ViewModel { EmgStop();// 急停信号 } - + if (InputList[4].LightUp) + { + ExcepStop(InputList[4].InputMeaning);// 急停信号 + } + if (InputList[26].LightUp) + { + ExcepStop(InputList[26].InputMeaning);// 急停信号 + } #endregion #region 获取轴状态 @@ -1559,7 +1566,9 @@ namespace ViewModel } else { - HotBarQingjieRun(QingjieFlow); + // HotBarQingjieRun(QingjieFlow); + CurrHandxiCount = 0; + ExcepStop("请清洁焊头"); } HuiLiuRun(HuiLiuRunFlow); @@ -1612,6 +1621,12 @@ namespace ViewModel } #endregion + DateTime upTime = DateTime.Now; + + int upType; + + bool upExsit, downExsit; + #region 双控气缸控制与IO马达控制 /// /// 双控气缸控制与IO马达控制 @@ -1632,10 +1647,44 @@ namespace ViewModel OutputList[6].Switchs = true; } + if (upTime.AddSeconds(0.1) < DateTime.Now && upType == 0) { + + upTime = DateTime.Now; + upType = 1; + + if (InputList[6].LightUp || (InputList[12].LightUp == false && InputList[14].LightUp == false) || RunStatu != RunStatuEnum.Normal) + { + SendFrontStation(VehicleRevoke); + + + } + else { + + SendFrontStation(VehicleRequest); + + } + + } //回流到位检知,向后站撤销要料 - if (InputList[11].LightUp) + if (upTime.AddSeconds(0.1) < DateTime.Now && upType == 1) { - SendFrontStation(BackflowRevoke); + + upTime = DateTime.Now; + upType = 0; + + if (InputList[9].LightUp || InputList[10].LightUp || InputList[11].LightUp || downExsit || RunStatu != RunStatuEnum.Normal) + { + SendFrontStation(BackflowRevoke); + + + } + else + { + + SendFrontStation(BackflowRequest); + + } + } } @@ -1689,7 +1738,7 @@ namespace ViewModel if (InputList[7].LightUp) { //向前站发送撤销载具请求 - SendFrontStation(VehicleRevoke); + upExsit = true; MyFlow.RunStep++; MyFlow.RunTime = DateTime.Now; //缓存阻挡下降 @@ -1697,8 +1746,7 @@ namespace ViewModel } else { - //向前站请求载具 - SendFrontStation(VehicleRequest); + upExsit = false; //上皮带正转 OutputList[8].Switchs = true; @@ -1724,7 +1772,7 @@ namespace ViewModel if ((InputList[7].LightUp && MyFlow.RunTime.AddMilliseconds(500) < DateTime.Now) || CurrentMachine.RunningMode) { //上皮带正转 - OutputList[8].Switchs = false; + //缓存阻挡下降 OutputList[4].Switchs = false; MyFlow.RunStep++; @@ -1799,7 +1847,8 @@ namespace ViewModel break; case GengralProcessEnum.Step9: //载具流出完成 - if (CurrNextStr != VehicleRequest) + //if (CurrNextStr != VehicleRequest) + if (!InputList[8].LightUp&& !InputList[7].LightUp) { //上皮带停转 OutputList[8].Switchs = false; @@ -2106,11 +2155,13 @@ namespace ViewModel //回流到位检知有 if (InputList[11].LightUp) { + downExsit = true; MyFlow.RunStep = GengralProcessEnum.Step10; MyFlow.RunTime = DateTime.Now; } else { + downExsit = false; MyFlow.RunStep = GengralProcessEnum.Step20; MyFlow.RunTime = DateTime.Now; } @@ -2154,15 +2205,15 @@ namespace ViewModel } else { - //向后站回流要料 - SendFrontStation(BackflowRequest); + } break; case GengralProcessEnum.Step21: //回流到位检知 if (InputList[11].LightUp) { - SendFrontStation(BackflowRevoke); + + OutputList[9].Switchs = false; //回流皮带 MyFlow.RunStep = GengralProcessEnum.Start; MyFlow.RunTime = DateTime.Now; @@ -2297,11 +2348,13 @@ namespace ViewModel /// private void SendFrontStation(string CommandStr) { - if (SendFrontStationTime.AddMilliseconds(500) < DateTime.Now) + if (FrontStation.Showmsg.StatusBackground == ColorStr.Green) { FrontStation.SendInfo(CommandStr); - CurrSendInfor = CommandStr; - SendFrontStationTime = DateTime.Now; + } + else { + + FrontStation.ConnectSwitch = !FrontStation.ConnectSwitch; } } #endregion @@ -2405,27 +2458,23 @@ namespace ViewModel #region 前站回调函数 /// - /// 载具请求 + /// 载具请求 03kx /// string VehicleRequest = "03kx"; /// - /// 撤销载具请求 + /// 撤销载具 03ml /// string VehicleRevoke = "03ml"; /// - /// 回流请求 + /// 回流请求 03hlkx /// string BackflowRequest = "03hlkx"; /// - /// 撤销回流 + /// 撤销回流 03hlml /// string BackflowRevoke = "03hlml"; - - /// - /// 送料请求 - /// - string SendRequest = "SLQQ;"; - + + /// /// 前站发来的字符串拆解 /// @@ -2454,7 +2503,7 @@ namespace ViewModel //string str1 = NewsList[2].Split(':')[1]; //string str2 = NewsList[9].Split(':')[1]; - if(str.Contains("02x:0")) + if(str.Contains("21x:0")) { CurrHuiliuStr = BackflowRequest;