Commit a153e9f2 LN

agv更新

1 个父辈 390accaf
此文件类型无法预览
...@@ -261,6 +261,16 @@ ...@@ -261,6 +261,16 @@
是否连接服务器 是否连接服务器
</summary> </summary>
</member> </member>
<member name="P:Asa.Client2.CancelState">
<summary>
取消状态,true发送none,false发送实际状态
</summary>
</member>
<member name="P:Asa.Client2.SendLog">
<summary>
仅发送命令的代码日志
</summary>
</member>
<member name="M:Asa.Client2.Connect"> <member name="M:Asa.Client2.Connect">
<summary> <summary>
连接 连接
......
...@@ -410,7 +410,12 @@ namespace OnlineStore.AssemblyLine ...@@ -410,7 +410,12 @@ namespace OnlineStore.AssemblyLine
{ {
停止所有料仓TToolStripMenuItem_Click(null, null); 停止所有料仓TToolStripMenuItem_Click(null, null);
} }
AgvClient.Dispose();
IOManager.instance.CloseAllDO();
IOManager.instance.CloseAllConnection();
} }
private void btnClearLog_Click(object sender, EventArgs e) private void btnClearLog_Click(object sender, EventArgs e)
{ {
LogUtil.ClearLog(); LogUtil.ClearLog();
......
...@@ -25,6 +25,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -25,6 +25,7 @@ namespace OnlineStore.DeviceLibrary
{ {
isInit = true; isInit = true;
agvClient = new Asa.Client2(ServerIp); agvClient = new Asa.Client2(ServerIp);
agvClient.CancelState = true;
agvClient.Log += AgvClient_Log; agvClient.Log += AgvClient_Log;
agvClient.Arrive += AgvClient_Arrive; agvClient.Arrive += AgvClient_Arrive;
agvClient.Ready += AgvClient_Ready; agvClient.Ready += AgvClient_Ready;
...@@ -57,8 +58,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -57,8 +58,11 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error("初始化agvClient " + ServerIp + " 出错:", ex); LogUtil.error("初始化agvClient " + ServerIp + " 出错:", ex);
} }
} }
public static void SetCancelState(bool isCancel)
{
agvClient.CancelState = isCancel;
}
public static void SetStatus(string id, string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low) public static void SetStatus(string id, string shelfId = "", ClientAction action = ClientAction.None, ClientLevel level = ClientLevel.Low)
{ {
ClientAction currA = GetAction(id); ClientAction currA = GetAction(id);
......
...@@ -90,10 +90,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -90,10 +90,11 @@ namespace OnlineStore.DeviceLibrary
{ {
SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam); SecondMoveInfo.NewMove(LineMoveType.CheckFixture, CheckParam);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待" + TrayManager.StopDownWaitTime); CheckLog("检测到SW_StopCheck:" + SecondMoveInfo.SLog + "阻挡气缸下降 ,等待 SW_StopCheck=0" );
IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopDown, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW_StopCheck, IO_VALUE.LOW));
lastStopDown = DateTime.Now; lastStopDown = DateTime.Now;
//IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime); //IOMove(IO_Type.SW_StopDown, IO_VALUE.HIGH, TrayManager.StopDownWaitTime);
} }
...@@ -124,10 +125,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -124,10 +125,11 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
CheckLog(" 检测到FL_StopCheck:" + SecondMoveInfo.SLog + " FL阻挡1下降 ,等待 "+ TrayManager.StopDownWaitTime); CheckLog(" 检测到FL_StopCheck:" + SecondMoveInfo.SLog + " FL阻挡1下降 ,等待 FL_StopCheck=0");
IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCylinder_Down1, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.FL_StopCheck, IO_VALUE.LOW));
/// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
} }
else else
......
...@@ -179,6 +179,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -179,6 +179,8 @@ namespace OnlineStore.DeviceLibrary
mainTimer.Enabled = true; mainTimer.Enabled = true;
IoCheckTimer.Enabled = true; IoCheckTimer.Enabled = true;
canStart = true; canStart = true;
AgvClient.Init();
}); });
} }
...@@ -265,11 +267,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -265,11 +267,12 @@ namespace OnlineStore.DeviceLibrary
Thread.Sleep(5); Thread.Sleep(5);
//连接AGV调度 ////连接AGV调度
if (!AgvClient.ISConnected()) //if (!AgvClient.ISConnected())
{ //{
AgvClient.Init();
} //}
AgvClient.SetCancelState(false);
LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort)); LineServer.StartServer(ConfigAppSettings.GetIntValue(Setting_Init.TCPServerPort));
...@@ -406,7 +409,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -406,7 +409,7 @@ namespace OnlineStore.DeviceLibrary
IoCheckTimer.Enabled = false; IoCheckTimer.Enabled = false;
mainTimer.Enabled = false; mainTimer.Enabled = false;
ledProcessTimer.Enabled = false; ledProcessTimer.Enabled = false;
AgvClient.SetCancelState(true);
WriteDrivetMotorRun(IO_VALUE.LOW); WriteDrivetMotorRun(IO_VALUE.LOW);
//停止运行时,把阻挡气缸上升 //停止运行时,把阻挡气缸上升
StopMove(); StopMove();
......
...@@ -490,9 +490,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -490,9 +490,10 @@ namespace OnlineStore.DeviceLibrary
if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait)) if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道41: 阻挡气缸下降 等待 " + TrayManager.StopDownWaitTime); SWLog("横移轨道41: 阻挡气缸下降 等待 SW4_StopCheck=0" );
IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW4_StopDown, IO_VALUE.HIGH);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_StopCheck, IO_VALUE.LOW));
//SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopDown)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopDown))
{ {
...@@ -507,7 +508,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -507,7 +508,7 @@ namespace OnlineStore.DeviceLibrary
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SWLog("横移轨道41: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime); SWLog("横移轨道41: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime);
CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
} }
else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_WaitTime)) else if (SW41_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_WaitTime))
...@@ -518,14 +519,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -518,14 +519,14 @@ namespace OnlineStore.DeviceLibrary
SWLog("横移轨道41: 等待横移4托盘检测信号 ,SW4_StopDown上升 "); SWLog("横移轨道41: 等待横移4托盘检测信号 ,SW4_StopDown上升 ");
CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
} }
else else
{ {
SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW41_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SWLog("横移轨道41: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime); SWLog("横移轨道41: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime);
CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW4_StopDown, IO_VALUE.LOW);
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH)); SW41_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW4_TrayCheck, IO_VALUE.HIGH));
} }
} }
...@@ -646,9 +647,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -646,9 +647,10 @@ namespace OnlineStore.DeviceLibrary
if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait)) if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW00_Wait))
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW01_StopDown);
SWLog("横移轨道23:阻挡气缸下降 等待 " + TrayManager.StopDownWaitTime); SWLog("横移轨道23:阻挡气缸下降 等待 SW2_StopCheck=0 " );
IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH); IOMove(IO_Type.SW2_StopDown, IO_VALUE.HIGH);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_StopCheck, IO_VALUE.LOW));
// SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopDown)) else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW01_StopDown))
{ {
...@@ -663,7 +665,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -663,7 +665,7 @@ namespace OnlineStore.DeviceLibrary
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime); SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime);
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
} }
else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_WaitTime)) else if (SW23_MoveInfo.MoveStep.Equals(LineMoveStep.SW03_WaitTime))
...@@ -674,14 +676,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -674,14 +676,14 @@ namespace OnlineStore.DeviceLibrary
SWLog("横移轨道23: 等待横移4托盘检测信号 ,SW2_StopDown上升 "); SWLog("横移轨道23: 等待横移4托盘检测信号 ,SW2_StopDown上升 ");
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
} }
else else
{ {
SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime); SW23_MoveInfo.NextMoveStep(LineMoveStep.SW03_WaitTime);
SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime); SWLog("横移轨道23: 等待横移4托盘检测信号 , SW012_WaitTime " + TrayManager.SwTrayWaitTime);
CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW); CheckAndMove(IO_Type.SW2_StopDown, IO_VALUE.LOW);
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime)); // SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.SwTrayWaitTime));
SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH)); SW23_MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SW2_TrayCheck, IO_VALUE.HIGH));
} }
} }
......
...@@ -428,11 +428,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -428,11 +428,11 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
CheckLog(" 托盘检测:料盘检测StopCylinder_Check1 " + SecondMoveInfo.SLog + "阻挡气缸1-1下降 , 等待 "+TrayManager.StopDownWaitTime); CheckLog(" 托盘检测:料盘检测StopCylinder_Check1 " + SecondMoveInfo.SLog + "阻挡气缸1-1下降 , 等待 StopCylinder_Check1=0" );
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.Fixture_Check_4, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check1, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); // SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
} }
protected override void CheckFixtureProcess() protected override void CheckFixtureProcess()
......
...@@ -54,10 +54,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -54,10 +54,11 @@ namespace OnlineStore.DeviceLibrary
//托盘在第一个阻挡处 //托盘在第一个阻挡处
SecondMoveInfo.NewMove(LineMoveType.CheckFixture); SecondMoveInfo.NewMove(LineMoveType.CheckFixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down); SecondMoveInfo.NextMoveStep(LineMoveStep.MIO_00_Stop1Down);
CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,最多等待" + TrayManager.StopDownWaitTime); CheckLog(" 托盘检测:" + SecondMoveInfo.SLog + "阻挡气缸1-1下降 ,等待 StopCylinder_Check1=0" );
IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH); IOMove(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Down1, IO_VALUE.HIGH));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime)); SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.StopCylinder_Check1, IO_VALUE.LOW));
// SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(TrayManager.StopDownWaitTime));
} }
} }
else else
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!