Commit 35b5eb93 几米阳光

吸盘吸料后,等待入库的过程中增加超时报警。

1 个父辈 12ec6c1d
...@@ -1585,7 +1585,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1585,7 +1585,7 @@ namespace OnlineStore.AutoInOutStore
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
bool result = AutomaticBaiting.Reset(false); bool result = AutomaticBaiting.Reset(false,false);
} }
private void btnTempInit_Click(object sender, EventArgs e) private void btnTempInit_Click(object sender, EventArgs e)
...@@ -1639,7 +1639,7 @@ namespace OnlineStore.AutoInOutStore ...@@ -1639,7 +1639,7 @@ namespace OnlineStore.AutoInOutStore
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
bool result = AutomaticBaiting.Reset(false); bool result = AutomaticBaiting.Reset(true,false);
} }
private void toolStripMenuItem2_Click(object sender, EventArgs e) private void toolStripMenuItem2_Click(object sender, EventArgs e)
......
...@@ -228,13 +228,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -228,13 +228,15 @@ namespace OnlineStore.DeviceLibrary
//if (suddenBtn == IO_VALUE.HIGH) //if (suddenBtn == IO_VALUE.HIGH)
if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH) if (suddenBtn == IO_VALUE.HIGH && airCheck == IO_VALUE.HIGH)
{ {
isInSuddenDown = false;
isNoAirCheck = false;
//lastAirValue = airCheck; //lastAirValue = airCheck;
lastAirCloseTime = DateTime.Now; lastAirCloseTime = DateTime.Now;
if (!RunAxis(true)) if (!RunAxis(true))
{ {
return false; return false;
} }
AutomaticBaiting.Reset(false); AutomaticBaiting.StartReset( );
//TODO 启动时先所有轴远点返回,测试暂时关闭 //TODO 启动时先所有轴远点返回,测试暂时关闭
storeRunStatus = StoreRunStatus.HomeMoving; storeRunStatus = StoreRunStatus.HomeMoving;
...@@ -348,7 +350,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,7 +350,7 @@ namespace OnlineStore.DeviceLibrary
StoreMove.NextMoveStep(StoreMoveStep.BOX_H_LocationCylinderBack); StoreMove.NextMoveStep(StoreMoveStep.BOX_H_LocationCylinderBack);
LocationDownAndWait(); LocationDownAndWait();
} }
AutomaticBaiting.Reset(false ); AutomaticBaiting.StartReset( );
isInPro = false; isInPro = false;
} }
private void InoutStartReset() private void InoutStartReset()
...@@ -1305,15 +1307,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -1305,15 +1307,18 @@ namespace OnlineStore.DeviceLibrary
// || storeStatus.Equals(StoreStatus.InStoreExecute) || storeStatus.Equals(StoreStatus.OutStoreExecute) // || storeStatus.Equals(StoreStatus.InStoreExecute) || storeStatus.Equals(StoreStatus.OutStoreExecute)
// || storeStatus.Equals(StoreStatus.InStoreEnd) || storeStatus.Equals(StoreStatus.OutStoreBoxEnd)) // || storeStatus.Equals(StoreStatus.InStoreEnd) || storeStatus.Equals(StoreStatus.OutStoreBoxEnd))
if (isInSuddenDown.Equals(false)&& isNoAirCheck.Equals(false)&&StoreMove.MoveType.Equals(StoreMoveType.None) if ((isInSuddenDown.Equals(false)) && (isNoAirCheck.Equals(false)) && (StoreMove.MoveType.Equals(StoreMoveType.None))
&&storeRunStatus.Equals(StoreRunStatus.Runing)) && (storeRunStatus.Equals(StoreRunStatus.Runing)))
{ {
return true;
}
return false; return false;
} }
return true; public void LoguStatus()
{
LogUtil.error(StoreName+"当前状态:"+"isInSuddenDown["+ isInSuddenDown + "],isNoAirCheck[" + isNoAirCheck + "]," + "StoreMove.MoveType[" + StoreMove.MoveType + "],storeRunStatus[" + storeRunStatus + "]",106);
} }
#region 温湿度处理 #region 温湿度处理
/// <summary> /// <summary>
/// 湿度标准,超过后需要报警 /// 湿度标准,超过后需要报警
......
...@@ -32,6 +32,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,6 +32,7 @@ namespace OnlineStore.DeviceLibrary
public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait; public static StoreRunStatus AutoBaitingStatus = StoreRunStatus.Wait;
public static bool IsNeedStartInout = false; public static bool IsNeedStartInout = false;
public static bool IsNeedAxisHome = true ;
//记录没开门状态下,已经出库的数量 //记录没开门状态下,已经出库的数量
public static int BatchOutStoreCount = 0; public static int BatchOutStoreCount = 0;
...@@ -122,7 +123,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +123,15 @@ namespace OnlineStore.DeviceLibrary
CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false); CylinderMove(IO_Type.SuckingDisc_Up, IO_Type.SuckingDisc_Down, false);
BatchDoorClose(false); BatchDoorClose(false);
} }
public static bool Reset(bool isNeedInout) /// <summary>
/// 复位过程调用此方法
/// </summary>
/// <returns></returns>
public static bool StartReset()
{
return Reset(true, false);
}
public static bool Reset(bool isNeedHome, bool isNeedInout)
{ {
string msg = CanStart(); string msg = CanStart();
...@@ -139,6 +148,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -139,6 +148,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = ""; WarnMsg = "";
} }
AutomaticBaiting.IsNeedStartInout = isNeedInout; AutomaticBaiting.IsNeedStartInout = isNeedInout;
AutomaticBaiting.IsNeedAxisHome = isNeedHome;
if (!StoreMove.MoveType.Equals(StoreMoveType.None)) if (!StoreMove.MoveType.Equals(StoreMoveType.None))
{ {
StopMove(); StopMove();
...@@ -148,7 +158,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -148,7 +158,7 @@ namespace OnlineStore.DeviceLibrary
AutoBaitingStatus = StoreRunStatus.Reset; AutoBaitingStatus = StoreRunStatus.Reset;
StoreMove.NewMove(StoreMoveType.StoreReset); StoreMove.NewMove(StoreMoveType.StoreReset);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R00_Start); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R00_Start);
LogUtil.info(Name + "开始复位,是否需要入库【" + AutomaticBaiting.IsNeedStartInout + "】"); LogUtil.info(Name + "开始复位,是否需要入库【" + AutomaticBaiting.IsNeedStartInout + "】,上料轴是否需要回原点【"+AutomaticBaiting.IsNeedAxisHome+"】");
return true; return true;
} }
...@@ -175,35 +185,31 @@ namespace OnlineStore.DeviceLibrary ...@@ -175,35 +185,31 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info(Name + "复位中:关闭门锁"); LogUtil.info(Name + "复位中:关闭门锁");
break; break;
case StoreMoveStep.AUTO_R01_CloseDoor: case StoreMoveStep.AUTO_R01_CloseDoor:
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R02_AutoAxisHome);
StoreMove.TimeOutSeconds = 120; StoreMove.TimeOutSeconds = 120;
bool isClearAlarm = false;
if (ACServerManager.GetAlarmStatus(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()).Equals(1)) if (ACServerManager.GetAlarmStatus(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()).Equals(1))
{ {
LogUtil.info(Name + "复位中:批量上下料轴清理报警,然后原点返回"); isClearAlarm = true;
LogUtil.info(Name + "复位中:批量上下料轴清理报警");
ACServerManager.AlarmClear(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue()); ACServerManager.AlarmClear(StoreManager.Config.Batch_Axis.DeviceName, StoreManager.Config.Batch_Axis.GetAxisValue());
Thread.Sleep(100); Thread.Sleep(100);
} }
else if (isClearAlarm || IsNeedAxisHome)
{ {
LogUtil.info(Name + "复位中:批量上下料轴原点返回"); LogUtil.info(Name + "复位中:批量上下料轴原点返回");
}
ACAxisHomeMove(StoreManager.Config.Batch_Axis); ACAxisHomeMove(StoreManager.Config.Batch_Axis);
break;
case StoreMoveStep.AUTO_R02_AutoAxisHome:
if (IsNeedStartInout)
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
LogUtil.info(Name + "复位中:需要检测是否有料盘,批量轴匀速上升速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
} }
else else
{ {
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2); IsNeedInstore();
LogUtil.info(Name + "复位中:上料轴移动到p2点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
} }
break; break;
case StoreMoveStep.AUTO_R02_AutoAxisHome:
IsNeedInstore();
break;
case StoreMoveStep.AUTO_R03_AutoAxisHome: case StoreMoveStep.AUTO_R03_AutoAxisHome:
...@@ -225,11 +231,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -225,11 +231,6 @@ namespace OnlineStore.DeviceLibrary
} }
break; break;
case StoreMoveStep.AUTO_R04_AutoBack: case StoreMoveStep.AUTO_R04_AutoBack:
//LogUtil.info(Name + "复位完成");
//StoreMove.EndMove();
//AutoBaitingStatus = StoreRunStatus.Runing;
//WarnMsg = "";
//IsNeedStartInout = false;
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2); StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2);
LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】"); LogUtil.info(Name + "复位中:上料轴移动到p1点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed); ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
...@@ -244,7 +245,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -244,7 +245,21 @@ namespace OnlineStore.DeviceLibrary
default: break; default: break;
} }
} }
private static void IsNeedInstore()
{
if (IsNeedStartInout)
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R03_AutoAxisHome);
LogUtil.info(Name + "复位中:需要检测是否有料盘,批量轴匀速上升速度【" + StoreManager.Config.Batch_Axis.TargetSpeed + "】");
ACAxisSpeedMove(StoreManager.Config.Batch_Axis, StoreManager.Config.Batch_Axis.TargetSpeed);
}
else
{
StoreMove.NextMoveStep(StoreMoveStep.AUTO_R05_ToP2);
LogUtil.info(Name + "复位中:上料轴移动到p2点【" + StoreManager.Config.BatchAxis_P2 + "】");
ACAxisAbsMove(StoreManager.Config.Batch_Axis, StoreManager.Config.BatchAxis_P2, StoreManager.Config.BatchAxis_P2_Speed);
}
}
public static bool StartInOut() public static bool StartInOut()
{ {
if ((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing)) || if ((!StoreManager.Store.storeRunStatus.Equals(StoreRunStatus.Runing)) ||
...@@ -400,6 +415,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -400,6 +415,7 @@ namespace OnlineStore.DeviceLibrary
} }
else if (span.TotalSeconds > 60) else if (span.TotalSeconds > 60)
{ {
StoreManager.Store.LoguStatus();
//一分钟还未开始,报警超时 //一分钟还未开始,报警超时
WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + "[等待可以入库][" + Math.Round(span.TotalSeconds, 0) + "秒]"; WarnMsg = "[" + StoreMove.MoveStep + "]" + ResourceControl.GetString(ResourceControl.TimeOut, "超时") + "[等待可以入库][" + Math.Round(span.TotalSeconds, 0) + "秒]";
LogUtil.error(WarnMsg, 105); LogUtil.error(WarnMsg, 105);
......
...@@ -539,7 +539,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -539,7 +539,7 @@ namespace OnlineStore.DeviceLibrary
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(true); AutomaticBaiting.Reset(false,true);
return ""; return "";
} }
public static string doTakeReel() public static string doTakeReel()
...@@ -568,7 +568,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -568,7 +568,7 @@ namespace OnlineStore.DeviceLibrary
return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device")); return (ResourceControl.GetString(ResourceControl.CloseError, "Door lock Error: Close feeding device"));
} }
AutomaticBaiting.BatchDoorClose(false); AutomaticBaiting.BatchDoorClose(false);
AutomaticBaiting.Reset(false); AutomaticBaiting.Reset(false,false);
return ""; return "";
} }
public static bool doConfirmReelGo() public static bool doConfirmReelGo()
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!