Commit f9ebe4ba LN

1

1 个父辈 634bb766
...@@ -70,7 +70,7 @@ ...@@ -70,7 +70,7 @@
<ItemGroup> <ItemGroup>
<Compile Include="acVmiLine\VMILineBean.cs" /> <Compile Include="acVmiLine\VMILineBean.cs" />
<Compile Include="acVmiLine\VMILineBean_Partial.cs" /> <Compile Include="acVmiLine\VMILineBean_Partial.cs" />
<Compile Include="acVmiLine\RobotManager.cs" /> <Compile Include="acVmiLine\LineManager.cs" />
<Compile Include="acVmiLine\WaitUtil.cs" /> <Compile Include="acVmiLine\WaitUtil.cs" />
<Compile Include="agvClient\AgvClient.cs" /> <Compile Include="agvClient\AgvClient.cs" />
<Compile Include="bean\StoreMoveInfo.cs" /> <Compile Include="bean\StoreMoveInfo.cs" />
......
...@@ -37,6 +37,6 @@ DO,进料线入口阻挡,InL_InStopDown,9,PRO_AOI_IP_1,0,进料线入口阻挡,Y730,DO-02,0, ...@@ -37,6 +37,6 @@ DO,进料线入口阻挡,InL_InStopDown,9,PRO_AOI_IP_1,0,进料线入口阻挡,Y730,DO-02,0,
,,,15,PRO_AOI_IP_1,0,,Y736,DO-08,0, ,,,15,PRO_AOI_IP_1,0,,Y736,DO-08,0,
PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,, PRO,IO信号超时时间(毫秒),IOSingle_TimerOut,10000,,,,,,,
PRO,出空料架流水线AGV节点名称,OutL_AgvName,A2,,,,,,, PRO,出空料架流水线AGV节点名称,OutL_AgvName,A2,,,,,,,
PRO,入料架流水线AGV节点名称,InL_AgvName,A1,,,,,,, PRO,入料架流水线AGV节点名称,InL_AgvName,A3,,,,,,,
PRO,入料架流水线入口RFIDIP,InL_In_RFIDIP,192.168.102.108,,,,,, , PRO,入料架流水线入口RFIDIP,InL_In_RFIDIP,192.168.102.108,,,,,, ,
PRO,入料架流水线出口RFIDIP,InL_Out_RFIDIP,192.168.102.107,,,,,, , PRO,入料架流水线出口RFIDIP,InL_Out_RFIDIP,192.168.102.107,,,,,, ,
...@@ -98,12 +98,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -98,12 +98,15 @@ namespace OnlineStore.DeviceLibrary
IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW); IOManager.IOMove(IO_Type.Alarm_HddLed, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH); IOManager.IOMove(IO_Type.AutoRun_HddLed, IO_VALUE.HIGH);
MoveInfo.NextMoveStep(MoveStep.VMI_H_StopUp); MoveInfo.NextMoveStep(MoveStep.VMI_H_StopUp);
LogUtil.info(Name + " 开始复位:所有阻挡上升"); LogUtil.info(Name + " 开始复位:所有阻挡上升,设置状态为None");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(500));
IOManager.IOMove(IO_Type.InL_InStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.InL_InStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.InL_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.InL_OutStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.OutL_InStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.OutL_InStopDown, IO_VALUE.LOW);
IOManager.IOMove(IO_Type.OutL_OutStopDown, IO_VALUE.LOW); IOManager.IOMove(IO_Type.OutL_OutStopDown, IO_VALUE.LOW);
AgvClient.SetStatus(Config.InL_AgvName);
AgvClient.SetStatus(Config.OutL_AgvName);
mainTimer.Enabled = true; mainTimer.Enabled = true;
serverConnectTimer.Enabled = true; serverConnectTimer.Enabled = true;
} }
...@@ -317,16 +320,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -317,16 +320,21 @@ namespace OnlineStore.DeviceLibrary
else if (span.TotalMilliseconds > StopDownMS) else if (span.TotalMilliseconds > StopDownMS)
{ {
il_outstopCheckWarch.Stop(); il_outstopCheckWarch.Stop();
if (IOManager.IOValue(IO_Type.InL_OutStopDown).Equals(IO_VALUE.HIGH)) ClientAction currA = AgvClient.GetAction(Config.InL_AgvName);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
IOManager.IOMove(IO_Type.InL_OutStopDown, IO_VALUE.LOW); if (IOManager.IOValue(IO_Type.InL_OutStopDown).Equals(IO_VALUE.HIGH))
} {
} IOManager.IOMove(IO_Type.InL_OutStopDown, IO_VALUE.LOW);
}
}
}
//如果是出口无料架,NeedLeave状态,改为None //如果是出口无料架,NeedLeave状态,改为None
if (IOManager.IOValue(IO_Type.InL_OutStopCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.InL_AgvName).Equals(ClientAction.NeedLeave)) if (IOManager.IOValue(IO_Type.InL_OutStopCheck).Equals(IO_VALUE.LOW) && AgvClient.GetAction(Config.InL_AgvName).Equals(ClientAction.NeedLeave))
{ {
il_outstopCheckWarch.Stop();
LogUtil.info(" 入库线体出口无料架 ,更改[" + Config.InL_AgvName + "] 状态[None] "); LogUtil.info(" 入库线体出口无料架 ,更改[" + Config.InL_AgvName + "] 状态[None] ");
AgvClient.SetStatus(Config.InL_AgvName, "", ClientAction.None); AgvClient.SetToNone(Config.InL_AgvName, "" );
} }
} }
...@@ -458,7 +466,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -458,7 +466,7 @@ namespace OnlineStore.DeviceLibrary
#region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作 #region 与服务器通信定时器,每1秒向服务器通知一次状态,同时执行出库操作
private string LastInShelfId = ""; private string LastInShelfId = "";
private string LastOutShelfId = ""; public string LastOutShelfId = "";
private bool isInProcess = false; private bool isInProcess = false;
public void server_connect_timer_Tick(object sender, EventArgs e) public void server_connect_timer_Tick(object sender, EventArgs e)
{ {
......
...@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -83,7 +83,7 @@ namespace OnlineStore.DeviceLibrary
} }
} }
public void StopIOMove(string ioType, int ms = 1000) public void StopIOMove(string ioType, int ms = 1000)
{ {
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
......
...@@ -67,7 +67,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -67,7 +67,8 @@ namespace OnlineStore.DeviceLibrary
{ {
RFIDData data = new RFIDData(content); RFIDData data = new RFIDData(content);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] "); string logName = "收到 AgvClient_Ready [" + id + "] [" + data.NumStr() + "] ";
LogUtil.info(logName);
UpdateAction(id, Asa.ClientAction.Ready); UpdateAction(id, Asa.ClientAction.Ready);
if (id.Equals(LineManager.Config.OutL_AgvName)) if (id.Equals(LineManager.Config.OutL_AgvName))
...@@ -77,48 +78,65 @@ namespace OnlineStore.DeviceLibrary ...@@ -77,48 +78,65 @@ namespace OnlineStore.DeviceLibrary
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
SetStatus(id, "", ClientAction.MayEnter); SetStatus(id, "", ClientAction.MayEnter);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] 调用 MayEnter ,等待OutL_InCheck"); LogUtil.info(logName + "调用 MayEnter ,等待OutL_InCheck");
WaitUtil.Wait(60000, delegate try
{ {
return IOManager.IOValue(IO_Type.OutL_InCheck).Equals(IO_VALUE.HIGH); WaitUtil.Wait(60000, delegate
}, "等待OutL_InCheck=HIGH"); {
if (IOManager.IOValue(IO_Type.OutL_InCheck).Equals(IO_VALUE.HIGH)) return IOManager.IOValue(IO_Type.OutL_InCheck).Equals(IO_VALUE.HIGH);
{ }, "等待OutL_InCheck=HIGH");
//两秒后改为离开状态
Thread.Sleep(2000);
SetStatus(id, "", ClientAction.FinishEnter);
Thread.Sleep(2000);
SetStatus(id, "", ClientAction.None);
} }
else catch (Exception ex)
{ {
LogUtil.error("AgvClient_Ready [" + id + "] [" + data.ToData() + "] 调用 MayEnter ,等待OutL_InCheck超时"); LogUtil.error(logName + ":" + ex.ToString());
} }
//两秒后改为离开状态
Thread.Sleep(3000);
LogUtil.info(logName + " ,调用 FinishEnter ");
SetStatus(id, "", ClientAction.FinishEnter);
Thread.Sleep(5000);
LogUtil.info(logName + " ,处理结束 更新状态为None ");
SetStatus(id, "", ClientAction.None);
}); });
} }
else
{
LogUtil.error(logName + " OutL_InCheck 检测到有料架,AGV的料架无法进入");
SetStatus(id, "", ClientAction.None, ClientLevel.High);
}
} }
else if (id.Equals(LineManager.Config.InL_AgvName)) else if (id.Equals(LineManager.Config.InL_AgvName))
{ {
string shefId = LineManager.VMILine.LastOutShelfId;
if (IOManager.IOValue(IO_Type.InL_OutStopCheck).Equals(IO_VALUE.HIGH)) if (IOManager.IOValue(IO_Type.InL_OutStopCheck).Equals(IO_VALUE.HIGH))
{ {
LineManager.VMILine.StopIOMove(IO_Type.InL_OutStopDown, 2000); LineManager.VMILine.StopIOMove(IO_Type.InL_OutStopDown, 3000);
//agvClient.MayLeave(id); //agvClient.MayLeave(id);
SetStatus(id, "", ClientAction.MayLeave); SetStatus(id, shefId, ClientAction.MayLeave);
LogUtil.info("收到 AgvClient_Ready [" + id + "] [" + data.ToData() + "] ,下降 InL_OutStopDown ,调用 MayLeave "); LogUtil.info(logName + "下降 InL_OutStopDown ,调用 MayLeave " + shefId);
Task.Factory.StartNew(delegate Task.Factory.StartNew(delegate
{ {
//两秒后改为离开状态 //两秒后改为离开状态
Thread.Sleep(2000); Thread.Sleep(5000);
SetStatus(id, "", ClientAction.FinishLeave); LogUtil.info(logName + " ,调用 FinishLeave " + shefId);
SetStatus(id, shefId, ClientAction.FinishLeave);
Thread.Sleep(2000); Thread.Sleep(5000);
LogUtil.info(logName + " ,处理结束 更新状态为None ");
SetStatus(id, "", ClientAction.None); SetStatus(id, "", ClientAction.None);
}); });
} }
else
{
LogUtil.error(logName + " InL_OutStopCheck 未检测到料架,无法将料架进入AGV");
SetStatus(id, "", ClientAction.None, ClientLevel.High);
}
} }
} }
private static void AgvClient_Arrive(string id, byte[] content) private static void AgvClient_Arrive(string id, byte[] content)
...@@ -128,10 +146,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -128,10 +146,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + data.ToData() + "] "); LogUtil.info("收到 AgvClient_Arrive [" + id + "] [" + data.ToData() + "] ");
} }
public static bool SetToNone(string id, string shelfId = "") public static bool SetToNone(string id, string shelfId = "")
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.None); SetStatus(id, shelfId, ClientAction.None);
return true; return true;
...@@ -141,7 +160,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -141,7 +160,7 @@ namespace OnlineStore.DeviceLibrary
public static bool NeedEnter(string id, string shelfId) public static bool NeedEnter(string id, string shelfId)
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.NeedEnter); SetStatus(id, shelfId, ClientAction.NeedEnter);
return true; return true;
...@@ -150,9 +169,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -150,9 +169,8 @@ namespace OnlineStore.DeviceLibrary
} }
public static bool NeedLeave(string id, string shelfId) public static bool NeedLeave(string id, string shelfId)
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.FinishLeave) || currA.Equals(ClientAction.FinishEnter) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter)) if (currA.Equals(ClientAction.None) || currA.Equals(ClientAction.NeedLeave) || currA.Equals(ClientAction.NeedEnter))
{ {
SetStatus(id, shelfId, ClientAction.NeedLeave); SetStatus(id, shelfId, ClientAction.NeedLeave);
return true; return true;
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!