Commit 7912e6c9 LN

上料模块优化。

1 个父辈 b9f4f420
...@@ -21,8 +21,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -21,8 +21,11 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(TargetIoType).Equals(TargetIoValue)) if (IOValue(TargetIoType).Equals(TargetIoValue))
{ {
LogUtil.debug(Name+"CheckWaitResult 检测到" + TargetIoType + "=" + TargetIoValue + ",停止运行"); LogUtil.debug(Name+"CheckWaitResult 检测到" + TargetIoType + "=" + TargetIoValue + ",停止运行");
BatchAxis.SuddenStop();
BatchAxisStopCheck(); BatchAxisStopCheck();
if (ACServerManager.GetBusyStatus(wait.AxisInfo.DeviceName, wait.AxisInfo.GetAxisValue()).Equals(1))
{
BatchAxis.SuddenStop();
}
return true; return true;
} }
else else
...@@ -730,16 +733,40 @@ namespace OnlineStore.DeviceLibrary ...@@ -730,16 +733,40 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_18_WaitNoLocationCheck))
{ {
MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3); MoveInfo.NextMoveStep(LineMoveStep.FI_19_BatchAxisToP3);
InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升"); InLog("料盘移栽" + MoveInfo.SLog + ":提升伺服运动到P3,横移气缸上升 或到放料端");
if (CylinderIsOk(IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up))
{
CylinderMove(null, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up); CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
BatchAxisToP3(); BatchAxisToP3();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_19_BatchAxisToP3))
{ {
// MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
if (MoveCylineCanTakeOrGive())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Take, IO_Type.SL_MoveCylinder_Give);
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize); MoveInfo.NextMoveStep(LineMoveStep.FI_20_SaveSize);
LastHeight = GetHeight(); InLog("料盘移栽" + MoveInfo.SLog + ":上料横移气缸放料SOL前先上升横移气缸");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
LastWidth = GetWidth(); LastWidth = GetWidth();
LastHeight = GetHeight();
if (LastWidth.Equals(7) && LastHeight > 16)
{
LogUtil.error(Name + "计算后高度" + LastWidth + "X" + LastHeight + ",七寸盘默认最高盘高=16,修改高度为16");
LastHeight = 16;
}
//判断是否还有料盘 //判断是否还有料盘
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW))
{ {
...@@ -1120,7 +1147,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -1120,7 +1147,7 @@ namespace OnlineStore.DeviceLibrary
{ {
isLast = true; isLast = true;
} }
float height = (float)Math.Ceiling(1F * (EndMovePosition - StartMovePosition) / AxisChangeValue); float height = (float)Math.Ceiling(1F * Math.Abs(EndMovePosition - StartMovePosition) / AxisChangeValue);
string buchongStr = ""; string buchongStr = "";
if (isLast) if (isLast)
{ {
......
...@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -393,7 +393,7 @@ namespace OnlineStore.DeviceLibrary
{ {
return GetActualtPosition(axis.DeviceName, axis.GetAxisValue()); return GetActualtPosition(axis.DeviceName, axis.GetAxisValue());
} }
public static int GetActualtPosition(string portName, int slvAddr,int rGetCount=2) public static int GetActualtPosition(string portName, int slvAddr,int rGetCount=3)
{ {
PreReadAddr = ACCMDManager.ActualPosition; PreReadAddr = ACCMDManager.ActualPosition;
byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadRegisters, ACCMDManager.ActualPosition, "0000", 2); byte[] dataArray = ACCMDManager.GetWriteData(slvAddr, ACCMDManager.CMD_ReadRegisters, ACCMDManager.ActualPosition, "0000", 2);
...@@ -412,7 +412,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -412,7 +412,7 @@ namespace OnlineStore.DeviceLibrary
{ {
LogUtil.error("第" + i + "次获取" + portName + "_" + slvAddr + "的实时位置" + result); LogUtil.error("第" + i + "次获取" + portName + "_" + slvAddr + "的实时位置" + result);
} }
Thread.Sleep(100); Thread.Sleep(180);
} }
return result; return result;
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!