Commit b80344c7 LN

入库时不判断料盘检测。出库放到仓门口时,如果没有料盘,发送取消任务给服务器。

1 个父辈 f7c25fd2
...@@ -44,3 +44,10 @@ ...@@ -44,3 +44,10 @@
入库时,回到仓门后在检测叉子上是否有料盘。 入库时,回到仓门后在检测叉子上是否有料盘。
20200924
大料盘定位时,第二次定位需要压紧轴放松,在压紧。
20201009
入库时暂不判断是否有料盘
出库时不判断叉子上是否有料盘,待料盘放到仓门口时,如果没有料盘,发送提示信息到服务器,并调用取消任务接口
...@@ -1580,9 +1580,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -1580,9 +1580,6 @@ namespace OnlineStore.DeviceLibrary
if (WarnMsg.Equals("")) if (WarnMsg.Equals(""))
{ {
boxStatus.msg = CodeMsg;
lineOperation.msg = CodeMsg;
}
if (CodeMsg.Equals("")) if (CodeMsg.Equals(""))
{ {
if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH)) if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOManager.IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
...@@ -1591,7 +1588,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -1591,7 +1588,14 @@ namespace OnlineStore.DeviceLibrary
lineOperation.msg = "叉子料盘检测有料,请检查"; lineOperation.msg = "叉子料盘检测有料,请检查";
} }
} }
else
{
boxStatus.msg = CodeMsg;
lineOperation.msg = CodeMsg;
LogUtil.info("给服务器发送报警:" + CodeMsg);
CodeMsg = ""; CodeMsg = "";
}
}
//WarnMsg = ""; //WarnMsg = "";
//状态 //状态
boxStatus.status = (int)storeStatus; boxStatus.status = (int)storeStatus;
......
...@@ -172,11 +172,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -172,11 +172,11 @@ namespace OnlineStore.DeviceLibrary
{ {
wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOManager.IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut; int timeOutMs = Config.IOSingle_TimerOut;
if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_28_WaitTake)) if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_29_WaitTake))
{ {
timeOutMs = 650000; timeOutMs = 650000;
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_26_CheckTray)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray))
{ {
timeOutMs = 5000; timeOutMs = 5000;
} }
...@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -199,7 +199,7 @@ namespace OnlineStore.DeviceLibrary
isOk = false; isOk = false;
break; break;
} }
else if ((!wait.IsEnd) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_28_WaitTake) && LineConnect.CanReSend()) else if ((!wait.IsEnd) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_29_WaitTake) && LineConnect.CanReSend())
{ {
//判断是否需要重发入库结束命令 //判断是否需要重发入库结束命令
SendOutStoreEnd(StoreMove); SendOutStoreEnd(StoreMove);
...@@ -307,16 +307,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,16 +307,14 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute; storeStatus = StoreStatus.InStoreExecute;
StoreMove.NewMove(StoreMoveType.InStore, param); StoreMove.NewMove(StoreMoveType.InStore, param);
//if (isNeedCheckIO)
//{ ////料盘检测
//料盘检测 //InStoreLog(" 入库:SI_00 入库等待仓门口料盘信号");
InStoreLog(" 入库:SI_00 入库等待仓门口料盘信号"); //StoreMove.NextMoveStep(StoreMoveStep.SI_00_TrayCheck);
StoreMove.NextMoveStep(StoreMoveStep.SI_00_TrayCheck); //StoreMove.TimeOutSeconds = 5;
StoreMove.TimeOutSeconds = 5; //StoreMove.WaitList.Add(WaitResultInfo.WaitTime(100));
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(100)); //StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
// StoreMove.WaitList.Add(WaitResultInfo.WaitTime(10000));
// StoreMove.OneWaitCanEndStep = true;
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.HIGH))
{ {
doorCheckWatch.Restart(); doorCheckWatch.Restart();
...@@ -325,11 +323,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -325,11 +323,9 @@ namespace OnlineStore.DeviceLibrary
{ {
doorCheckWatch.Stop(); doorCheckWatch.Stop();
} }
//}
//else SI_02_Move(param.MoveP);
//{
// SI_02_Move(param.MoveP);
//}
} }
else else
{ {
...@@ -424,7 +420,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -424,7 +420,7 @@ namespace OnlineStore.DeviceLibrary
if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW)) if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{ {
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
CodeMsg = "入库[" + posId + "]叉子去取料前,未检测到进料口有料"; CodeMsg = "" + posId + "_"+StoreMove.MoveParam.PosInfo.barcode+"_空入";
LogUtil.error(CodeMsg); LogUtil.error(CodeMsg);
} }
StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome); StoreMove.NextMoveStep(StoreMoveStep.SI_03_ReturnHome);
...@@ -452,18 +448,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -452,18 +448,8 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome) else if (StoreMove.MoveStep == StoreMoveStep.SI_03_ReturnHome)
{ {
//if (IsHasCompress_Axis)
//{
//StoreMove.NextMoveStep(StoreMoveStep.SI_04_CompressWare);
//InStoreLog("入库:SI_04_CompressWare 压紧轴至P3(压紧前点)[" + moveP.ComPress_P3 + "] 开始");
//ComMoveToPosition(moveP.ComPress_P3, Config.CompAxis_P3_Speed);
//OpenDoor();
//}
//else
{
SI_05_DeviceToDoor(); SI_05_DeviceToDoor();
} }
}
else if (StoreMove.MoveStep == StoreMoveStep.SI_04_CompressWare) else if (StoreMove.MoveStep == StoreMoveStep.SI_04_CompressWare)
{ {
SI_05_DeviceToDoor(); SI_05_DeviceToDoor();
...@@ -749,11 +735,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -749,11 +735,13 @@ namespace OnlineStore.DeviceLibrary
{ {
StoreMove.NextMoveStep(StoreMoveStep.SOL_17_UpdownToP42); StoreMove.NextMoveStep(StoreMoveStep.SOL_17_UpdownToP42);
OutStoreLog("出库定位2:放下物品,升降轴到P4( 库位入料缓冲点) "); OutStoreLog("出库定位2:放下物品,升降轴到P4( 库位入料缓冲点) ");
//压紧轴放松,压紧轴到压紧前点P3
ACAxisMove(Config.Comp_Axis, StoreMove.MoveParam.LocationPos.CompressAxis_CPosition_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.LocationPos.UpDownAxis_ILPosition_P4, Config.UpDownAxis_P4_Speed); ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.LocationPos.UpDownAxis_ILPosition_P4, Config.UpDownAxis_P4_Speed);
} }
else if (StoreMove.MoveStep == StoreMoveStep.SOL_17_UpdownToP42) else if (StoreMove.MoveStep == StoreMoveStep.SOL_17_UpdownToP42)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SOL_18_WaitTime2 ); StoreMove.NextMoveStep(StoreMoveStep.SOL_18_WaitTime2);
OutStoreLog("出库定位2:放下物品后等待200 "); OutStoreLog("出库定位2:放下物品后等待200 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(200)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(200));
} }
...@@ -780,6 +768,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -780,6 +768,7 @@ namespace OnlineStore.DeviceLibrary
else if (StoreMove.MoveStep == StoreMoveStep.SO_21_ToDoorP) else if (StoreMove.MoveStep == StoreMoveStep.SO_21_ToDoorP)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_22_WaitNoTray); StoreMove.NextMoveStep(StoreMoveStep.SO_22_WaitNoTray);
OutStoreLog("出库定位:打开仓门,等待门口无料盘信号 ");
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
OpenDoor(); OpenDoor();
} }
...@@ -789,8 +778,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -789,8 +778,8 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_23_InoutToP2) else if (StoreMove.MoveStep == StoreMoveStep.SO_23_InoutToP2)
{ {
OutStoreLog("出库:升降轴至P8(进料口出料缓冲点) ");
StoreMove.NextMoveStep(StoreMoveStep.SO_24_PutWare); StoreMove.NextMoveStep(StoreMoveStep.SO_24_PutWare);
OutStoreLog("出库:升降轴至P8(进料口出料缓冲点) ");
//NeedCheckSafetyLight = 0; //NeedCheckSafetyLight = 0;
ComMoveToPosition(moveP.ComPress_P1, Config.CompAxis_P1_Speed); ComMoveToPosition(moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P8, Config.UpDownAxis_P8_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P8, Config.UpDownAxis_P8_Speed);
...@@ -803,15 +792,35 @@ namespace OnlineStore.DeviceLibrary ...@@ -803,15 +792,35 @@ namespace OnlineStore.DeviceLibrary
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_25_InoutToP1) else if (StoreMove.MoveStep == StoreMoveStep.SO_25_InoutToP1)
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_26_CheckTray); StoreMove.NextMoveStep(StoreMoveStep.SO_26_CloseDoor);
OutStoreLog("出库:检测料仓门口料盘信号 "); OutStoreLog("出库:轴2至P1(待机点) ,关闭舱门");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
CloseDoor();
}
else if (StoreMove.MoveStep == StoreMoveStep.SO_26_CloseDoor)
{
StoreMove.NextMoveStep(StoreMoveStep.SO_27_CheckTray);
OutStoreLog("出库:检测料仓门口料盘信号 ,最多1000");
StoreMove.OneWaitCanEndStep = true;
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(1000));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.HIGH));
} }
else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_26_CheckTray)) else if (StoreMove.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray))
{ {
SO_27_GoBack(); if (IOManager.IOValue(IO_Type.TrayCheck_Door).Equals(IO_VALUE.LOW))
{
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
string barcode = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.barcode : "";
CodeMsg = "" + posId + "_" + barcode + "_空出";
LogUtil.error(CodeMsg + ",取消出库任务");
StoreManager.cancelOutTask(barcode);
}
SO_28_GoBack();
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_27_GoBack) else if (StoreMove.MoveStep == StoreMoveStep.SO_28_GoBack)
{ {
int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds); int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds);
if (OutStoreWaitSeconds <= 0) if (OutStoreWaitSeconds <= 0)
...@@ -819,14 +828,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -819,14 +828,14 @@ namespace OnlineStore.DeviceLibrary
OutStoreWaitSeconds = 600; OutStoreWaitSeconds = 600;
} }
int ms = OutStoreWaitSeconds * 1000; int ms = OutStoreWaitSeconds * 1000;
StoreMove.NextMoveStep(StoreMoveStep.SO_28_WaitTake); StoreMove.NextMoveStep(StoreMoveStep.SO_29_WaitTake);
OutStoreLog("出库: 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒"); OutStoreLog("出库: 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms)); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(ms));
StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW)); StoreMove.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0)); // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
StoreMove.OneWaitCanEndStep = true; StoreMove.OneWaitCanEndStep = true;
} }
else if (StoreMove.MoveStep == StoreMoveStep.SO_28_WaitTake) else if (StoreMove.MoveStep == StoreMoveStep.SO_29_WaitTake)
{ {
TimeSpan span = DateTime.Now - startOutStoreTime; TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : ""; string posId = StoreMove.MoveParam != null ? StoreMove.MoveParam.PosInfo.PosId : "";
...@@ -845,7 +854,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -845,7 +854,7 @@ namespace OnlineStore.DeviceLibrary
} }
public bool OutCheckAlarm() public bool OutCheckAlarm()
{ {
if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.MoveType.Equals(StoreMoveType.OutStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_26_CheckTray)) if (alarmType.Equals(StoreAlarmType.IoSingleTimeOut) && StoreMove.MoveType.Equals(StoreMoveType.OutStore) && StoreMove.MoveStep.Equals(StoreMoveStep.SO_27_CheckTray))
{ {
return true; return true;
} }
...@@ -860,12 +869,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -860,12 +869,13 @@ namespace OnlineStore.DeviceLibrary
StoreMove.EndStepWait(); StoreMove.EndStepWait();
} }
} }
private void SO_27_GoBack() private void SO_28_GoBack()
{ {
StoreMove.NextMoveStep(StoreMoveStep.SO_27_GoBack); StoreMove.NextMoveStep(StoreMoveStep.SO_28_GoBack);
OutStoreLog("出库:轴2至P1(待机点) ,关闭舱门"); OutStoreLog("出库:发送出库完成消息给流水线");
ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed); StoreMove.WaitList.Add(WaitResultInfo.WaitTime(500));
CloseDoor(); //ACAxisMove(Config.UpDown_Axis, StoreMove.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
//CloseDoor();
//发送消息给流水线 //发送消息给流水线
SendOutStoreEnd(StoreMove); SendOutStoreEnd(StoreMove);
} }
......
...@@ -218,5 +218,51 @@ namespace OnlineStore.DeviceLibrary ...@@ -218,5 +218,51 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
// 取消出库任务地址: /cancelOutTask //参数: barcode
private static string Addr_cancelPutInTask = "/rest/api/qisda/device/cancelOutTask";
public static string cancelOutTask( string barcode)
{
string msg = "";
try
{
Dictionary<string, string> paramMap = new Dictionary<string, string>();
paramMap.Add("barcode", barcode);
string server = GetAddr(Addr_cancelPutInTask, paramMap);
DateTime startTime = DateTime.Now;
string resultStr = HttpHelper.Post(server, "");
LogUtil.info("cancelOutTask " + FormUtil.GetSpanStr(DateTime.Now - startTime) + " 【" + server + "】【" + resultStr + "】");
ResultData data = JsonHelper.DeserializeJsonToObject<ResultData>(resultStr);
if (data == null)
{
return msg = " cancelOutTask【 " + barcode + "】 没有收到服务器反馈";
}
else if (data.code.Equals(0).Equals(false))
{
return msg = " cancelOutTask【 " + barcode + "】 :" + data.msg;
}
return "";
}
catch (Exception ex)
{
LogUtil.error(" cancelOutTask error :" + ex.ToString());
}
return msg;
}
}
public class ResultData
{
//{"code":0,"msg":"ok","data":"7"}
public int code { get; set; }
public string msg { get; set; }
public Dictionary<string, string> data { get; set; }
} }
} }
...@@ -279,17 +279,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -279,17 +279,21 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
SO_25_InoutToP1, SO_25_InoutToP1,
/// <summary> /// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点),关闭仓门
/// </summary>
SO_26_CloseDoor,
/// <summary>
/// 料仓出库,检测料仓门口信号 /// 料仓出库,检测料仓门口信号
/// </summary> /// </summary>
SO_26_CheckTray, SO_27_CheckTray,
/// <summary> /// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点) /// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary> /// </summary>
SO_27_GoBack, SO_28_GoBack,
/// <summary> /// <summary>
/// 等待拿走物品 /// 等待拿走物品
/// </summary> /// </summary>
SO_28_WaitTake, SO_29_WaitTake,
#endregion #endregion
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!