Commit c0aa7e41 LN

AGV到达时需要判断rfid是否正确。

1 个父辈 eddd82d2
......@@ -115,7 +115,7 @@ PRO,压紧轴(轴4)七寸盘压紧前点相对压紧点的位置,CompAxis7_P
出库时发现料架对不上,送出料架时发的mark应该用原来的
agv到达时,根据rfid判断是否有料架
......
......@@ -116,9 +116,12 @@ namespace OnlineStore.DeviceLibrary
}
else if (wait.WaitType.Equals(WaitEnum.W010_AgvStatus))
{
if (wait.AgvAction.Equals((int)ClientAction.Ready))
{
//Ready时使用状态判断,arrive时需要判断料架号是否正确
ClientAction agvA = AgvClient.GetAction(Config.AgvNodeName);
wait.IsEnd = ((int)agvA).Equals(wait.AgvAction);
}
if (!wait.IsEnd && span.TotalSeconds > 10)
{
//如果是等待AGV到达,等待有料架信号也算结束
......@@ -135,7 +138,7 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = true;
}
}
else if (wait.AgvAction.Equals((int)ClientAction.Arrive)&&MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitArrive))
else if (wait.AgvAction.Equals((int)ClientAction.Arrive)&&MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitEmptyAgv))
{
if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW))
{
......
......@@ -249,7 +249,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_02_LocatinDown))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_03_WaitArrive);
MoveInfo.NextMoveStep(StoreMoveStep.BS_03_WaitEmptyAgv);
MoveInfo.TimeOutSeconds = 600;
//MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(30000));
//等待agv到达
......@@ -257,7 +257,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog(moveName + MoveInfo.SLog + ":再次调用 NeedLeave["+mark+"][" + CurrShelfID + "],等待Agv " + Config.AgvNodeName + " Arrive ,最多等待1200秒");
AgvClient.SetStatus(Config.AgvNodeName, mark, CurrShelfID, ClientAction.NeedLeave, ClientLevel.High, true);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitArrive))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitEmptyAgv))
{
//agv到达
......@@ -273,10 +273,11 @@ namespace OnlineStore.DeviceLibrary
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_06_LineBackRun);
AgvClient.SetToNone(Config.AgvNodeName);
//如果agv未到达,直接结束
MoveEndToRuningStatus();
//EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":等待Agv " + Config.AgvNodeName + " Arrive超时,检测不到料架信号,认为料架已手动离开,出库结束");
InOutStoreLog(moveName + MoveInfo.SLog + ":等待Agv " + Config.AgvNodeName + " Arrive超时,检测不到料架信号,认为料架已离开,出库结束,设置"+ Config.AgvNodeName + "=None");
}
else
{
......@@ -349,12 +350,12 @@ namespace OnlineStore.DeviceLibrary
{
//结束
MoveEndToRuningStatus();
AgvClient.SetStatus(Config.AgvNodeName);
//EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":料架"+ CurrShelfID + "已离开 ,"+ Config.AgvNodeName + "=None");
InOutStoreLog(moveName + MoveInfo.SLog + ":料架"+ CurrShelfID + "已离开 ,设置"+ Config.AgvNodeName + "=None");
CurrShelfID = "";
LastOutParam = new InOutParam();
//LastRfidID = "";
AgvClient.SetStatus(Config.AgvNodeName);
}
}
......@@ -362,33 +363,69 @@ namespace OnlineStore.DeviceLibrary
#region AGV
internal bool ProcessAGVAction(string name, ClientAction action)
internal bool ProcessAGVAction(string name, string rfid, ClientAction action)
{
string logN = name + "收到调度【" + name + "】=【" + action + "】";
string logN = name + "收到调度" + name + "=" + action + ",RFID[" + rfid + "]";
//Arrive收到后打开门
if (action.Equals(ClientAction.Arrive))
if (!action.Equals(ClientAction.Arrive))
{
LogUtil.info(Name + logN + " ,未找到相关处理");
return false;
}
//出库处理中不处理
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore))
{
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_00_ReadyShelf))
{
if (rfid.Equals(""))
{
string mark = GetMarkInfo();
LogUtil.error(Name + logN + " 当前出库中 BI_00_ReadyShelf,RFID无效,不处理agv,重发 NeedEnter [" + mark + "][" + MoveInfo.MoveParam.rfid + "]");
AgvClient.SetStatus(Config.AgvNodeName, mark, MoveInfo.MoveParam.rfid, ClientAction.NeedEnter, ClientLevel.High, true);
return false;
}
//出库等待料架到达
LogUtil.info(Name + logN + ",当前出库中 BI_00_ReadyShelf,正在等待料架到达");
MoveInfo.NextMoveStep(StoreMoveStep.BI_01_DoorOpen);
InOutStoreLog("出库等待料架" + MoveInfo.SLog + " agv已到达,打开入料口移门");
DoorBean.StartOpen(MoveInfo);
return true;
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_WaitEmptyAgv))
{
if (!rfid.Equals(""))
{
string mark = GetMarkInfo();
LogUtil.error(Name + logN + " 当前出库中 BS_03_WaitEmptyAgv,RFID[" + rfid + "]不是空车,不处理agv,重发 NeedLeave [" + mark + "][" + CurrShelfID + "]");
AgvClient.SetStatus(Config.AgvNodeName, mark, CurrShelfID, ClientAction.NeedLeave, ClientLevel.High, true);
return false;
}
//agv到达,开始处理
if (storeRunStatus.Equals(StoreRunStatus.Runing) &&
//等待空车到达
LogUtil.info(Name + logN + ",当前出库中 BS_03_WaitEmptyAgv,正在等待料架到达");
MoveInfo.NextMoveStep(StoreMoveStep.BS_04_DoorOpen);
InOutStoreLog("送出料架等待空车" + MoveInfo.SLog + ":agv到达,打开入料口移门");
DoorBean.StartOpen(MoveInfo);
return true;
}
}
else if (storeRunStatus.Equals(StoreRunStatus.Runing) &&
MoveInfo.MoveType.Equals(StoreMoveType.None) &&
IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
{
//agv到达,开始处理
if (rfid.Equals(""))
{
LogUtil.error(Name + logN + " ,RFID无效,不需要入库处理");
return false;
}
LogUtil.info(Name + logN + " ,检测到料架,开始料架入库");
StartShelfInStore();
return true;
}
}
else
{
LogUtil.info(Name + logN + " ,未找到相关处理");
}
return false;
}
......
......@@ -387,13 +387,13 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = msg;
}
internal bool AGVProcess(string name, ClientAction action)
internal bool AGVProcess(string name, string rfid, ClientAction action)
{
foreach (AC_BOX_Bean box in this.BoxMap.Values)
{
if (box.Config.AgvNodeName.Equals(name))
{
return box.ProcessAGVAction(name, action);
return box.ProcessAGVAction(name,rfid, action);
}
}
return false;
......
......@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
{
// RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_EnterShelf [" + id + "] [" + rfid+ "] ");
StoreManager.Store.AGVProcess(id, ClientAction.Arrive);
StoreManager.Store.AGVProcess(id, rfid, ClientAction.Arrive);
foreach (AC_BOX_Bean box in StoreManager.Store.BoxMap.Values)
{
if (box.Config.AgvNodeName.Equals(id))
......@@ -114,7 +114,7 @@ namespace OnlineStore.DeviceLibrary
UpdateAction(id, ClientAction.Ready);
// RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + rfid+ "] ");
StoreManager.Store.AGVProcess(id, ClientAction.Ready);
StoreManager.Store.AGVProcess(id, rfid, ClientAction.Ready);
}
......@@ -124,7 +124,7 @@ namespace OnlineStore.DeviceLibrary
// RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + rfid+ "] ");
StoreManager.Store.AGVProcess(id, ClientAction.Arrive);
StoreManager.Store.AGVProcess(id, rfid,ClientAction.Arrive);
}
......@@ -223,6 +223,7 @@ namespace OnlineStore.DeviceLibrary
}
}
}
//public class AGVAction
//{
// public static string None = "None";
......
......@@ -429,7 +429,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 通知AGV准备空车
/// </summary>
BS_03_WaitArrive = 4003,
BS_03_WaitEmptyAgv = 4003,
/// <summary>
/// 送出空料架:打开仓门
/// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!