Commit 8ba27dde 几米阳光

复位时增加清料功能

1 个父辈 9ee96ea1
......@@ -159,6 +159,10 @@ PRO,最后一盘料需要补充的高度,LastTrayAddHeight,10,,,,,,,,,
批量上下料功能修改。
20190508
复位完成后,增加清料功能。
......
......@@ -358,7 +358,7 @@ namespace OnlineStore.DeviceLibrary
public static void HomeMove(int slvAddr, byte homeType)
{
string fangx = homeType.Equals(0) ? "反方向" : "正方向";
LogUtil.info("压紧轴原点返回:" + fangx);
LogUtil.debug("压紧轴原点返回:" + fangx);
byte[] reviceData = SendData(slvAddr, ShuoKeCMD.HomeMove, 0x01, homeType, DReviceLength);
}
......
......@@ -362,11 +362,16 @@ namespace OnlineStore.DeviceLibrary
int slvAddr = Config.InOut_Axis.GetAxisValue();
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info(LOGGER, StoreName + "复位中,进出轴开始原点返回");
ResetLog("复位中,进出轴开始原点返回");
ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
ResetCloseDoor();
}
private void ResetLog(string msg)
{
LogUtil.info(LOGGER, StoreName + msg);
}
/// <summary>
/// 复位处理
/// </summary>
......@@ -388,14 +393,14 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_InOutMove:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
ACAxisHomeMove(Config.InOut_Axis);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴开始原点返回");
ResetLog( "复位中:进出轴开始原点返回");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
ResetCloseDoor();
break;
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "复位中:进出轴到待机点P1,压紧轴先相对走-2000");
ResetLog("复位中:进出轴到待机点P1,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ComBeforeHomeMove();
ResetCloseDoor();
......@@ -407,7 +412,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info(LOGGER, StoreName + "复位中: 压紧轴,旋转轴,上下轴开始 原点返回");
ResetLog("复位中: 压紧轴,旋转轴,上下轴开始 原点返回");
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (IsHasCompress_Axis)
{
......@@ -421,26 +426,23 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_OtherAxisBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到P7门口位置,压紧轴到P1!");
ResetLog("复位中:旋转轴到P1,上下轴到P7门口位置,压紧轴到P1");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "复位完成");
storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline;
if (alarmType.Equals(StoreAlarmType.None))
if (!StartResetOut())
{
WarnMsg = "";
ResetLog("复位完成");
ResetEnd();
}
break;
case StoreMoveStep.BOX_M_H_TOP1_InOutToP1:
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_CompressHome);
LogUtil.info(LOGGER, StoreName + "到待机状态,压紧轴回原点,关闭舱门");
ResetLog("到待机状态,压紧轴回原点");
if (IsHasCompress_Axis)
{
StoreMove.WaitList.Add(WaitResultInfo.WaitShuoKe(Config.CompressAxis_Slv, 1, true));
......@@ -449,26 +451,91 @@ namespace OnlineStore.DeviceLibrary
break;
case StoreMoveStep.BOX_M_H_TOP1_CompressHome:
StoreMove.NextMoveStep(StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1);
LogUtil.info(LOGGER, StoreName + "复位中:旋转轴运动到P1,上下轴走到门口位置P7,压紧轴到P1!");
ResetLog("复位中:旋转轴到P1,升降轴到门口位置P7,压紧轴到P1");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_M_H_TOP1_OtherAxisToP1:
LogUtil.info(LOGGER, StoreName + "到待机状态完成");
StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing;
if (alarmType.Equals(StoreAlarmType.None))
if (!StartResetOut())
{
WarnMsg = "";
ResetLog("到待机状态完成");
ResetEnd();
}
break;
case StoreMoveStep.BOX_R41_InoutToP4:
StoreMove.NextMoveStep(StoreMoveStep.BOX_R42_OpenDoor);
ResetLog("复位时清料:打开舱门");
OpenDoorAndWait();
break;
case StoreMoveStep.BOX_R42_OpenDoor:
StoreMove.NextMoveStep(StoreMoveStep.BOX_R43_WaitTrayGo);
ResetLog("复位时清料: 等待操作人员拿走料盘 ");
StoreMove.TimeOutSeconds = 120;
AutomaticBaiting.IsWaitTragGo = true;
AutomaticBaiting.IsGetTrayGo = false;
StoreMove.WaitList.Add(WaitResultInfo.WaitTakeTray());
break;
case StoreMoveStep.BOX_R43_WaitTrayGo:
if (IOManager.IOValue(IO_Type.SafetyLightCurtains).Equals(IO_VALUE.HIGH))
{
StoreMove.NextMoveStep(StoreMoveStep.BOX_R44_GoBack);
ResetLog("复位时清料:进出轴返回P1,关闭舱门");
ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed);
CloseDoorAndWait();
}
break;
case StoreMoveStep.BOX_R44_GoBack:
ResetLog("复位并清料完成");
ResetEnd();
break;
default: break;
}
}
private void ResetEnd()
{
StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline;
storeRunStatus = StoreRunStatus.Runing;
if (alarmType.Equals(StoreAlarmType.None))
{
WarnMsg = "";
}
}
private bool StartResetOut()
{
if (IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
{
if (IOManager.IOValue(IO_Type.SuckingDisc_Down).Equals(IO_VALUE.HIGH) ||
IOManager.IOValue(IO_Type.SuckingDisc_Up).Equals(IO_VALUE.LOW))
{
LogUtil.info(LOGGER, StoreName + "复位完成检测到叉子有料,启动清料失败:吸盘不在上升端");
return false;
}
if (PositionNumList.Count <= 0)
{
LogUtil.info(LOGGER, StoreName + "复位完成检测到叉子有料,启动清料失败:无可用库位");
return false;
}
InOutStoreParam param = new InOutStoreParam("", PositionNumList[0]);
if (LoadParamPosition(param, false))
{
StoreMove.MoveParam = param;
StoreMove.NextMoveStep(StoreMoveStep.BOX_R41_InoutToP4);
LogUtil.info(LOGGER, StoreName + "复位完成检测到叉子有料,启动清料: 叉子进出料口,进出轴至P4(仓门出料点)");
ACAxisMove(Config.InOut_Axis, param.MoveP.InOut_P4, Config.InOutAxis_P2_Speed);
return true;
}
else
{
LogUtil.error(LOGGER, StoreName + " 启动清料失败:【" + PositionNumList[0] + "】加载参数失败");
}
}
return false;
}
private void ComBeforeHomeMove()
{
if (IsHasCompress_Axis)
......@@ -574,7 +641,7 @@ namespace OnlineStore.DeviceLibrary
{
case StoreMoveStep.BOX_H_LocationCylinderBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutBack);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴回原点");
ResetLog("原点返回中,进出轴回原点");
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
ACAxisHomeMove(Config.InOut_Axis);
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(2000));
......@@ -583,7 +650,7 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_InOutBack:
Thread.Sleep(200);
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_InOutToP1);
LogUtil.info(LOGGER, StoreName + "原点返回中,进出轴退回P1点,关闭仓门,压紧轴先相对走-2000");
ResetLog("原点返回中,进出轴退回P1点,关闭仓门,压紧轴先相对走-2000");
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.InOutAxis_P1_Speed);
ComBeforeHomeMove();
ResetCloseDoor();
......@@ -597,7 +664,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, "进出轴报警!复位失败,请检查!");
}
//复位和回原点要等轴3进出轴ORG亮了以后才能返回其他轴
LogUtil.info(LOGGER, StoreName + "原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
ResetLog("原点返回中 :压紧轴,旋转轴,上下轴开始原点返回");
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_OtherAxisBack);
if (IsHasCompress_Axis)
{
......@@ -611,14 +678,14 @@ namespace OnlineStore.DeviceLibrary
case StoreMoveStep.BOX_H_OtherAxisBack:
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_MiddleAxisToP1);
LogUtil.info(LOGGER, StoreName + "回原点:旋转轴运动到P1,上下轴到门口位置P7,压紧轴到P1!");
ResetLog("回原点:旋转轴到P1,上下轴到门口位置P7,压紧轴到P1");
ACAxisMove(Config.Middle_Axis, Config.MiddleAxis_P1_Position, Config.MiddleAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, Config.UpDownAxis_Door_P7, Config.UpDownAxis_P7_Speed);
ComMoveToPosition(Config.CompressAxis_P1_Position);
CloseDoorAndWait();
break;
case StoreMoveStep.BOX_H_MiddleAxisToP1:
LogUtil.info(LOGGER, StoreName + "回原点完成");
ResetLog("回原点完成");
storeRunStatus = StoreRunStatus.Runing;
StoreMove.EndMove();
storeStatus = StoreStatus.StoreOnline;
......
......@@ -187,6 +187,25 @@ namespace OnlineStore.DeviceLibrary
/// 关闭门,旋转轴到P1,升降轴到P1
/// </summary>
BOX_M_H_TOP1_OtherAxisToP1 = 032,
/// <summary>
/// 复位时清料:复位时检测到叉子有料, ,进出轴到P4
/// </summary>
BOX_R41_InoutToP4 = 041,
/// <summary>
/// 复位时清料:打开仓门
/// </summary>
BOX_R42_OpenDoor = 042,
/// <summary>
/// 复位时清料:等待操作人员拿走料盘
/// </summary>
BOX_R43_WaitTrayGo = 043,
/// <summary>
/// 复位时清料:叉子后退,关闭舱门
/// </summary>
BOX_R44_GoBack = 044,
#endregion
......@@ -194,7 +213,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///料仓出库,,定位气缸下降
/// </summary>
SO_01_LocationCylinderDown=101,
SO_01_LocationCylinderDown =101,
/// <summary>
///料仓出库:叉子先运动到P1
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!