Commit 5e3c2562 LN

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

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