Commit 5e3c2562 LN

出库时先判断仓门口有位置才能出库

1 个父辈 8312c34d
......@@ -642,8 +642,11 @@ namespace OnlineStore.DeviceLibrary
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{
SaveAlarmInfo(alarmType, alarmDetial, alarmMsg, storeMoveType);
autoNext = false;
if (autoNext)
{
autoNext = false;
LogUtil.error(LOGGER, StoreName + " Alarm 报警,报警类型:" + alarmType + ",停止自动出入库");
}
if (this.alarmType.Equals(alarmType) && alarmType != StoreAlarmType.SuddenStop && alarmType != StoreAlarmType.NoAirCheck)
{
return;
......
......@@ -544,8 +544,33 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】出错, " + doorMsg);
return false;
}
//判断对应托架是否有料盒
int shelfType = param.PosInfo.ShelfType;
if (shelfType.Equals(1) && IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check 信号亮 ");
return false;
}
else if (shelfType.Equals(2) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,RightShelf_Check 信号亮 ");
return false;
}
else if (shelfType.Equals(0))
{
//如果两侧都有料
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.HIGH) && IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.HIGH))
{
LogUtil.error(LOGGER, StoreName + " 启动出库【" + posId + "】【" + shelfType + "】出错,LeftShelf_Check信号亮, RightShelf_Check 信号亮 ");
return false;
}
}
storeStatus = StoreStatus.OutStoreExecute;
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】 ", storeMoveColor);
LogUtil.info(LOGGER, StoreName + "启动出库【" + posId + "】【"+ shelfType + "】 ", storeMoveColor);
storeRunStatus = StoreRunStatus.Busy;
StoreMove.NewMove(StoreMoveType.OutStore, param);
......@@ -651,58 +676,40 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_08_UpdownBack)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_09_ToDoorPosition);
OutStoreLog("出库:前后轴至P1(待机点) [" + moveP.Middle_P1 + "] ");
// ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P2, Config.UpDownAxis_P2_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
// ShelfBack(StoreMove.MoveParam.PosInfo.ShelfType, StoreMove);
OutStoreLog("出库:前后轴至P1(待机点) [" + moveP.Middle_P1 + "] ");
ACAxisMove(Config.Middle_Axis, moveP.Middle_P1, Config.MiddleAxis_P1_Speed);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_09_ToDoorPosition)
{
WaitNoTray(StoreMoveStep.SO_10_WaitNoTray);
//SO_10_DeviceToDoorPro();
StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库:等待托架无料 [" + shelfType + "] ");
if (shelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
}
else if (shelfType.Equals(2))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
}
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
}
//StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
//int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
//OutStoreLog("出库:等待托架无料 [" + shelfType + "] ");
//if (shelfType.Equals(1))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
//}
//else if (shelfType.Equals(2))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
//}
//if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
//{
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
// StoreMove.OneWaitCanEndStep = true;
//}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_10_WaitNoTray)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
if (!CheckLeft(StoreMoveStep.SO_10_WaitNoTray))
{
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 1;
StoreMove.MoveParam.UpdateShelfType(1, Config);
OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else if (IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 2;
StoreMove.MoveParam.UpdateShelfType(2, Config);
OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库: 再次 等待托架无料 [" + shelfType + "] ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
}
return;
}
if (StoreMove.MoveParam.PosInfo.ShelfType > 0)
......@@ -715,9 +722,21 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_11_ShelfBack)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_12_InoutToP2);
OutStoreLog("出库: 叉子进出料口,进出轴至P2(进料口取料点) [" + moveP.InOut_P2 + "] ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
WaitNoTray(StoreMoveStep.SO_12_WaitNoTray);
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_WaitNoTray)
{
if (!CheckLeft(StoreMoveStep.SO_12_WaitNoTray))
{
return;
}
if (StoreMove.MoveParam.PosInfo.ShelfType > 0)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_12_InoutToP2);
OutStoreLog("出库: 叉子进出料口,进出轴至P2(进料口取料点) [" + moveP.InOut_P2 + "] ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P2, Config.InOutAxis_P2_Speed);
}
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_12_InoutToP2)
{
......@@ -765,7 +784,7 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(LOGGER, StoreName + " 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!", storeMoveColor);
StoreMove.EndMove();
storeRunStatus = StoreRunStatus.Runing;
InOutEndProcess(StoreMoveType.OutStore,posId);
InOutEndProcess(StoreMoveType.OutStore, posId);
}
else
{
......@@ -774,11 +793,62 @@ namespace OnlineStore.DeviceLibrary
}
private bool CheckLeft(StoreMoveStep sO_10_WaitNoTray)
{
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
{
if (IOManager.IOValue(IO_Type.LeftShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 1;
StoreMove.MoveParam.UpdateShelfType(1, Config);
OutStoreLog(" 出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else if (IOManager.IOValue(IO_Type.RightShelf_Check).Equals(IO_VALUE.LOW))
{
//StoreMove.MoveParam.PosInfo.ShelfType = 2;
StoreMove.MoveParam.UpdateShelfType(2, Config);
OutStoreLog("出库: 当前未设置ShelfType,默认ShelfType=" + StoreMove.MoveParam.PosInfo.ShelfType);
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.SO_10_WaitNoTray);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库: 再次 等待托架无料 [" + shelfType + "] ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
return false;
}
}
return true;
}
#endregion
public List<InOutPosInfo> waitOutStoreList = new List<InOutPosInfo>();
public object waitOutListLock = "";
private void WaitNoTray(StoreMoveStep step)
{
StoreMove.NextMoveStep(step);
int shelfType = StoreMove.MoveParam.PosInfo.ShelfType;
OutStoreLog("出库:等待托架无料 [" + shelfType + "] ");
if (shelfType.Equals(1))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
}
else if (shelfType.Equals(2))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(300));
}
if (StoreMove.MoveParam.PosInfo.ShelfType.Equals(0))
{
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LeftShelf_Check, IO_VALUE.LOW));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.RightShelf_Check, IO_VALUE.LOW));
StoreMove.OneWaitCanEndStep = true;
}
}
public void AddWaitOutInfo(InOutPosInfo code)
{
lock (waitOutListLock)
......
......@@ -220,28 +220,31 @@ namespace OnlineStore.DeviceLibrary
/// 出库:托架后退
/// </summary>
SO_11_ShelfBack = 111,
SO_12_WaitNoTray=112,
/// <summary>
/// 出库:叉子进出料口,,轴3( 叉子) 至P2( 进料口取料点)
/// /// </summary>
SO_12_InoutToP2 = 112,
SO_12_InoutToP2,
/// <summary>
/// 出库:把物品放下,,轴2( 上下) 至P8( 进料口出料缓冲点)轴4( 压紧) 至P1( 待机点)
/// </summary>
SO_13_PutWare = 113,
SO_13_PutWare,
/// <summary>
/// 出库:叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary>
SO_14_InoutToP1 = 114,
SO_14_InoutToP1,
/// <summary>
/// 出库:判断物料信号
/// </summary>
SO_15_CheckShelfDI = 115,
SO_15_CheckShelfDI,
/// <summary>
/// 出库:升降轴返回,, 轴2至P1( 待机点)
/// </summary>
SO_16_GoBack = 116,
SO_16_GoBack,
///// <summary>
///// 等待拿走物品
///// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!