This commit is contained in:
tfarcraw 2026-12-04 14:29:35 +08:00
parent 4fbbb28348
commit 4a799ff73e
2 changed files with 76 additions and 29 deletions

View File

@ -231,9 +231,7 @@
<Resource Include="Resources\logo1.ico" />
</ItemGroup>
<ItemGroup>
<Content Include="Data\DataBase.accdb">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Data\DataBase.accdb" />
<Resource Include="Resources\23.jpg" />
<Resource Include="Resources\24.jpg" />
<Resource Include="Resources\25.jpg" />

View File

@ -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马达控制
/// <summary>
/// 双控气缸控制与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
/// <param name="CommandStr"></param>
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 前站回调函数
/// <summary>
/// 载具请求
/// 载具请求 03kx
/// </summary>
string VehicleRequest = "03kx";
/// <summary>
/// 撤销载具请求
/// 撤销载具 03ml
/// </summary>
string VehicleRevoke = "03ml";
/// <summary>
/// 回流请求
/// 回流请求 03hlkx
/// </summary>
string BackflowRequest = "03hlkx";
/// <summary>
/// 撤销回流
/// 撤销回流 03hlml
/// </summary>
string BackflowRevoke = "03hlml";
/// <summary>
/// 送料请求
/// </summary>
string SendRequest = "SLQQ;";
/// <summary>
/// 前站发来的字符串拆解
/// </summary>
@ -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;