Commit 278b446e LN

入料模块修改:定位机构不在后退端时不能处理料架。

1 个父辈 63511bf5
...@@ -125,6 +125,8 @@ namespace OnlineStore.AssemblyLine ...@@ -125,6 +125,8 @@ namespace OnlineStore.AssemblyLine
//这里可以进一步地写日志 //这里可以进一步地写日志
LOGGER.Error("【" + type + "】" + exceptionobj); LOGGER.Error("【" + type + "】" + exceptionobj);
MessageBox.Show(exceptionobj, type); MessageBox.Show(exceptionobj, type);
LogUtil.error("【" + type + "】" + exceptionobj);
} }
} }
} }
...@@ -84,9 +84,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -84,9 +84,13 @@ namespace OnlineStore.DeviceLibrary
public override bool Reset() public override bool Reset()
{ {
runStatus = LineRunStatus.Reset;
StopMove(); StopMove();
MoveInfo.NewMove(LineMoveType.Reset);
SecondMoveInfo.EndMove();
if (RunAxis(true, BatchAxis) && RunAxis(true, UpdownAxis)) if (RunAxis(true, BatchAxis) && RunAxis(true, UpdownAxis))
{ {
alarmType = LineAlarmType.None; alarmType = LineAlarmType.None;
LogInfo("开始重置: "); LogInfo("开始重置: ");
runStatus = LineRunStatus.Reset; runStatus = LineRunStatus.Reset;
...@@ -289,8 +293,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -289,8 +293,8 @@ namespace OnlineStore.DeviceLibrary
internal override void StopMove() internal override void StopMove()
{ {
MoveInfo.EndMove(); //MoveInfo.EndMove();
SecondMoveInfo.EndMove(); //SecondMoveInfo.EndMove();
BatchAxisStopCheck(); BatchAxisStopCheck();
BatchAxis.SuddenStop(); BatchAxis.SuddenStop();
UpdownAxis.SuddenStop(); UpdownAxis.SuddenStop();
...@@ -325,7 +329,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -325,7 +329,8 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = false; mainTimer.Enabled = false;
} }
StopMove(); StopMove();
MoveInfo.EndMove();
SecondMoveInfo.EndMove();
} }
...@@ -613,7 +618,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -613,7 +618,7 @@ namespace OnlineStore.DeviceLibrary
lastOkTime = DateTime.Now; lastOkTime = DateTime.Now;
if (IOValue(TargetIoType).Equals(TargetIoValue)) if (IOValue(TargetIoType).Equals(TargetIoValue))
{ {
LogUtil.debug(Name + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",可以停止运动"); LogUtil.info(Name + "上料轴,检测到 " + TargetIoType + "=" + TargetIoValue + ",停止运动");
BatchAxis.SuddenStop(); BatchAxis.SuddenStop();
BatchAxisStopCheck(); BatchAxisStopCheck();
} }
......
...@@ -524,8 +524,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -524,8 +524,12 @@ namespace OnlineStore.DeviceLibrary
//若定位工位,阻挡工位,有 料架,需要进行处理 //若定位工位,阻挡工位,有 料架,需要进行处理
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH) || IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{ {
//升降盘需要在后退端
if (IsTrayLCylinderAfter())
{
StartInStoreMove(null); StartInStoreMove(null);
} }
}
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH)) else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{ {
//小车到达,开始处理 //小车到达,开始处理
...@@ -553,9 +557,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -553,9 +557,17 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
if (IsTrayLCylinderAfter())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After); MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降"); InLog("检测到料架, " + MoveInfo.MoveStep + " :升降盘定位气缸下降");
TrayLCylinderAfter(MoveInfo); TrayLCylinderAfter(MoveInfo);
}else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_00_BatchAxisToP2);
OutLog("检测到料架,升降盘不在后退端 " + MoveInfo.SLog + " :提升伺服先回到P2");
BatchAxis.AbsMove(MoveInfo, Config.BatchAxisP2, Config.BatchAxis_P2Speed);
}
} }
return true; return true;
} }
...@@ -621,11 +633,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -621,11 +633,11 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
#region 入料:料架进入并开始检测托盘 #region 入料:料架进入并开始检测托盘
if (MoveInfo.MoveStep.Equals(LineMoveStep.Wait)) if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_00_BatchAxisToP2))
{ {
//MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After); MoveInfo.NextMoveStep(LineMoveStep.FI_01_TrayLocation_After);
//InLog("料架入库" + MoveInfo.SLog + " :升降盘定位气缸下降"); InLog("料架入库" + MoveInfo.SLog + " :升降盘定位气缸下降");
//TrayLCylinderAfter(MoveInfo); TrayLCylinderAfter(MoveInfo);
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_01_TrayLocation_After)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_01_TrayLocation_After))
{ {
...@@ -1189,26 +1201,28 @@ namespace OnlineStore.DeviceLibrary ...@@ -1189,26 +1201,28 @@ namespace OnlineStore.DeviceLibrary
private void BatchAxisToP3(bool isFirstMove = true) private void BatchAxisToP3(bool isFirstMove = true)
{ {
int targetP3 = Config.BatchAxisP3; int targetP3 = Config.BatchAxisP3;
int targetSpeed = Config.BatchAxis_P3Speed;
if (!isFirstMove) if (!isFirstMove)
{ {
int currPosition = BatchAxis.GetAclPosition(); int currPosition = BatchAxis.GetAclPosition();
if (currPosition != -1) if (currPosition != -1)
{ {
targetP3 = currPosition + Config.Height_ChangeValue * 100; targetP3 = currPosition + Config.Height_ChangeValue * 80;
if (targetP3 > Config.BatchAxisP3) if (targetP3 > Config.BatchAxisP3)
{ {
targetP3 = Config.BatchAxisP3; targetP3 = Config.BatchAxisP3;
} }
LogUtil.info(Name + " BatchAxisToP3 目标P3: " + targetP3 + "(" + currPosition + ")"); LogUtil.info(Name + " BatchAxisToP3 目标P3: " + targetP3 + "(" + currPosition + ")");
} }
targetSpeed = Config.BatchAxis_P3Speed / 2;
} }
MoveInfo.TimeOutSeconds = 200; MoveInfo.TimeOutSeconds = 200;
MoveInfo.CanWhileCount = 0; MoveInfo.CanWhileCount = 0;
// 需要增加定时器,获取验证信号并停止伺服 // 需要增加定时器,获取验证信号并停止伺服
StartMovePosition = BatchAxis.GetAclPosition(); StartMovePosition = BatchAxis.GetAclPosition();
MoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxis(Config.Batch_Axis, targetP3, Config.BatchAxis_P3Speed)); MoveInfo.WaitList.Add(WaitResultInfo.WaitBatchAxis(Config.Batch_Axis, targetP3, targetSpeed));
Config.Batch_Axis.TargetPosition = targetP3; Config.Batch_Axis.TargetPosition = targetP3;
BatchAxis.AbsMove(null, targetP3, Config.BatchAxis_P3Speed); BatchAxis.AbsMove(null, targetP3, targetSpeed);
//开始检测信号 //开始检测信号
BatchAxisStartCheck(); BatchAxisStartCheck();
} }
......
...@@ -175,7 +175,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,7 +175,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NewMove(LineMoveType.OutStore); MoveInfo.NewMove(LineMoveType.OutStore);
MoveInfo.MoveParam = new InOutParam(); MoveInfo.MoveParam = new InOutParam();
taskData = null; taskData = null;
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH)&& IsTrayLCylinderAfter())
{ {
FO_04_WaitTime(); FO_04_WaitTime();
} }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!