Browse Source

GGG

master
taoye 2 years ago
parent
commit
9f00f934f6
2 changed files with 35 additions and 13 deletions
  1. +34
    -12
      HBLConsole.MORKD/Control_MORKD.cs
  2. +1
    -1
      HBLConsole.MORKD/GVL_MORKD.cs

+ 34
- 12
HBLConsole.MORKD/Control_MORKD.cs View File

@@ -255,7 +255,7 @@ namespace HBLConsole.MORKD
mORKD.DropBowlStart((ushort)(mORKD.AxisIdleIndex + 1), orderLocInfo.Loc);
mORKD.AxisIdleLock[mORKD.AxisIdleLockIndex] = true;
MessageLog.GetInstance.Show($"执行取碗控制,碗位置:[{orderLocInfo.Loc}],轴位置:[{mORKD.AxisIdleIndex + 1}]");
MessageLog.GetInstance.Show($"{mORKD.AxisIdleIndex}号轴订单ID:[{orderLocInfo.SuborderId}]");
MessageLog.GetInstance.Show($"{mORKD.AxisIdleIndex + 1}号轴订单ID:[{orderLocInfo.SuborderId}]");
}
}
}
@@ -269,15 +269,18 @@ namespace HBLConsole.MORKD
{
if (mORKD.TurntableInPlace && mORKD.InitComplete && !mORKD.AllowTakeNoodle && mORKD.RBTakeNoodleTask.Count > 0)
{
var result = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == mORKD.RBTakeNoodleTask.ElementAt(0).BatchingId).ToList();
if (mORKD.TurntableLowerLimit)
{
if (mORKD.TurntableFeedbackloc == mORKD.RBTakeNoodleTask.ElementAt(0).Loc)
if (mORKD.TurntableFeedbackloc == mORKD.RBTakeNoodleTask.ElementAt(0).Loc || (result?.Count > 0 && result?.Count == mORKD.TurntableLocLists.Count))
{
mORKD.TurntableLocLists.Clear();
mORKD.AllowTakeNoodle = true;
MessageLog.GetInstance.Show("转台位置OK,执行机器人取面");
}
else
else
{
if (!mORKD.TurntableInterlock)
{
@@ -290,20 +293,39 @@ namespace HBLConsole.MORKD
{
if (!mORKD.TurntableInterlock)
{
var result = Json<BatchingInfoPar>.Data.orderMaterialDelivery.BatchingInfo.Where(p => p.BatchingId == mORKD.RBTakeNoodleTask.ElementAt(0).BatchingId).ToList();
result?.ForEach(item =>
if (result!= null)
{
if (ushort.TryParse(item.BatchingLoc, out ushort loc))
foreach (var item in result)
{
if (mORKD.TurntableFeedbackloc != loc && !mORKD.TurntableLocLists.Contains(loc))
if (ushort.TryParse(item.BatchingLoc, out ushort loc))
{
mORKD.TurntableStart(loc);
MessageLog.GetInstance.Show($"没有物料检测的启动转台控制,转台位置:[{loc}]");
return;
if (mORKD.TurntableFeedbackloc != loc && !mORKD.TurntableLocLists.Contains(loc))
{
mORKD.TurntableStart(loc);
MessageLog.GetInstance.Show($"没有物料检测的启动转台控制,转台位置:[{loc}]");
break;
}
else if (mORKD.TurntableFeedbackloc == loc && !mORKD.TurntableLocLists.Contains(loc)) mORKD.TurntableLocLists.Add(loc);
}
else if (mORKD.TurntableFeedbackloc == loc) mORKD.TurntableLocLists.Add(loc);
}
});
}
//result?.ForEach(item =>
//{
// if (ushort.TryParse(item.BatchingLoc, out ushort loc))
// {
// if (mORKD.TurntableFeedbackloc != loc && !mORKD.TurntableLocLists.Contains(loc))
// {
// mORKD.TurntableStart(loc);
// MessageLog.GetInstance.Show($"没有物料检测的启动转台控制,转台位置:[{loc}]");
// return;
// }
// else if (mORKD.TurntableFeedbackloc == loc) mORKD.TurntableLocLists.Add(loc);
// }
//});
}

}


+ 1
- 1
HBLConsole.MORKD/GVL_MORKD.cs View File

@@ -85,7 +85,7 @@ namespace HBLConsole.MORKD
{
this.TurntableLoc = TurntableLoc;
TurntableInterlock = true;
TurntableLocLists.Add(TurntableLoc);
if (!TurntableLocLists.Contains(TurntableLoc)) TurntableLocLists.Add(TurntableLoc);
ModbusTcpHelper.GetInstance.Write(100, WriteType.HoldingRegisters, TurntableLoc);
ModbusTcpHelper.GetInstance.Write(325, WriteType.Coils, true);
}


Loading…
Cancel
Save