Commit 2ae1c884 LN

增加AGV满料料架入库处理

1 个父辈 90fd6156
此文件类型无法预览
此文件的差异被折叠, 点击展开。
...@@ -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>
......
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!