Commit 35b5eb93 几米阳光

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

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