Commit 2ae1c884 LN

增加AGV满料料架入库处理

1 个父辈 90fd6156
此文件类型无法预览
<?xml version="1.0"?>
<doc>
<assembly>
<name>Client</name>
</assembly>
<members>
<member name="T:Asa.Common">
<summary>
公用
</summary>
</member>
<member name="F:Asa.Common.PORT">
<summary>
网络连接的端口
</summary>
</member>
<member name="F:Asa.Common.LOG_PATH">
<summary>
日志文件路径
</summary>
</member>
<member name="F:Asa.Common.HEART">
<summary>
心跳包,HEART
</summary>
</member>
<member name="F:Asa.Common.SERVER_OFF">
<summary>
服务器关闭,OFF
</summary>
</member>
<member name="F:Asa.Common.CLIENT_OFF">
<summary>
客户端关闭,OFF
</summary>
</member>
<member name="T:Asa.Common.Connection_Event">
<summary>
连接事件
</summary>
</member>
<member name="T:Asa.Common.String_Event">
<summary>
显示字符串事件
</summary>
<param name="s"></param>
</member>
<member name="T:Asa.Common.Action_Event">
<summary>
小车动作事件
</summary>
<param name="name"></param>
<param name="action"></param>
<returns></returns>
</member>
<member name="T:Asa.Common.ConsoleEventDelegate">
<summary>
控制台事件
</summary>
<param name="eventType"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.SetConsoleCtrlHandler(Asa.Common.ConsoleEventDelegate,System.Boolean)">
<summary>
添加或删除应用程序处理函数列表
</summary>
<param name="callback"></param>
<param name="add"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.CheckRemoteIP(System.String)">
<summary>
检查远程IP地址
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.CheckLocalIP(System.String)">
<summary>
检查IP地址
</summary>
<param name="ip"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.GetLocalIP">
<summary>
获取本地IPv4地址
</summary>
<returns></returns>
</member>
<member name="M:Asa.Common.HexBuff(System.Byte[])">
<summary>
16进制
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.IsHeart(System.Byte[])">
<summary>
是否心跳包
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.IsServerOffline(System.Byte[])">
<summary>
是否服务器断开
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:Asa.Common.IsClientOffline(System.Byte[])">
<summary>
是否客户端断开
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="T:Asa.Actions">
<summary>
动作
</summary>
</member>
<member name="F:Asa.Actions.ServerClose">
<summary>
服务器关闭(C)
</summary>
</member>
<member name="F:Asa.Actions.ClientClose">
<summary>
客户端关闭(S)
</summary>
</member>
<member name="F:Asa.Actions.SendRFID">
<summary>
发送RFID信息(CS)
</summary>
</member>
<member name="F:Asa.Actions.ReadyEmpty">
<summary>
准备空车(S)
</summary>
</member>
<member name="F:Asa.Actions.ReadyShelf">
<summary>
准备小车带料架(S)
</summary>
</member>
<member name="F:Asa.Actions.MayEnter">
<summary>
可以进入(S)
</summary>
</member>
<member name="F:Asa.Actions.FinishEnter">
<summary>
完成进入(S)
</summary>
</member>
<member name="F:Asa.Actions.MayOut">
<summary>
可以出去(S)
</summary>
</member>
<member name="F:Asa.Actions.FinishOut">
<summary>
完成出去(C)
</summary>
</member>
<member name="F:Asa.Actions.Arrive">
<summary>
小车到达(C)
</summary>
</member>
<member name="F:Asa.Actions.GetOut">
<summary>
小车离开(S)
</summary>
</member>
<member name="F:Asa.Actions.Usable">
<summary>
是否可用(CS)
</summary>
</member>
<member name="T:Asa.IOInfo">
<summary>
IO设备信息
</summary>
</member>
<member name="F:Asa.IOInfo.IP">
<summary>
IP地址
</summary>
</member>
<member name="F:Asa.IOInfo.DI">
<summary>
DI
</summary>
</member>
<member name="F:Asa.IOInfo.DO">
<summary>
DO
</summary>
</member>
<member name="T:Asa.Register">
<summary>
寄存器
</summary>
</member>
<member name="F:Asa.Register.ID">
<summary>
模块寄存器ID
</summary>
</member>
<member name="F:Asa.Register.Name">
<summary>
号码管名称
</summary>
</member>
<member name="F:Asa.Register.Explain">
<summary>
解释说明
</summary>
</member>
<member name="M:Asa.Register.#ctor(System.String,System.String,System.String)">
<summary>
寄存器
</summary>
<param name="ID">模块寄存器ID</param>
<param name="Name">号码管名称</param>
<param name="Explain">解释说明</param>
</member>
<member name="T:BLL.Client">
<summary>
电脑客户端
</summary>
</member>
<member name="E:BLL.Client.Connected">
<summary>
通信连接
</summary>
</member>
<member name="E:BLL.Client.Info">
<summary>
显示信息
</summary>
</member>
<member name="E:BLL.Client.Log">
<summary>
日志信息
</summary>
</member>
<member name="E:BLL.Client.Action">
<summary>
小车动作
</summary>
</member>
<member name="P:BLL.Client.ErrInfo">
<summary>
错误信息
</summary>
</member>
<member name="P:BLL.Client.IsConn">
<summary>
是否连接服务器
</summary>
</member>
<member name="P:BLL.Client.RFID">
<summary>
RFID的内容
</summary>
</member>
<member name="M:BLL.Client.#ctor(System.String)">
<summary>
电脑客户端
</summary>
<param name="RemoteIP">远程IP地址</param>
</member>
<member name="M:BLL.Client.Connect">
<summary>
连接
</summary>
<returns></returns>
</member>
<member name="M:BLL.Client.Close">
<summary>
关闭
</summary>
</member>
<member name="M:BLL.Client.SetNodeID(System.String[])">
<summary>
连接后设置节点ID
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.ReadyEmpty(System.String)">
<summary>
准备空车
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.SendRFID(System.String,System.Byte[])">
<summary>
发送RFID信息
</summary>
<param name="id"></param>
<param name="content"></param>
</member>
<member name="M:BLL.Client.ReadyShelf(System.String)">
<summary>
准备小车带料架
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.MayEnter(System.String)">
<summary>
可以进入
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.FinishEnter(System.String)">
<summary>
完成进入
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.MayOut(System.String)">
<summary>
可以出去
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.GetOut(System.String)">
<summary>
小车离开
</summary>
<param name="id"></param>
</member>
<member name="M:BLL.Client.Send(System.Byte[])">
<summary>
发送命令
</summary>
<param name="buff"></param>
<returns></returns>
</member>
<member name="M:BLL.Client.ListenNet">
<summary>
监听线程
</summary>
</member>
<member name="M:BLL.Client.Resolve">
<summary>
分析数据包
</summary>
</member>
<member name="M:BLL.Client.Splice(System.Byte,System.String,System.Byte[])">
<summary>
拼接命令
</summary>
<param name="code"></param>
<param name="id"></param>
<param name="content"></param>
<returns></returns>
</member>
</members>
</doc>
...@@ -45,6 +45,8 @@ ...@@ -45,6 +45,8 @@
<add key ="UseBuzzer" value ="1"/> <add key ="UseBuzzer" value ="1"/>
<!--IO模块是否主动上传--> <!--IO模块是否主动上传-->
<add key ="AIOAutoUpload" value ="1"/> <add key ="AIOAutoUpload" value ="1"/>
<!--AGV调度服务器地址-->
<add key="AgvServerIp" value="192.168.103.22" />
</appSettings> </appSettings>
<log4net> <log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
...@@ -581,7 +581,7 @@ namespace OnlineStore.ACPackingStore ...@@ -581,7 +581,7 @@ namespace OnlineStore.ACPackingStore
private void btnStoreStart_Click(object sender, EventArgs e) private void btnStoreStart_Click(object sender, EventArgs e)
{ {
bool result= BoxBean.StartRun(); bool result= BoxBean.StartRun(true);
if (result) if (result)
{ {
StoreOpenStatus(true); StoreOpenStatus(true);
......
...@@ -72,6 +72,7 @@ ...@@ -72,6 +72,7 @@
<Compile Include="util\TcpClient.cs" /> <Compile Include="util\TcpClient.cs" />
<Compile Include="util\TcpServer.cs" /> <Compile Include="util\TcpServer.cs" />
<Compile Include="util\UdpServer.cs" /> <Compile Include="util\UdpServer.cs" />
<Compile Include="util\WaitUtil.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<WCFMetadata Include="Service References\" /> <WCFMetadata Include="Service References\" />
......
...@@ -98,6 +98,6 @@ namespace OnlineStore.Common ...@@ -98,6 +98,6 @@ namespace OnlineStore.Common
public static string Tool_TargetSpeed = "Tool_TargetSpeed"; public static string Tool_TargetSpeed = "Tool_TargetSpeed";
public static string Tool_TargetPosition = "Tool_TargetPosition"; public static string Tool_TargetPosition = "Tool_TargetPosition";
public static string AgvServerIp = "AgvServerIp";
} }
} }
...@@ -16,13 +16,13 @@ namespace OnlineStore.Common ...@@ -16,13 +16,13 @@ namespace OnlineStore.Common
private Thread m_serverThread; private Thread m_serverThread;
private Socket m_serverSocket; private Socket m_serverSocket;
public delegate void ReviceMsg(Client client, string Msg); public delegate void ReviceMsg(SocketClient client, string Msg);
/// <summary> /// <summary>
/// 接受到数据事件 /// 接受到数据事件
/// </summary> /// </summary>
public event ReviceMsg ReviceMsgEvent; public event ReviceMsg ReviceMsgEvent;
private delegate void ReceiveMessageDelegate(Client client); private delegate void ReceiveMessageDelegate(SocketClient client);
ReceiveMessageDelegate receiveMessageDelegate; ReceiveMessageDelegate receiveMessageDelegate;
private bool isRun = true; private bool isRun = true;
private void logLocalIp() private void logLocalIp()
...@@ -95,7 +95,7 @@ namespace OnlineStore.Common ...@@ -95,7 +95,7 @@ namespace OnlineStore.Common
{ {
while (isRun) while (isRun)
{ {
Client client = new Client(); SocketClient client = new SocketClient();
try try
{ {
client.ClientSocket = m_serverSocket.Accept(); client.ClientSocket = m_serverSocket.Accept();
...@@ -116,7 +116,7 @@ namespace OnlineStore.Common ...@@ -116,7 +116,7 @@ namespace OnlineStore.Common
private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息 private StringBuilder sb = new StringBuilder(); //这个是用来保存:接收到了的,但是还没有结束的消息
private int receiveBufferSize = 1024; private int receiveBufferSize = 1024;
private string terminateString = "\r"; private string terminateString = "\r";
public void ReceiveMessages(Client client) //这个函数会被以线程方式运行 public void ReceiveMessages(SocketClient client) //这个函数会被以线程方式运行
{ {
try try
{ {
...@@ -243,11 +243,11 @@ namespace OnlineStore.Common ...@@ -243,11 +243,11 @@ namespace OnlineStore.Common
/// <summary> /// <summary>
/// 客户端会话信息类 /// 客户端会话信息类
/// </summary> /// </summary>
public class Client public class SocketClient
{ {
Socket m_clientSocket; Socket m_clientSocket;
public Client() { } public SocketClient() { }
public IPAddress ipAdd { get; set; } public IPAddress ipAdd { get; set; }
public Socket ClientSocket public Socket ClientSocket
{ {
......
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace OnlineStore.Common
{
public class WaitUtil
{
public delegate bool IsOk();
/// <summary>
/// 使用异步委托检测超时,防止isOk方法不返回结果导致卡死的问题
/// </summary>
/// <param name="waitName"></param>
/// <param name="timeout"></param>
/// <param name="isOk"></param>
public static bool Wait(int timeout, IsOk isOk, string waitName = "")
{
DateTime startTime = System.DateTime.Now;
TimeSpan timoutSpan = TimeSpan.FromMilliseconds(timeout);
TimeSpan waitSpan = TimeSpan.FromMilliseconds(0);
int sleepTime = 10;
while (true)
{
TimeSpan remainTimes = timoutSpan.Subtract(waitSpan);
if (remainTimes.TotalMilliseconds < 0)
{
//已经超时
throw new TimeoutException(waitName + "超时");
}
try
{
IAsyncResult re = isOk.BeginInvoke(null, null);
var waitResult = re.AsyncWaitHandle.WaitOne(remainTimes);
if (waitResult)
{
bool okResult = isOk.EndInvoke(re);
if (okResult)
{
return true;
}
}
}
catch (Exception ex)
{
LogUtil.error("同步等待出现异常:" + ex.Message);
}
Thread.Sleep(sleepTime);
waitSpan = System.DateTime.Now.Subtract(startTime);
}
}
}
}
 
using OnlineStore.Common; using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -122,7 +123,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -122,7 +123,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始运行 /// 开始运行
/// </summary> /// </summary>
public override bool StartRun() public override bool StartRun(bool isDebug = false)
{ {
if (!StoreManager.Store.canStart) if (!StoreManager.Store.canStart)
{ {
...@@ -131,7 +132,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -131,7 +132,14 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
LogInfo("开始启动,启动时间:" + StartTime.ToString()); LogInfo("开始启动,启动时间:" + StartTime.ToString());
if (IsDebug)
{
//连接AGV调度
if (!AgvClient.ISConnected())
{
AgvClient.Init();
}
}
AutoInout.StopAuto(); AutoInout.StopAuto();
mainTimer.Enabled = false; mainTimer.Enabled = false;
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
...@@ -377,6 +385,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -377,6 +385,7 @@ namespace OnlineStore.DeviceLibrary
IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH); IOMove(IO_Type.Axis_Brake, IO_VALUE.HIGH);
return true; return true;
} }
/// <summary> /// <summary>
/// 打开所有轴 /// 打开所有轴
/// </summary> /// </summary>
......
...@@ -58,10 +58,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,10 +58,7 @@ namespace OnlineStore.DeviceLibrary
{ {
wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue); wait.IsEnd = IOValue(wait.IoType).Equals(wait.IoValue);
int timeOutMs = Config.IOSingle_TimerOut; int timeOutMs = Config.IOSingle_TimerOut;
if (MoveInfo.MoveStep.Equals(StoreMoveStep.SO_14_WaitTake))
{
timeOutMs = 650000;
}
if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs) if ((!wait.IsEnd) && span.TotalMilliseconds > timeOutMs)
{ {
ConfigIO io = Config.getWaitIO(wait.IoType); ConfigIO io = Config.getWaitIO(wait.IoType);
...@@ -109,6 +106,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -109,6 +106,10 @@ namespace OnlineStore.DeviceLibrary
else if (wait.WaitType.Equals(9)) else if (wait.WaitType.Equals(9))
{ {
wait.IsEnd = (LastScanCodes.Count > 0); wait.IsEnd = (LastScanCodes.Count > 0);
}else if (wait.WaitType.Equals(10))
{
int agvA = (int)AgvClient.GetAction(Config.AgvNodeName);
wait.IsEnd = agvA.Equals(wait.TargetPosition);
} }
if (wait.IsEnd) if (wait.IsEnd)
{ {
...@@ -381,7 +382,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -381,7 +382,7 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy; storeRunStatus = StoreRunStatus.Busy;
MoveInfo.NewMove(StoreMoveType.OutStore, param); MoveInfo.NewMove(StoreMoveType.OutStore, param);
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_32_DeviceBack);
InOutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 开始"); InOutStoreLog("出库:SO_02 叉子先运动到P1 ,打开舱门 开始");
//ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, StoreMove.MoveParam.MoveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1); InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
...@@ -405,37 +406,37 @@ namespace OnlineStore.DeviceLibrary ...@@ -405,37 +406,37 @@ namespace OnlineStore.DeviceLibrary
{ {
return; return;
} }
if (MoveInfo.MoveStep == StoreMoveStep.SO_01_LocationCylinderDown) if (MoveInfo.MoveStep == StoreMoveStep.SO_31_LocationCylinderDown)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_32_DeviceBack);
InOutStoreLog("出库:SO_02 叉子先运动到P1 "); InOutStoreLog("出库:SO_02 叉子先运动到P1 ");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1); InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_02_DeviceBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_32_DeviceBack)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_33_ToBagPosition);
InOutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)"); InOutStoreLog("出库:SO_03 走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
ACAxisMove(Config.Comp_Axis,moveP.ComPress_P3, Config.CompAxis_P3_Speed); ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed); ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P2, Config.MiddleAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_03_ToBagPosition) else if (MoveInfo.MoveStep == StoreMoveStep.SO_33_ToBagPosition)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_04_DeviceToBag); MoveInfo.NextMoveStep(StoreMoveStep.SO_34_DeviceToBag);
InOutStoreLog("出库:SO_04 叉子进入库位中, 进出轴至P3(库位取放料点) "); InOutStoreLog("出库:SO_04 叉子进入库位中, 进出轴至P3(库位取放料点) ");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P3, Config.InOutAxis_P3_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_04_DeviceToBag) else if (MoveInfo.MoveStep == StoreMoveStep.SO_34_DeviceToBag)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_05_BagWareToDevice); MoveInfo.NextMoveStep(StoreMoveStep.SO_35_BagWareToDevice);
InOutStoreLog("出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) "); InOutStoreLog("出库:SO_05 拿起物品,升降轴至P6(库位出料缓冲点),压紧轴至P2(压紧点) ");
ACAxisMove(Config.Comp_Axis,moveP.ComPress_P2, Config.CompAxis_P2_Speed); ACAxisMove(Config.Comp_Axis, moveP.ComPress_P2, Config.CompAxis_P2_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_05_BagWareToDevice) else if (MoveInfo.MoveStep == StoreMoveStep.SO_35_BagWareToDevice)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_06_BagDeviceBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_36_BagDeviceBack);
InOutStoreLog("出库:SO_06 叉子从库位返回,进出轴至P1(待机点) "); InOutStoreLog("出库:SO_06 叉子从库位返回,进出轴至P1(待机点) ");
//ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed); //ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
...@@ -446,7 +447,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -446,7 +447,7 @@ namespace OnlineStore.DeviceLibrary
storeStatus = StoreStatus.OutStoreBoxEnd; storeStatus = StoreStatus.OutStoreBoxEnd;
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_06_BagDeviceBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_36_BagDeviceBack)
{ {
if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
{ {
...@@ -455,83 +456,75 @@ namespace OnlineStore.DeviceLibrary ...@@ -455,83 +456,75 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(CodeMsg); LogUtil.error(CodeMsg);
} }
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_38_ToShelfPosition);
InOutStoreLog("出库:SO_08 走到料架位置,旋转轴至P101,升降轴至P102, "); InOutStoreLog("出库:SO_08 走到料架位置,旋转轴至P101,升降轴至P102, ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_07_LocationCylinder_Up) else if (MoveInfo.MoveStep == StoreMoveStep.SO_37_LocationCylinder_Up)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition); MoveInfo.NextMoveStep(StoreMoveStep.SO_38_ToShelfPosition);
InOutStoreLog("出库:SO_08 走到料架位置,旋转轴至P101,升降轴至P102, "); InOutStoreLog("出库:SO_08 走到料架位置,旋转轴至P101,升降轴至P102, ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed); ACAxisMove(Config.Middle_Axis, moveP.Middle_P101, Config.MiddleAxis_P101_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_08_ToShelfPosition) else if (MoveInfo.MoveStep == StoreMoveStep.SO_38_ToShelfPosition)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray); MoveInfo.NextMoveStep(StoreMoveStep.SO_40_WaitNoTray);
} }
//此处需要等待移栽没有工作,才能把盘放入出料口 //此处需要等待移栽没有工作,才能把盘放入出料口
else if (MoveInfo.MoveStep == StoreMoveStep.SO_09_LocationCylinder_Down) else if (MoveInfo.MoveStep == StoreMoveStep.SO_39_LocationCylinder_Down)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_091_WaitNoTray); MoveInfo.NextMoveStep(StoreMoveStep.SO_40_WaitNoTray);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_091_WaitNoTray) else if (MoveInfo.MoveStep == StoreMoveStep.SO_40_WaitNoTray)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_10_DeviceToShelf); MoveInfo.NextMoveStep(StoreMoveStep.SO_41_DeviceToShelf);
InOutStoreLog("出库:SO_10 叉子进出料口,进出轴至P101"); InOutStoreLog("出库:SO_10 叉子进出料口,进出轴至P101");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P101, Config.InOutAxis_P101_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P101, Config.InOutAxis_P101_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_10_DeviceToShelf) else if (MoveInfo.MoveStep == StoreMoveStep.SO_41_DeviceToShelf)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_11_DevicePutWare); MoveInfo.NextMoveStep(StoreMoveStep.SO_42_DevicePutWare);
InOutStoreLog("出库:SO_11 放下物品,压紧轴到P1,升降轴至P101 "); InOutStoreLog("出库:SO_11 放下物品,压紧轴到P1,升降轴至P101 ");
ACAxisMove(Config.Comp_Axis,moveP.ComPress_P1, Config.CompAxis_P1_Speed); ACAxisMove(Config.Comp_Axis, moveP.ComPress_P1, Config.CompAxis_P1_Speed);
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_LP101, Config.UpDownAxis_P101_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_LP101, Config.UpDownAxis_P101_Speed);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_11_DevicePutWare) else if (MoveInfo.MoveStep == StoreMoveStep.SO_42_DevicePutWare)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_12_DeviceOutFromDoor); MoveInfo.NextMoveStep(StoreMoveStep.SO_43_DeviceOutFromDoor);
InOutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) "); InOutStoreLog("出库:SO_12 叉子从出料口返回,,进出轴动作至P1(待机点) ");
InOutBackToP1(moveP.InOut_P1); InOutBackToP1(moveP.InOut_P1);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_12_DeviceOutFromDoor) else if (MoveInfo.MoveStep == StoreMoveStep.SO_43_DeviceOutFromDoor)
{ {
MoveInfo.NextMoveStep(StoreMoveStep.SO_13_GoBack); MoveInfo.NextMoveStep(StoreMoveStep.SO_44_GoBack);
InOutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,关闭舱门"); InOutStoreLog("出库:SO_13 升降轴返回,轴2至P1(待机点) ,");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
//发送消息给流水线 //发送消息给流水线
// SendOutStoreEnd(MoveInfo); // SendOutStoreEnd(MoveInfo);
} }
else if (MoveInfo.MoveStep == StoreMoveStep.SO_13_GoBack) else if (MoveInfo.MoveStep == StoreMoveStep.SO_44_GoBack)
{ {
// int OutStoreWaitSeconds = ConfigAppSettings.GetIntValue(Setting_Init.OutStoreWaitSeconds); //判断是否需要送出料架
// if (OutStoreWaitSeconds <= 0) if (waitOutStoreList.Count <= 0)
// { {
// OutStoreWaitSeconds = 600;
// }
// int ms = OutStoreWaitSeconds * 1000;
// MoveInfo.NextMoveStep(StoreMoveStep.SO_14_WaitTake);
// InOutStoreLog("出库:SO_14_WaitTake 等待拿走物品,最多等待" + OutStoreWaitSeconds + "秒");
// MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(ms));
// MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.TrayCheck_Door, IO_VALUE.LOW));
// // StoreMove.WaitList.Add(WaitResultInfo.WaitHeight(0));
// MoveInfo.OneWaitCanEndStep = true;
//}
//else if (MoveInfo.MoveStep == StoreMoveStep.SO_14_WaitTake)
//{
TimeSpan span = DateTime.Now - startOutStoreTime;
string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
storeStatus = StoreStatus.StoreOnline; }
LogInfo(" 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!"); else
MoveInfo.EndMove(); {
storeRunStatus = StoreRunStatus.Runing; TimeSpan span = DateTime.Now - startOutStoreTime;
AutoInout.InOutEndProcess(this, StoreMoveType.OutStore); string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
storeStatus = StoreStatus.StoreOnline;
LogInfo(" 【" + posId + "】 整个出库流程结束,耗时【" + FormUtil.GetSpanStr(span) + "】!");
MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
AutoInout.InOutEndProcess(this, StoreMoveType.OutStore);
}
} }
else else
{ {
......
using OnlineStore.Common; using Asa;
using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
...@@ -17,6 +18,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -17,6 +18,7 @@ namespace OnlineStore.DeviceLibrary
private int ComTargetPosition = 0; private int ComTargetPosition = 0;
private int LastWidth = 0; private int LastWidth = 0;
private int LastHeight = 0; private int LastHeight = 0;
private RFIDData LastShelfData = new RFIDData(0);
private void ClearLastTrayInfo() private void ClearLastTrayInfo()
{ {
...@@ -32,64 +34,63 @@ namespace OnlineStore.DeviceLibrary ...@@ -32,64 +34,63 @@ namespace OnlineStore.DeviceLibrary
public void StartShelfInStore() public void StartShelfInStore()
{ {
if (storeRunStatus == StoreRunStatus.Runing) bool canStart = (storeRunStatus.Equals(StoreRunStatus.Runing)
&& MoveInfo.MoveType.Equals(StoreMoveType.None)
&& IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH));
if (!canStart)
{ {
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH)) return;
{ }
LogInfo(" 空闲中,检测到入料口有信号,料架入库:入料口移门打开,");
storeRunStatus = StoreRunStatus.Busy;
storeStatus = StoreStatus.InStoreExecute;
EmprtShelfList = new Queue<string>();
//读取RFID //读取RFID
RFIDData data = RFIDManager.ReadData(Config.RFID_IP); RFIDData data = RFIDManager.ReadData(Config.RFID_IP);
//TODO 判断料架是否正确 //TODO 判断料架是否正确
if (data.RFType.Equals("A")) if (data.RFType.Equals("A"))
{ {
LastShelfData = data;
AgvClient.SendRFID(Config.AgvNodeName, data.ToData());
}
else
{
LogUtil.error(Name + "检测到入料口有料架,读取RFID数据错误:" + data.ToStr());
return;
}
} storeRunStatus = StoreRunStatus.Busy;
else storeStatus = StoreStatus.InStoreExecute;
{ EmprtShelfList = new Queue<string>();
LogUtil.error(Name + "读取RFID数据错误:" + data.ToStr()); LogInfo(" 空闲中,读取到料架" + data.ToStr() + ",料架入库:入料口移门打开,");
} MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam()); MoveInfo.MoveParam.MoveP = new LineMoveP();
MoveInfo.MoveParam.MoveP = new LineMoveP();
MoveInfo.MoveParam.MoveP.ComPress_P1 = Config.CompAxis_P1_Position; MoveInfo.MoveParam.MoveP.ComPress_P1 = Config.CompAxis_P1_Position;
MoveInfo.MoveParam.MoveP.InOut_P1 = Config.InOutAxis_P1_Position; MoveInfo.MoveParam.MoveP.InOut_P1 = Config.InOutAxis_P1_Position;
MoveInfo.MoveParam.MoveP.Middle_P1 = Config.MiddleAxis_P1; MoveInfo.MoveParam.MoveP.Middle_P1 = Config.MiddleAxis_P1;
MoveInfo.MoveParam.MoveP.UpDown_P1 = Config.UpDownAxis_P1; MoveInfo.MoveParam.MoveP.UpDown_P1 = Config.UpDownAxis_P1;
MoveInfo.MoveParam.MoveP.UpDown_P2 = Config.UpDownAxis_P2; MoveInfo.MoveParam.MoveP.UpDown_P2 = Config.UpDownAxis_P2;
MoveInfo.ShelfPositionList = new List<string>(ShelfPosList); MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen); MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen);
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open); CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
}
}
}
private void ShelfInStoreEnd()
{
MoveInfo.EndMove();
EmprtShelfList = new Queue<string>(ShelfPosList);
storeRunStatus = StoreRunStatus.Runing;
storeStatus = StoreStatus.StoreOnline;
} }
private void ShelfInStoreProcess() private void ShelfInStoreProcess()
{ {
LineMoveP moveP = MoveInfo.MoveParam.MoveP; LineMoveP moveP = MoveInfo.MoveParam.MoveP;
#region 料架移入料仓内部处理 #region 料架移入料仓内部处理
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_LineIn_Check)) //if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_LineIn_Check))
{ //{
MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen); // MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen);
InOutStoreLog("料架入库:入料口移门打开"); // InOutStoreLog("料架入库:入料口移门打开");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open); // CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
} //}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_02_DoorOpen)) //else
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_02_DoorOpen))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun); MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun);
InOutStoreLog("料架入库:线体正转,等待取料位检测到信号"); InOutStoreLog("料架入库:调用AgvClient.MayEnter,线体正转,等待取料位检测到信号");
AgvClient.MayEnter(Config.AgvNodeName);
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW); IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
IOMove(IO_Type.Line_Run, IO_VALUE.HIGH); IOMove(IO_Type.Line_Run, IO_VALUE.HIGH);
...@@ -99,9 +100,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -99,9 +100,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_03_LineRun)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_03_LineRun))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_04_LineStop); MoveInfo.NextMoveStep(StoreMoveStep.BI_04_LineStop);
InOutStoreLog("料架入库:取料位检测到信号,停止线体正转"); InOutStoreLog("料架入库:调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW); IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
AgvClient.FinishEnter(Config.AgvNodeName);
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_04_LineStop)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_04_LineStop))
{ {
...@@ -182,7 +183,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -182,7 +183,7 @@ namespace OnlineStore.DeviceLibrary
ComTargetPosition = currPosition; ComTargetPosition = currPosition;
int targetP = currPosition + Config.CompAxis_Down_Position; int targetP = currPosition + Config.CompAxis_Down_Position;
LastHeight = Config.GetComP2PlateH(targetP); LastHeight = Config.GetComP2PlateH(targetP);
InOutStoreLog("料架取料:检测到料叉压紧确认信号,向下押金【"+ComTargetPosition+"】目标【"+ targetP + "】,记录料盘高度【"+LastHeight+"】"); InOutStoreLog("料架取料:检测到料叉压紧确认信号,向下押金【" + ComTargetPosition + "】目标【" + targetP + "】,记录料盘高度【" + LastHeight + "】");
ACAxisMove(Config.Comp_Axis, targetP, Config.CompAxis_P1_Speed); ACAxisMove(Config.Comp_Axis, targetP, Config.CompAxis_P1_Speed);
} }
...@@ -193,7 +194,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -193,7 +194,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.CompAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, Config.InOutAxis_P1_Position, Config.CompAxis_P1_Speed);
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_17_InoutBack)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_17_InoutBack))
{ {
if (IOValue(IO_Type.TrayCheck_3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.TrayCheck_4).Equals(IO_VALUE.HIGH)) if (IOValue(IO_Type.TrayCheck_3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.TrayCheck_4).Equals(IO_VALUE.HIGH))
{ {
LastWidth = 13; LastWidth = 13;
...@@ -245,7 +246,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -245,7 +246,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog("料架取料: 获取库位号完成,设置位置参数,开始入库"); InOutStoreLog("料架取料: 获取库位号完成,设置位置参数,开始入库");
} }
else else
{ {
StartSendTray("获取入库库位失败"); StartSendTray("获取入库库位失败");
} }
} }
...@@ -253,7 +254,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -253,7 +254,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_19_GetPosId)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_19_GetPosId))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_20_SetInstoreParam); MoveInfo.NextMoveStep(StoreMoveStep.BI_20_SetInstoreParam);
InOutStoreLog("料架取料: 获取库位号完成,设置位置参数,开始入库"); InOutStoreLog("料架取料: 获取库位号完成,设置位置参数,开始入库");
} }
#endregion #endregion
...@@ -328,7 +329,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -328,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed); ACAxisMove(Config.Comp_Axis, moveP.ComPress_P3, Config.CompAxis_P3_Speed);
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_34_UpdownDown)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_34_UpdownDown))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_35_InoutToP1); MoveInfo.NextMoveStep(StoreMoveStep.BI_35_InoutToP1);
InOutStoreLog("送出料盘:叉子后退到P1"); InOutStoreLog("送出料盘:叉子后退到P1");
ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed); ACAxisMove(Config.InOut_Axis, moveP.InOut_P1, Config.InOutAxis_P1_Speed);
...@@ -348,15 +349,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -348,15 +349,15 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
//料架送出逻辑 //料架送出逻辑
else if(MoveInfo.MoveStep>= StoreMoveStep.BS_01_TopCylinder_Down&&MoveInfo.MoveStep >= StoreMoveStep. BS_09_CloseDoor) else if (MoveInfo.MoveStep >= StoreMoveStep.BS_01_TopCylinder_Down && MoveInfo.MoveStep >= StoreMoveStep.BS_06_WaitTime)
{ {
SendShelfProcess(); SendShelfProcess();
} }
else else
{ {
LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!"); LogInfo(" 入库,moveStatus=" + MoveInfo.MoveStep + ",没有对应的处理!");
} }
} }
private void StartMoveToBag() private void StartMoveToBag()
{ {
...@@ -366,15 +367,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -366,15 +367,15 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P3, Config.UpDownAxis_P3_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P3, Config.UpDownAxis_P3_Speed);
} }
private void StartSendTray( string str="扫码失败") private void StartSendTray(string str = "扫码失败")
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BI_31_ToNGDoor); MoveInfo.NextMoveStep(StoreMoveStep.BI_31_ToNGDoor);
InOutStoreLog("送出料盘:"+str+",升降轴移动到NG料门口上端,旋转轴移动到NG料门口"); InOutStoreLog("送出料盘:" + str + ",升降轴移动到NG料门口上端,旋转轴移动到NG料门口");
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed); ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1, Config.MiddleAxis_P1_Speed); ACAxisMove(Config.Middle_Axis, MoveInfo.MoveParam.MoveP.Middle_P1, Config.MiddleAxis_P1_Speed);
} }
private void StartSendShelfOut() private void StartSendShelfOut()
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_01_TopCylinder_Down); MoveInfo.NextMoveStep(StoreMoveStep.BS_01_TopCylinder_Down);
...@@ -392,13 +393,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -392,13 +393,20 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_02_LocatinCylinder_Down)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_02_LocatinCylinder_Down))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_03_DoorOpen); MoveInfo.NextMoveStep(StoreMoveStep.BS_03_DoorOpen);
InOutStoreLog("送出料架:打开仓门"); InOutStoreLog("送出料架:打开仓门,调用AgvClient.ReadyEmpty,等待Agv小车到达");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open); CylinderMove(MoveInfo, IO_Type.EntranceDoor_Close, IO_Type.EntranceDoor_Open);
AgvClient.ReadyEmpty(Config.AgvNodeName);
//等待小车到达
MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)Asa.Actions.Arrive));
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_DoorOpen)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_03_DoorOpen))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_04_LineBack); MoveInfo.NextMoveStep(StoreMoveStep.BS_04_LineBack);
InOutStoreLog("送出料架:线体反转"); InOutStoreLog("送出料架:调用AgvClient.SendRFID【" + LastShelfData.ToData() + "】,调用AgvClient.MayOut,线体开始反转");
//TODO AGV到达,发送料架信息,是否需要重新读取?
AgvClient.SendRFID(Config.AgvNodeName, LastShelfData.ToData());
AgvClient.MayOut(Config.AgvNodeName);
IOMove(IO_Type.Line_Run, IO_VALUE.LOW); IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
IOMove(IO_Type.Line_BackRun, IO_VALUE.HIGH); IOMove(IO_Type.Line_BackRun, IO_VALUE.HIGH);
} }
...@@ -412,32 +420,39 @@ namespace OnlineStore.DeviceLibrary ...@@ -412,32 +420,39 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_05_WaitInLineSingle)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_05_WaitInLineSingle))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_06_WaitTime); MoveInfo.NextMoveStep(StoreMoveStep.BS_06_WaitTime);
InOutStoreLog("送出料架:再转动300时间"); InOutStoreLog("送出料架:再转动300时间,同时等待收到FinishOut");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
//等到小车离开
MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)Asa.Actions.FinishOut));
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_06_WaitTime)) else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_06_WaitTime))
{ {
MoveInfo.NextMoveStep(StoreMoveStep.BS_07_LineStop); //结束
InOutStoreLog("送出料架:停止转动"); MoveInfo.EndMove();
storeRunStatus = StoreRunStatus.Runing;
storeStatus = StoreStatus.StoreOnline;
EmprtShelfList = new Queue<string>();
InOutStoreLog("送出料架:停止转动,料架入料结束");
IOMove(IO_Type.Line_Run, IO_VALUE.LOW); IOMove(IO_Type.Line_Run, IO_VALUE.LOW);
IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW); IOMove(IO_Type.Line_BackRun, IO_VALUE.LOW);
} }
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_07_LineStop)) //else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_07_LineStop))
{ //{
MoveInfo.NextMoveStep(StoreMoveStep.BS_08_CallAGV); // MoveInfo.NextMoveStep(StoreMoveStep.BS_08_CallAGV);
InOutStoreLog("送出料架:通知调度系统拿走"); // InOutStoreLog("送出料架:通知调度系统拿走");
//TODO // //TODO
} //}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_08_CallAGV)) //else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_08_CallAGV))
{ //{
MoveInfo.NextMoveStep(StoreMoveStep.BS_09_CloseDoor); // MoveInfo.NextMoveStep(StoreMoveStep.BS_09_CloseDoor);
InOutStoreLog("送出料架:关闭仓门"); // InOutStoreLog("送出料架:关闭仓门");
CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close); // CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
} //}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_09_CloseDoor)) //else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_09_CloseDoor))
{ //{
} //}
} }
...@@ -447,20 +462,21 @@ namespace OnlineStore.DeviceLibrary ...@@ -447,20 +462,21 @@ namespace OnlineStore.DeviceLibrary
{ {
string message = ""; string message = "";
string spiltStr = "##"; string spiltStr = "##";
string codeSize = LastWidth + "x" +LastHeight; string codeSize = LastWidth + "x" + LastHeight;
foreach (string str in LastScanCodes) foreach (string str in LastScanCodes)
{ {
if (str.Trim().Equals("")) if (str.Trim().Equals(""))
{ {
continue; continue;
} }
string code = "=1+0x0-" + codeSize + "=" + str.Trim(); string code = "=1+0x0-" + codeSize + "=" + str.Trim();
if (!String.IsNullOrEmpty(code)) if (!String.IsNullOrEmpty(code))
{ {
message = message + code + spiltStr; message = message + code + spiltStr;
} }
}return message; }
return message;
} }
/// <summary> /// <summary>
...@@ -558,7 +574,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -558,7 +574,7 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
#endregion #endregion
...@@ -608,5 +624,53 @@ namespace OnlineStore.DeviceLibrary ...@@ -608,5 +624,53 @@ namespace OnlineStore.DeviceLibrary
IsInProcess = false; IsInProcess = false;
} }
#endregion #endregion
#region AGV
private bool ProcessShelf = false;
internal bool ProcessAGVAction(string name, Actions action)
{
string logN = name + "收到调度【" + name + "】=【" + action + "】";
//状态处理
if (action.Equals(Asa.Actions.Usable))
{
//判断入口是否可用:入口无料架,缓冲工位无料架,不在入料架处理中
bool usable = (storeRunStatus.Equals(StoreRunStatus.Runing) &&
MoveInfo.MoveType.Equals(StoreMoveType.None) &&
ProcessShelf.Equals(false)
&& IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW)
&& IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW));
LogUtil.info(logN + ":" + usable);
return usable;
}
else if (action.Equals(Asa.Actions.Arrive))
{
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW))
{
LogUtil.info(logN + " ,未检测到:LineIn_Check,不处理");
return false;
}
//小车到达,开始处理
if (storeRunStatus.Equals(StoreRunStatus.Runing) &&
MoveInfo.MoveType.Equals(StoreMoveType.None) &&
ProcessShelf.Equals(false) &&
IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
{
StartShelfInStore();
return true;
}
}
else
{
LogUtil.info(name + logN + " ,未找到相关处理");
}
return false;
}
#endregion
} }
} }
using log4net; using Asa;
using log4net;
using OnlineStore.Common; using OnlineStore.Common;
using OnlineStore.LoadCSVLibrary; using OnlineStore.LoadCSVLibrary;
using System; using System;
...@@ -58,6 +59,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -58,6 +59,9 @@ namespace OnlineStore.DeviceLibrary
{ {
AC_BOX_Bean equip = new AC_BOX_Bean(config); AC_BOX_Bean equip = new AC_BOX_Bean(config);
//增加站号名称
AgvClient.NodeList.Add(config.AgvNodeName);
AddDeviceName(ioList, config.DIODeviceNameList); AddDeviceName(ioList, config.DIODeviceNameList);
BoxMap.Add(config.DeviceID, equip); BoxMap.Add(config.DeviceID, equip);
BoxConfigMap.Add(config.DeviceID, config); BoxConfigMap.Add(config.DeviceID, config);
...@@ -110,6 +114,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -110,6 +114,7 @@ namespace OnlineStore.DeviceLibrary
} }
private void IoCheckTimerProcess(object sender, ElapsedEventArgs e) private void IoCheckTimerProcess(object sender, ElapsedEventArgs e)
{ {
...@@ -117,7 +122,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -117,7 +122,7 @@ namespace OnlineStore.DeviceLibrary
#endregion #endregion
public override bool StartRun( ) public override bool StartRun(bool isDebug = false)
{ {
if (!canStart) if (!canStart)
{ {
...@@ -142,18 +147,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -142,18 +147,22 @@ namespace OnlineStore.DeviceLibrary
LogUtil.info( Name + "开始启动,启动时间:" + StartTime.ToString()); LogUtil.info( Name + "开始启动,启动时间:" + StartTime.ToString());
storeRunStatus = StoreRunStatus.HomeMoving; storeRunStatus = StoreRunStatus.HomeMoving;
StartTime = DateTime.Now; StartTime = DateTime.Now;
//连接AGV调度
if (!AgvClient.ISConnected())
{
AgvClient.Init();
}
mainTimer.Enabled = false; mainTimer.Enabled = false;
isInSuddenDown = false; isInSuddenDown = false;
isNoAirCheck = false; isNoAirCheck = false;
alarmType = StoreAlarmType.None; alarmType = StoreAlarmType.None;
WarnMsg = ""; WarnMsg = "";
foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values) foreach (AC_BOX_Bean box in this.BoxMap.Values)
{ {
if (!moveEquip.IsDebug) if (!box.IsDebug)
{ {
moveEquip.StartRun(); box.StartRun();
} }
} }
...@@ -227,19 +236,19 @@ namespace OnlineStore.DeviceLibrary ...@@ -227,19 +236,19 @@ namespace OnlineStore.DeviceLibrary
bool isInOut = false; bool isInOut = false;
StoreRunStatus runs = StoreRunStatus.Wait; StoreRunStatus runs = StoreRunStatus.Wait;
foreach (AC_BOX_Bean moveEquip in BoxMap.Values) foreach (AC_BOX_Bean box in BoxMap.Values)
{ {
if (!moveEquip.alarmType.Equals(StoreAlarmType.None)) if (!box.alarmType.Equals(StoreAlarmType.None))
{ {
isNeedAlarmLed = true; isNeedAlarmLed = true;
} }
if (moveEquip.MoveInfo.MoveType.Equals(StoreMoveType.InStore) || moveEquip.MoveInfo.MoveType.Equals(StoreMoveType.OutStore)) if (box.MoveInfo.MoveType.Equals(StoreMoveType.InStore) || box.MoveInfo.MoveType.Equals(StoreMoveType.OutStore))
{ {
isInOut = true; isInOut = true;
} }
if (moveEquip.storeRunStatus > runs) if (box.storeRunStatus > runs)
{ {
runs = moveEquip.storeRunStatus; runs = box.storeRunStatus;
} }
} }
...@@ -357,11 +366,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -357,11 +366,11 @@ namespace OnlineStore.DeviceLibrary
// //判断急停 // //判断急停
// else if (this.storeRunStatus >= StoreRunStatus.HomeMoving) // else if (this.storeRunStatus >= StoreRunStatus.HomeMoving)
// { // {
// foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values) // foreach (AC_BOX_Bean box in this.BoxMap.Values)
// { // {
// if (!moveEquip.IsDebug) // if (!box.IsDebug)
// { // {
// moveEquip.TimerProcess(); // box.TimerProcess();
// } // }
// } // }
// } // }
...@@ -395,18 +404,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -395,18 +404,18 @@ namespace OnlineStore.DeviceLibrary
bool isOk = true; bool isOk = true;
//判断是否所有的已经返回完成 //判断是否所有的已经返回完成
foreach (AC_BOX_Bean moveEquip in this.BoxMap.Values) foreach (AC_BOX_Bean box in this.BoxMap.Values)
{ {
if ((moveEquip.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || moveEquip.storeRunStatus.Equals(StoreRunStatus.Reset)) && moveEquip.IsDebug.Equals(false)) if ((box.storeRunStatus.Equals(StoreRunStatus.HomeMoving) || box.storeRunStatus.Equals(StoreRunStatus.Reset)) && box.IsDebug.Equals(false))
{ {
if (moveEquip.alarmType.Equals(StoreAlarmType.None)) if (box.alarmType.Equals(StoreAlarmType.None))
{ {
isOk = false; isOk = false;
break; break;
} }
else else
{ {
WarnMsg = moveEquip.Name + "在复位过程中报警,需要重新复位"; WarnMsg = box.Name + "在复位过程中报警,需要重新复位";
} }
} }
} }
...@@ -425,14 +434,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -425,14 +434,17 @@ namespace OnlineStore.DeviceLibrary
LogUtil.error(Name + WarnMsg); LogUtil.error(Name + WarnMsg);
} }
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType) internal bool AGVProcess(string name, Actions action)
{ {
foreach (AC_BOX_Bean box in this.BoxMap.Values)
{
if (box.Config.AgvNodeName.Equals(name))
{
return box.ProcessAGVAction(name, action);
}
}
return false;
} }
protected override void ReturnHomeProcess()
{
}
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -9,8 +9,17 @@ using System.Threading.Tasks; ...@@ -9,8 +9,17 @@ using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary namespace OnlineStore.DeviceLibrary
{ {
partial class PackingStoreBean partial class PackingStoreBean
{ {
public override void Alarm(StoreAlarmType alarmType, string alarmDetial, string alarmMsg, StoreMoveType storeMoveType)
{
}
protected override void ReturnHomeProcess()
{
}
#region 出库 #region 出库
public override bool StartOutStoreMove(InOutParam param) public override bool StartOutStoreMove(InOutParam param)
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
<Reference Include="Asa.RFID"> <Reference Include="Asa.RFID">
<HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath> <HintPath>..\..\dll\RFID\Asa.RFID.dll</HintPath>
</Reference> </Reference>
<Reference Include="Client">
<HintPath>..\..\dll\Client.dll</HintPath>
</Reference>
<Reference Include="CodeLibrary, Version=1.0.6995.29021, Culture=neutral, processorArchitecture=MSIL"> <Reference Include="CodeLibrary, Version=1.0.6995.29021, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion> <SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\RC1250-AssemblyLine\dll\CodeLibrary.dll</HintPath> <HintPath>..\..\..\RC1250-AssemblyLine\dll\CodeLibrary.dll</HintPath>
...@@ -70,6 +73,7 @@ ...@@ -70,6 +73,7 @@
<Compile Include="ACPackingStore\PackingStoreBean.cs" /> <Compile Include="ACPackingStore\PackingStoreBean.cs" />
<Compile Include="ACPackingStore\PackingStoreBean_Partial.cs" /> <Compile Include="ACPackingStore\PackingStoreBean_Partial.cs" />
<Compile Include="ACPackingStore\StoreManager.cs" /> <Compile Include="ACPackingStore\StoreManager.cs" />
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="device\halcon\CodeManager.cs" /> <Compile Include="device\halcon\CodeManager.cs" />
<Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" /> <Compile Include="device\IO\AIOBOX\AIOBOXManager.cs" />
<Compile Include="device\IO\IOManager.cs" /> <Compile Include="device\IO\IOManager.cs" />
......
...@@ -114,8 +114,9 @@ PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,, ...@@ -114,8 +114,9 @@ PRO,(轴三)进出轴最小限位,InoutAxis_PositionMin,0,,,,,,,
PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,, PRO,(轴一)旋转轴最大限位,MiddleAxis_PositionMax,0,,,,,,,
PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,, PRO,(轴二)升降轴最大限位,UpdownAxis_PositionMax,0,,,,,,,
PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,, PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, , ,,,,,,,,,,
,,,,,,,,, , PRO,AGV小车站号名称,AgvNodeName,B1,,,,,,,
,,,,,,,,,,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,, PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, , PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, , PRO,预警湿度,WarnHumidity,80,,,,,, ,
......
...@@ -115,6 +115,8 @@ PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,, ...@@ -115,6 +115,8 @@ PRO,(轴三)进出轴最大限位,InoutAxis_PositionMax,0,,,,,,,
,,,,,,,,, , ,,,,,,,,, ,
PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,, PRO,气压检测IO关闭需要持续的时间,AirCheckSeconds,3,,,,,,,
,,,,,,,,,, ,,,,,,,,,,
PRO,AGV小车站号名称,AgvNodeName,B2,,,,,,,
,,,,,,,,,,
PRO,预警温度,WarnTemperate,80,,,,,, , PRO,预警温度,WarnTemperate,80,,,,,, ,
PRO,预警湿度,WarnHumidity,80,,,,,, , PRO,预警湿度,WarnHumidity,80,,,,,, ,
PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,, PRO,出入库多少次,会自动重置旋转轴,Box_ResetMCount,1000,,,,,,,
......
using BLL;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace OnlineStore.DeviceLibrary
{
public class AgvClient
{
private static string ServerIp = ConfigAppSettings.GetValue(Setting_Init.AgvServerIp);
//private string NodeName = "";
private static Client agvClient = null;
public static Dictionary<string, Asa.Actions> actionMap = new Dictionary<string, Asa.Actions>();
public static List<string> NodeList = new List<string>();
public static void Init( )
{
try
{
// this.NodeName = nodeID;
if (agvClient == null)
{
agvClient = new Client(ServerIp);
}
actionMap = new Dictionary<string, Asa.Actions>();
foreach(string key in NodeList)
{
actionMap.Add(key, Asa.Actions.ClientClose);
}
agvClient.Info += AgvClient_Info;
agvClient.Log += AgvClient_Log;
agvClient.Connected += AgvClient_Connected;
agvClient.Action += AgvClient_Action;
agvClient.Connect();
}
catch (Exception ex)
{
LogUtil.error("初始化agvClient " + ServerIp + " 出错:" + ex.ToString());
}
}
internal static bool ISConnected()
{
if (agvClient == null)
{
return false;
}
return agvClient.IsConn;
}
/// <summary>
///02 发送RFID
/// </summary>
/// <param name="NodeName"></param>
internal static void SendRFID(string NodeName, byte[] data)
{
agvClient.SendRFID(NodeName, data);
}
/// <summary>
/// 10 准备空车
/// </summary>
/// <param name="NodeName"></param>
internal static void ReadyEmpty(string NodeName)
{
agvClient.ReadyEmpty(NodeName);
}
/// <summary>
/// 11 准备小车带料架
/// </summary>
/// <param name="NodeName"></param>
internal static void ReadyShelf(string NodeName)
{
agvClient.ReadyShelf(NodeName);
}
/// <summary>
/// 12 可以进入
/// </summary>
/// <param name="NodeName"></param>
internal static void MayEnter(string NodeName)
{
agvClient.MayEnter(NodeName);
}
/// <summary>
///13 完成进入
/// </summary>
/// <param name="NodeName"></param>
internal static void FinishEnter(string NodeName)
{
agvClient.FinishEnter(NodeName);
}
/// <summary>
/// 14 可以出去
/// </summary>
/// <param name="NodeName"></param>
internal static void MayOut(string NodeName)
{
agvClient.MayOut(NodeName);
}
/// <summary>
///17 小车离开
/// </summary>
/// <param name="NodeName"></param>
internal static void GetOut(string NodeName)
{
agvClient.GetOut(NodeName);
}
private static bool AgvClient_Action(string name, Asa.Actions action)
{
if (actionMap.ContainsKey(name))
{
actionMap[name] = action;
}
else
{
actionMap.Add(name, action);
}
return StoreManager.Store.AGVProcess(name, action);
}
private static void AgvClient_Connected()
{
agvClient.SetNodeID(NodeList.ToArray());
}
private static void AgvClient_Log(string s)
{
LogUtil.info("AGV "+ ServerIp + " Log:" + s);
}
private static void AgvClient_Info(string s)
{
LogUtil.info("AGV "+ ServerIp + " Info:" + s);
}
public static Asa.Actions GetAction(string NodeName)
{
if (actionMap.ContainsKey(NodeName))
{
return actionMap[NodeName];
}
return Asa.Actions.ClientClose;
}
public static void Dispose()
{
try
{
if (agvClient != null)
{
agvClient.Close();
}
}
catch (Exception ex)
{
LogUtil.error("释放 agvClient "+ ServerIp + " 出错:" + ex.ToString());
}
}
}
}
...@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -135,7 +135,7 @@ namespace OnlineStore.DeviceLibrary
return WriteData(IP, sendData, 3); return WriteData(IP, sendData, 3);
} }
public static RFIDData ReadData(string IP) public static RFIDData ReadData(string IP)
{ {
byte[] reviceData = ReadData(IP, 3); byte[] reviceData = ReadData(IP, 3);
if (reviceData != null) if (reviceData != null)
{ {
...@@ -143,6 +143,11 @@ namespace OnlineStore.DeviceLibrary ...@@ -143,6 +143,11 @@ namespace OnlineStore.DeviceLibrary
} }
return null; return null;
} }
//public static byte[] ReadData(string IP)
//{
// byte[] reviceData = ReadData(IP, 3);
// return reviceData;
//}
public static string SearchIP(string localIp) public static string SearchIP(string localIp)
{ {
string ip = ""; string ip = "";
...@@ -248,7 +253,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -248,7 +253,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary> /// </summary>
public int Num = 0; public int Num = 0;
public RFIDData (int num,char t='E') public RFIDData (int num,char t='A')
{ {
this.RFType = t; this.RFType = t;
this.Num = num; this.Num = num;
......
...@@ -76,6 +76,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -76,6 +76,16 @@ namespace OnlineStore.DeviceLibrary
/// 是否是放入锡膏(在线料仓才需要此字段) /// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary> /// </summary>
public bool IsSolderPaste { get; set; } public bool IsSolderPaste { get; set; }
/// <summary>
/// 出入库时需要进入新料架
/// </summary>
public bool NeedEnterShelf = true;
/// <summary>
/// 出入库结束后需要将料架送出
/// </summary>
public bool NeedOutShelf = true;
/// <summary> /// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1 /// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
/// </summary> /// </summary>
......
...@@ -202,7 +202,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -202,7 +202,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 开始运行 /// 开始运行
/// </summary> /// </summary>
public abstract bool StartRun(); public abstract bool StartRun(bool isDebug = false);
/// <summary> /// <summary>
/// 停止运行 /// 停止运行
/// </summary> /// </summary>
...@@ -471,7 +471,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -471,7 +471,15 @@ namespace OnlineStore.DeviceLibrary
{ {
return IOManager.IOValue(IoType, baseConfig.DeviceID); return IOManager.IOValue(IoType, baseConfig.DeviceID);
} }
/// <summary>
/// 阻塞等待IO信号,等到返回true,未等到返回false
/// </summary>c
public bool WaitIo(string ioType, IO_VALUE value, int timeOut, string errName = "")
{
return WaitUtil.Wait(timeOut, delegate () {
return value.Equals(IOValue(ioType));
}, errName);
}
public void LogInfo(string logInfo) public void LogInfo(string logInfo)
{ {
LogUtil.info(Name + logInfo); LogUtil.info(Name + logInfo);
......
...@@ -159,71 +159,94 @@ namespace OnlineStore.DeviceLibrary ...@@ -159,71 +159,94 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
///料仓出库,,定位气缸下降 ///料仓出库,,定位气缸下降
/// </summary> /// </summary>
SO_01_LocationCylinderDown =10101, SO_31_LocationCylinderDown =10131,
/// <summary> /// <summary>
///料仓出库:叉子先运动到P1 ///料仓出库:叉子先运动到P1
/// </summary> /// </summary>
SO_02_DeviceBack =10102, SO_32_DeviceBack =10132,
/// <summary> /// <summary>
/// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点) /// 料仓出库,,所有轴运行到库位, 轴4( 压紧) 至P3(压紧前点) ,轴1( 转盘) 至P2( 库位点),轴2(上下) 至P5(库位出库前点)
/// </summary> /// </summary>
SO_03_ToBagPosition =10103, SO_33_ToBagPosition =10133,
/// <summary> /// <summary>
/// 料仓出库,,叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点) /// 料仓出库,,叉子进入库位中, 轴3( 叉子) 至P3(库位取放料点)
/// </summary> /// </summary>
SO_04_DeviceToBag =10104, SO_34_DeviceToBag =10134,
/// <summary> /// <summary>
///料仓出库,, 库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点) ///料仓出库,, 库位的物品放入叉子上,轴2( 上下) 至P6( 库位出料缓冲点),轴4( 压紧) 至P2(压紧点)
/// </summary> /// </summary>
SO_05_BagWareToDevice =10105, SO_35_BagWareToDevice =10135,
/// <summary> /// <summary>
///料仓出库,,叉子从 库位返回,轴3( 叉子) 至P1( 待机点) ///料仓出库,,叉子从 库位返回,轴3( 叉子) 至P1( 待机点)
/// </summary> /// </summary>
SO_06_BagDeviceBack =10106, SO_36_BagDeviceBack =10136,
/// <summary> /// <summary>
/// 料仓出库,定位气缸伸出(有压紧轴的不需要此步骤 ) /// 料仓出库,定位气缸伸出(有压紧轴的不需要此步骤 )
/// </summary> /// </summary>
SO_07_LocationCylinder_Up =10107, SO_37_LocationCylinder_Up =10137,
/// <summary> /// <summary>
/// 料仓出库,走到料架位置,旋转轴至P101,升降轴至P102, /// 料仓出库,走到料架位置,旋转轴至P101,升降轴至P102,
/// </summary> /// </summary>
SO_08_ToShelfPosition = 10108, SO_38_ToShelfPosition = 10138,
/// <summary> /// <summary>
/// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位 /// 料仓出库,定位气缸退回(有压紧轴的不需要此步骤),,定位气缸退回(Y104-1/PCI5O1-84) (Y104-2/PCI5O1-91) (Y104-2/PCI5O1-96) 退回到位
/// </summary> /// </summary>
SO_09_LocationCylinder_Down =10109, SO_39_LocationCylinder_Down =10139,
/// <summary> /// <summary>
/// 等待门口无料盘 /// 等待门口无料盘
/// </summary> /// </summary>
SO_091_WaitNoTray =10115, SO_40_WaitNoTray =10140,
/// <summary> /// <summary>
/// 料仓出库,叉子到料架,进出轴至P101 /// 料仓出库,叉子到料架,进出轴至P101
/// /// </summary> /// /// </summary>
SO_10_DeviceToShelf = 10110, SO_41_DeviceToShelf = 10141,
/// <summary> /// <summary>
/// 料仓出库,,把物品放下,压紧轴到P1,升降轴至P101 /// 料仓出库,,把物品放下,压紧轴到P1,升降轴至P101
/// </summary> /// </summary>
SO_11_DevicePutWare = 10111, SO_42_DevicePutWare = 10142,
/// <summary> /// <summary>
/// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点) /// 料仓出库,,叉子从出料口返回,,轴3( 叉子) 动作至P1( 待机点)
/// </summary> /// </summary>
SO_12_DeviceOutFromDoor =10112, SO_43_DeviceOutFromDoor =10143,
/// <summary> /// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点) /// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// </summary> /// </summary>
SO_13_GoBack =10113, SO_44_GoBack =10144,
/// <summary>
/// 送出料架:顶升气缸下降
/// </summary>
SO_51_TopCylinder_Down = 10151,
/// <summary>
/// 送出料架:定位气缸下降
/// </summary>
SO_52_LocatinCylinder_Down = 10152,
/// <summary>
/// 送出料架:打开仓门
/// </summary>
SO_53_DoorOpen = 10153,
/// <summary>
/// 送出料架:线体反转
/// </summary>
SO_54_LineBack = 10154,
/// <summary>
/// 送出料架:等待取料工位无信号,入料口有信号
/// </summary>
SO_55_WaitInLineSingle = 10155,
/// <summary> /// <summary>
/// 等待拿走物品 /// 送出料架:再转动300时间
/// </summary> /// </summary>
SO_14_WaitTake =10114, SO_56_WaitTime = 10156,
#endregion #endregion
...@@ -296,7 +319,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -296,7 +319,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary> /// <summary>
/// 料架入库:检测到线体入料口信号 /// 料架入库:检测到线体入料口信号
/// </summary> /// </summary>
BI_01_LineIn_Check= 20001, BI_01_LineIn_Check = 20001,
/// <summary> /// <summary>
/// 料架入库:入料口移门打开 /// 料架入库:入料口移门打开
/// </summary> /// </summary>
...@@ -443,18 +466,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -443,18 +466,18 @@ namespace OnlineStore.DeviceLibrary
/// 送出料架:再转动300时间 /// 送出料架:再转动300时间
/// </summary> /// </summary>
BS_06_WaitTime = 21006, BS_06_WaitTime = 21006,
/// <summary> ///// <summary>
/// 送出料架:停止转动 ///// 送出料架:停止转动
/// </summary> ///// </summary>
BS_07_LineStop= 21007, //BS_07_LineStop= 21007,
/// <summary> ///// <summary>
/// 送出料架:通知调度系统拿走 ///// 送出料架:通知调度系统拿走
/// </summary> ///// </summary>
BS_08_CallAGV = 21008, //BS_08_CallAGV = 21008,
/// <summary> ///// <summary>
/// 送出料架:关闭仓门 ///// 送出料架:关闭仓门
/// </summary> ///// </summary>
BS_09_CloseDoor= 21009, //BS_09_CloseDoor= 21009,
#endregion #endregion
} }
......
...@@ -266,7 +266,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -266,7 +266,15 @@ namespace OnlineStore.DeviceLibrary
wait.IsEnd = false; wait.IsEnd = false;
return wait; return wait;
} }
public static WaitResultInfo WaitAgvAction( int arrive)
{
WaitResultInfo wait = new WaitResultInfo();
wait.CanWhileMoveCount = 0;
wait.WaitType = 10;
wait.TargetPosition = arrive;
wait.IsEnd = false;
return wait;
}
public string ToStr() public string ToStr()
{ {
if (WaitType == 1) if (WaitType == 1)
...@@ -301,13 +309,16 @@ namespace OnlineStore.DeviceLibrary ...@@ -301,13 +309,16 @@ namespace OnlineStore.DeviceLibrary
return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 "; return "轴【" + AxisInfo.DisplayStr + "】ORG信号:【" + IoValue + "】 ";
}else if (WaitType == 7) }else if (WaitType == 7)
{ {
return "料盘高度【" + HeightValue + "】 "; return "料盘高度【" + TargetPosition + "】 ";
}else if (WaitType.Equals(8)) }else if (WaitType.Equals(8))
{ {
return "压紧轴压紧到位"; return "压紧轴压紧到位";
}else if (WaitType.Equals(9)) }else if (WaitType.Equals(9))
{ {
return "扫码完成"; return "扫码完成";
}else if (WaitType.Equals(10))
{
return "agv小车状态:" + (Asa.Actions)TargetPosition;
} }
else else
{ {
...@@ -359,10 +370,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -359,10 +370,8 @@ namespace OnlineStore.DeviceLibrary
/// 是否已经结束 /// 是否已经结束
/// </summary> /// </summary>
public bool IsEnd{ get; set; } public bool IsEnd{ get; set; }
/// <summary>
/// 高度
/// </summary>
public int HeightValue { get; set; }
} }
public enum StoreMoveType public enum StoreMoveType
{ {
......
...@@ -16,7 +16,13 @@ namespace OnlineStore.LoadCSVLibrary ...@@ -16,7 +16,13 @@ namespace OnlineStore.LoadCSVLibrary
: base(id, cid, type, filepath) : base(id, cid, type, filepath)
{ {
} }
/// <summary>
/// PRO,AGV小车站号名称,AgvNodeName,B2,,,,,,,
/// </summary>
[ConfigProAttribute("AgvNodeName")]
public string AgvNodeName { get; set; }
/// <summary> /// <summary>
/// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000 /// PRO (轴一)旋转轴原点目标速度 MiddleAxis_TargetSpeed 30000
/// </summary> /// </summary>
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!