Commit aaefa1eb LN

从托盘上抓料伺服运动不到位时自动回次原点。

1 个父辈 f1c775ee
...@@ -552,6 +552,8 @@ namespace OnlineStore.AssemblyLine ...@@ -552,6 +552,8 @@ namespace OnlineStore.AssemblyLine
try try
{ {
LogM(); LogM();
if (lineBean.runStatus > LineRunStatus.Wait)
{
try try
{ {
if (SServerManager.stopRun(Name)) if (SServerManager.stopRun(Name))
...@@ -596,6 +598,7 @@ namespace OnlineStore.AssemblyLine ...@@ -596,6 +598,7 @@ namespace OnlineStore.AssemblyLine
{ {
return; return;
} }
}
string canScanCode = ""; string canScanCode = "";
if (AgvClient.CurrCancelState) if (AgvClient.CurrCancelState)
{ {
......
...@@ -362,6 +362,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -362,6 +362,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int position = Config.GetUpdownP2Detial(trayHeight,traySize); int position = Config.GetUpdownP2Detial(trayHeight,traySize);
UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed);
MoveInfo.IsUpdownAxisMove = true;
} }
else else
{ {
......
...@@ -243,6 +243,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -243,6 +243,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int position = Config.GetUpdownP2Detial(trayHeight,traySize); int position = Config.GetUpdownP2Detial(trayHeight,traySize);
UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed); UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed);
MoveInfo.IsUpdownAxisMove = true;
} }
else else
{ {
......
...@@ -145,6 +145,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -145,6 +145,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动 //判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0) if (MoveInfo.CanWhileCount > 0)
{ {
bool needHomeMove = MoveInfo.IsUpdownAxisMove;
string clearMsg = ""; string clearMsg = "";
//判断轴是否报警 //判断轴是否报警
if (MoveInfo.CanWhileCount <= 3) if (MoveInfo.CanWhileCount <= 3)
...@@ -164,12 +165,25 @@ namespace OnlineStore.DeviceLibrary ...@@ -164,12 +165,25 @@ namespace OnlineStore.DeviceLibrary
ACServerManager.SuddenStop(axis.DeviceName, axis.GetAxisValue()); ACServerManager.SuddenStop(axis.DeviceName, axis.GetAxisValue());
Thread.Sleep(100); Thread.Sleep(100);
} }
if (needHomeMove && MoveInfo.CanWhileCount == 3)
{
LogUtil.error(MoveInfo.Name + axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大," + clearMsg + "自动回原点一次后再开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.HomeMove(axis.DeviceName, axis.GetAxisValue(), axis.HomeHighSpeed);
MoveInfo.CanWhileCount--;
Thread.Sleep(200);
}
else
{
LogUtil.error(MoveInfo.Name + axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount + LogUtil.error(MoveInfo.Name + axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,"+clearMsg+"重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次"); "],误差过大," + clearMsg + "重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed); ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--; MoveInfo.CanWhileCount--;
Thread.Sleep(200); Thread.Sleep(200);
} }
}
else else
{ {
msg = " " + MoveInfo.SLog + MoveInfo.Name + axis.DisplayStr + ",目标位置[" + targetPosition + "]当前位置[" + outCount msg = " " + MoveInfo.SLog + MoveInfo.Name + axis.DisplayStr + ",目标位置[" + targetPosition + "]当前位置[" + outCount
......
...@@ -79,6 +79,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -79,6 +79,8 @@ namespace OnlineStore.DeviceLibrary
/// 可以循环运动的次数(轴卡运动才需要) /// 可以循环运动的次数(轴卡运动才需要)
/// </summary> /// </summary>
public int CanWhileCount = 0; public int CanWhileCount = 0;
public bool IsUpdownAxisMove = false;
/// <summary> /// <summary>
/// 料仓运动步骤记录 /// 料仓运动步骤记录
/// </summary> /// </summary>
...@@ -153,6 +155,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -153,6 +155,7 @@ namespace OnlineStore.DeviceLibrary
WriteIoList = new List<WriteIOInfo>(); WriteIoList = new List<WriteIOInfo>();
OneWaitCanEndStep = false; OneWaitCanEndStep = false;
CanWhileCount = 5; CanWhileCount = 5;
IsUpdownAxisMove = false;
} }
private void StepMoveLog() private void StepMoveLog()
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!