Commit aaefa1eb LN

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

1 个父辈 f1c775ee
......@@ -552,50 +552,53 @@ namespace OnlineStore.AssemblyLine
try
{
LogM();
try
if (lineBean.runStatus > LineRunStatus.Wait)
{
if (SServerManager.stopRun(Name))
try
{
if (!stopRequest)
if (SServerManager.stopRun(Name))
{
stopTime = DateTime.Now;
stopRequest = true;
//lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
if (!stopRequest)
{
stopTime = DateTime.Now;
stopRequest = true;
//lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
}
if (!stopRun && stopRequest && (DateTime.Now - stopTime).TotalSeconds > 40)
{
stopRun = true;
lineBean.LineStopRun = true;
//停止所有料仓TToolStripMenuItem_Click(null, null);
if (lineBean.LineCanStop())
{
LogUtil.info("收到服务端停机要求,直接停止环形线");
lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
}
else
{
LogUtil.info("收到服务端停机要求,横移还有托盘,等托盘离开后再停止环形线");
}
}
}
if (!stopRun && stopRequest && (DateTime.Now - stopTime).TotalSeconds > 40)
else
{
stopRun = true;
lineBean.LineStopRun = true;
//停止所有料仓TToolStripMenuItem_Click(null, null);
if (lineBean.LineCanStop())
if (stopRun)
{
LogUtil.info("收到服务端停机要求,直接停止环形线");
lineBean.WriteDrivetMotorRun(IO_VALUE.LOW);
}
else
{
LogUtil.info("收到服务端停机要求,横移还有托盘,等托盘离开后再停止环形线");
lineBean.LineStopRun = false;
lineBean.WriteDrivetMotorRun(IO_VALUE.HIGH);
//启动所有料仓AToolStripMenuItem_Click(null, null);
stopRun = false;
LogUtil.info("收到服务端开机要求,启动环形线");
}
stopRequest = false;
}
}
else
catch { lineBean.WriteDrivetMotorRun(IO_VALUE.HIGH); }
if (!this.Visible)
{
if (stopRun)
{
lineBean.LineStopRun = false;
lineBean.WriteDrivetMotorRun(IO_VALUE.HIGH);
//启动所有料仓AToolStripMenuItem_Click(null, null);
stopRun = false;
LogUtil.info("收到服务端开机要求,启动环形线");
}
stopRequest = false;
return;
}
}
catch { lineBean.WriteDrivetMotorRun(IO_VALUE.HIGH); }
if (!this.Visible)
{
return;
}
string canScanCode = "";
if (AgvClient.CurrCancelState)
{
......
......@@ -362,6 +362,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int position = Config.GetUpdownP2Detial(trayHeight,traySize);
UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed);
MoveInfo.IsUpdownAxisMove = true;
}
else
{
......
......@@ -243,6 +243,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
int position = Config.GetUpdownP2Detial(trayHeight,traySize);
UpdownAxis.AbsMove(MoveInfo, position, Config.UpdownAxis_P2Speed);
MoveInfo.IsUpdownAxisMove = true;
}
else
{
......
......@@ -145,6 +145,7 @@ namespace OnlineStore.DeviceLibrary
//判断是否需要重新运动
if (MoveInfo.CanWhileCount > 0)
{
bool needHomeMove = MoveInfo.IsUpdownAxisMove;
string clearMsg = "";
//判断轴是否报警
if (MoveInfo.CanWhileCount <= 3)
......@@ -157,18 +158,31 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(200);
ACServerManager.ServoOn(deviceName, axisNo);
Thread.Sleep(500);
}
}
}
if (String.IsNullOrEmpty(clearMsg))
{
{
ACServerManager.SuddenStop(axis.DeviceName, axis.GetAxisValue());
Thread.Sleep(100);
}
LogUtil.error(MoveInfo.Name + axis.DisplayStr + "目标位置[" + targetPosition + "]当前位置[" + outCount +
"],误差过大,"+clearMsg+"重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
Thread.Sleep(200);
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 +
"],误差过大," + clearMsg + "重新开始运动,剩余[" + MoveInfo.CanWhileCount + "]次");
ACServerManager.AbsMove(axis.DeviceName, axis.GetAxisValue(), targetPosition, targetSpeed);
MoveInfo.CanWhileCount--;
Thread.Sleep(200);
}
}
else
{
......
......@@ -79,6 +79,8 @@ namespace OnlineStore.DeviceLibrary
/// 可以循环运动的次数(轴卡运动才需要)
/// </summary>
public int CanWhileCount = 0;
public bool IsUpdownAxisMove = false;
/// <summary>
/// 料仓运动步骤记录
/// </summary>
......@@ -153,6 +155,7 @@ namespace OnlineStore.DeviceLibrary
WriteIoList = new List<WriteIOInfo>();
OneWaitCanEndStep = false;
CanWhileCount = 5;
IsUpdownAxisMove = false;
}
private void StepMoveLog()
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!