Commit fda93fd3 LN

1,出料机构的料架rfid上传到环形线。

2,环形线增加夹爪忽略的料号配置,此类料盘夹爪不检测是否有料
1 个父辈 01e1274f
......@@ -63,6 +63,8 @@
<add key="ShowIOForm" value="0" />
<add key="RfidServer_Port" value="12001" />
<add key ="TrayHeightList" value ="8;12;16;20;24;28;36;48"/>
<!--夹爪夹紧时忽略的料号列表,多个用#分割-->
<add key ="PNList" value ="3402021720#"/>
</appSettings>
<log4net>
<appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender">
......
......@@ -769,21 +769,21 @@ namespace OnlineStore.AssemblyLine
private void btnOutStore_Click(object sender, EventArgs e)
{
//模拟出库测试
if (equipBean.runStatus > LineRunStatus.Wait && equipBean.MoveInfo.MoveType.Equals(LineMoveType.None))
{
InOutParam param = new InOutParam(999, "barcode-test", "posid-test", 12, 7, false, false, true);
LogUtil.info(equipBase.Name + "点击出库测试:" + param.ToShortStr());
bool result = equipBean.StartTrayOut(param);
if (!result)
{
MessageBox.Show("出库测试失败,详情请查看日志!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("未启动或不在空闲中,出库测试失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
////模拟出库测试
//if (equipBean.runStatus > LineRunStatus.Wait && equipBean.MoveInfo.MoveType.Equals(LineMoveType.None))
//{
// InOutParam param = new InOutParam(999, "barcode-test", "posid-test", 12, 7, false, false, true);
// LogUtil.info(equipBase.Name + "点击出库测试:" + param.ToShortStr());
// bool result = equipBean.StartTrayOut(param);
// if (!result)
// {
// MessageBox.Show("出库测试失败,详情请查看日志!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
// }
//}
//else
//{
// MessageBox.Show("未启动或不在空闲中,出库测试失败!", "提示", MessageBoxButtons.OK, MessageBoxIcon.Error);
//}
}
private int TargetP3 = 0;
private bool StartTest = false ;
......
......@@ -144,10 +144,14 @@ namespace OnlineStore.AssemblyLine
if (box != null)
{
string posId = "";
if (!String.IsNullOrEmpty(box.CurrPosId))
if (!String.IsNullOrEmpty(box.rfids))
{
posId = "[" + box.CurrPosId + "]";
posId = "[" + box.rfids + "]";
}
if (!String.IsNullOrEmpty(box.CurrPosId))
{
posId += "[" + box.CurrPosId + "]";
}
if ((DateTime.Now - box.LastMsgTime).TotalSeconds < LineServer.ClientKeepSecond)
{
online = "✔";
......
......@@ -103,5 +103,7 @@ namespace OnlineStore.Common
public static string TrayHeightList = "TrayHeightList";
public static string PNList = "PNList";
}
}
......@@ -75,7 +75,6 @@
</ItemGroup>
<ItemGroup>
<Compile Include="agvClient\AgvClient.cs" />
<Compile Include="assemblyLine\FeedingEquip_OutStore.cs" />
<Compile Include="assemblyLine\HY\HYEquipBase.cs" />
<Compile Include="assemblyLine\HY\HY_C1_SLStation.cs" />
<Compile Include="assemblymanager\ALineManager.cs" />
......
......@@ -111,16 +111,16 @@ namespace OnlineStore.DeviceLibrary
private void StartReset()
{
if (OutStoreHeight > 0)
{
LogInfo("复位前,清理出库高度:" + OutStoreHeight);
}
//if (OutStoreHeight > 0)
//{
// LogInfo("复位前,清理出库高度:" + OutStoreHeight);
//}
ClampJwa.Reset();
//复位时设置状态为none
AgvClient.SetStatus(Config.AgvInName);
AgvClient.SetStatus(Config.AgvOutName);
OutStoreHeight = -1;
//OutStoreHeight = -1;
//OutStoreCount = 0;
BatchAxisStopCheck();
ResetClearData();
......@@ -425,10 +425,10 @@ namespace OnlineStore.DeviceLibrary
{
StartInStoreP();
}
else
{
StartOutStoreP();
}
//else
//{
// StartOutStoreP();
//}
}
AgvStatusPro();
......@@ -1146,15 +1146,15 @@ namespace OnlineStore.DeviceLibrary
string msg = "";
int tLength = 15;
string leftTask = "";
if (taskData != null)
{
leftTask = "剩余任务:" + taskData.ToStr();
}
//if (taskData != null)
//{
// leftTask = "剩余任务:" + taskData.ToStr();
//}
msg += "料架:" + CurrShelfId + " "+leftTask + "\r\n";
if (LastOutParam.rfid != "")
{
msg += "出库信息:" + LastOutParam.ToShortStr() + "\r\n";
}
//if (LastOutParam.rfid != "")
//{
// msg += "出库信息:" + LastOutParam.ToShortStr() + "\r\n";
//}
msg += "当前托盘:" + currTrayNum + " 上个托盘:" + preTrayNum + "\n";
msg += "runS: " + runStatus + "\n";
......
......@@ -377,7 +377,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_CylinderTighten);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移机构夹紧");
ClampJwa.Push(MoveInfo);
ClampJwa.Push(MoveInfo,true,lastcode);
}
else if (MoveInfo.IsStep(LineMoveStep.FI_23_CylinderTighten))
{
......@@ -390,9 +390,16 @@ namespace OnlineStore.DeviceLibrary
if (UpdownIsInP1())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CheckTray);
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW 且夹爪有料");
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_AxisLocationCheck, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
if (LineManager.NeedWaitHassReel(lastcode))
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW 且夹爪有料");
MoveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
}
else
{
InLog("料盘移栽" + MoveInfo.SLog + ":等待 SL_AxisLocationCheck=LOW 不需要验证夹爪有料");
}
}
else
{
......@@ -937,6 +944,8 @@ namespace OnlineStore.DeviceLibrary
LastCodeList = new List<string>(NextCodeList);
NextCodeList = new List<string>();
MoveInfo.NextMoveStep(LineMoveStep.FI_20_CylinderTake);
lastcode = CodeManager.ProcessCode(LastCodeList);
InLog("料盘移栽" + MoveInfo.SLog + ":上料横移取料端");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Give, IO_Type.SL_MoveCylinder_Take);
}
......@@ -955,7 +964,8 @@ namespace OnlineStore.DeviceLibrary
if (!hasRightCode)
{
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name, false, 3000);
}
}
lastcode = CodeManager.ProcessCode(LastCodeList);
return LastCodeList;
});
}
......@@ -1126,51 +1136,51 @@ namespace OnlineStore.DeviceLibrary
//是出料的模块
if (Config.IsCanOut.Equals(1))
{
//此托盘是紧急出料盘,需要通过料架出库
bool debugNeed = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InOrOutStore.Equals(2);
debugNeed = false;
////此托盘是紧急出料盘,需要通过料架出库
//bool debugNeed = (runStatus >= LineRunStatus.Runing) && info.IsFull && info.InOrOutStore.Equals(2);
//debugNeed = false;
bool isJinji = (param.cutReel||param.urgentReel) && info.InOrOutStore.Equals(2) && info.IsFull && runStatus >= LineRunStatus.Runing;
//bool isJinji = (param.urgentReel || param.cutReel) && info.InOrOutStore.Equals(2) && info.IsFull && runStatus >= LineRunStatus.Runing;
//bool isJinji = (param.cutReel||param.urgentReel) && info.InOrOutStore.Equals(2) && info.IsFull && runStatus >= LineRunStatus.Runing;
////bool isJinji = (param.urgentReel || param.cutReel) && info.InOrOutStore.Equals(2) && info.IsFull && runStatus >= LineRunStatus.Runing;
if (debugNeed || isJinji)
{
//if (debugNeed || isJinji)
//{
//判断是否有料架,是否可以出库
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.LOW))
{
LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,定位工位无料架,暂不处理", DeviceID * 1000 + 16);
return false;
}
else if (OutStoreHeight < 0)
{
LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,料架未准备好,暂不处理", DeviceID * 1000 + 17);
return false;
}
// //判断是否有料架,是否可以出库
// if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.LOW))
// {
// LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,定位工位无料架,暂不处理", DeviceID * 1000 + 16);
// return false;
// }
// else if (OutStoreHeight < 0)
// {
// LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,料架未准备好,暂不处理", DeviceID * 1000 + 17);
// return false;
// }
//如果已经开始送出料架,暂不处理
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && MoveInfo.MoveStep >= LineMoveStep.FO_51_BatchAxisToP2)
{
LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,正在送出料架,暂不处理", DeviceID * 1000 + 18);
return false;
}
string lastXuniRfid = LastOutParam.rfid;
if (String.IsNullOrEmpty(lastXuniRfid).Equals(false) && (!lastXuniRfid.Equals(param.rfid)))
{
//如果流水线还有次料架的任务,暂不送出
int count = TrayManager.GetOutTaskByRfid(lastXuniRfid);
if (count > 0)
{
LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,料架号不一致[" + lastXuniRfid + "][" + param.rfid + "],当前料架还有【" + count + "】个任务,托盘先离开", DeviceID * 1000 + 19);
return false;
}
}
//if (NeedSaveParam)
//{
// LogInfo(" 【" + info.ToStr() + "】需要出库 ,拦截托盘 ");
//}
return true;
}
// //如果已经开始送出料架,暂不处理
// if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && MoveInfo.MoveStep >= LineMoveStep.FO_51_BatchAxisToP2)
// {
// LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,正在送出料架,暂不处理", DeviceID * 1000 + 18);
// return false;
// }
// string lastXuniRfid = LastOutParam.rfid;
// if (String.IsNullOrEmpty(lastXuniRfid).Equals(false) && (!lastXuniRfid.Equals(param.rfid)))
// {
// //如果流水线还有次料架的任务,暂不送出
// int count = TrayManager.GetOutTaskByRfid(lastXuniRfid);
// if (count > 0)
// {
// LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,料架号不一致[" + lastXuniRfid + "][" + param.rfid + "],当前料架还有【" + count + "】个任务,托盘先离开", DeviceID * 1000 + 19);
// return false;
// }
// }
// //if (NeedSaveParam)
// //{
// // LogInfo(" 【" + info.ToStr() + "】需要出库 ,拦截托盘 ");
// //}
// return true;
//}
}
else if (!info.IsFull)
......@@ -1243,7 +1253,17 @@ namespace OnlineStore.DeviceLibrary
return false;
}
public override bool StartOutStoreMove(InOutParam param)
{
return false;
}
protected override void OutStoreProcess()
{
}
#endregion
}
......
......@@ -353,23 +353,23 @@ namespace OnlineStore.DeviceLibrary
FeedingEquip feed = LineManager.Line.FeedingEquipMap[Config.WorkDeviceId];
if (feed.Config.IsCanOut.Equals(1))
{
TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum);
//紧急出料
if (feed.StartTrayOut(trayInfo.InoutPar))
{
MoveInfo.NextMoveStep(LineMoveStep.HY08_SL_WaitProcessReel);
CheckLog("托盘阻挡" + MoveInfo.SLog + " " + feed.Name + "始抓料,等待料盘放入或料盘离开 ");
}
else if (MoveInfo.IsTimeOut(30))
{
MoveTimeOut(MoveInfo, "等待" + feed.Name + "开始出库超时");
//如果当前无料串,或者料串已离开,直接放行 托盘
TrayCanLeave();
}
else if (MoveInfo.IsTimeOut(20))
{
MoveTimeOut(MoveInfo, "等待" + feed.Name + "开始出库超时");
}
//TrayInfo trayInfo = TrayManager.GetTrayInfo(currTrayNum);
////紧急出料
//if (feed.StartTrayOut(trayInfo.InoutPar))
//{
// MoveInfo.NextMoveStep(LineMoveStep.HY08_SL_WaitProcessReel);
// CheckLog("托盘阻挡" + MoveInfo.SLog + " " + feed.Name + "始抓料,等待料盘放入或料盘离开 ");
//}
//else if (MoveInfo.IsTimeOut(30))
//{
// MoveTimeOut(MoveInfo, "等待" + feed.Name + "开始出库超时");
// //如果当前无料串,或者料串已离开,直接放行 托盘
// TrayCanLeave();
//}
//else if (MoveInfo.IsTimeOut(20))
//{
// MoveTimeOut(MoveInfo, "等待" + feed.Name + "开始出库超时");
//}
}
else
{
......
......@@ -310,7 +310,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MO_54_CylinderOpen);
ClampEmptyMove = false;
ClampJwa.Push(MoveInfo);
ClampJwa.Push(MoveInfo,true,MoveInfo.MoveParam.WareCode);
if (ClampCount <= 0)
{
OutLog("出库 " + MoveInfo.SLog + ": 夹料气缸夹紧,更新料盘位置【" + MoveInfo.MoveParam.WareCode + "】【MOVING】【" + DeviceID + "】");
......@@ -341,7 +341,7 @@ namespace OnlineStore.DeviceLibrary
if (UpdownIsUp())
{
//if (IOValue(IO_Type.ClampCylinder_Check).Equals(IO_VALUE.HIGH))
if (ClampJwa.HasReel())
if (ClampJwa.HasReel() || (!LineManager.NeedWaitHassReel(MoveInfo.MoveParam.WareCode)))
{
if (IsBigStore())
{
......@@ -576,7 +576,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.MI_05_CylinderOpen);
InLog("入库 " + MoveInfo.SLog + ": 夹料气缸夹紧");
ClampEmptyMove = false;
ClampJwa.Push(MoveInfo);
ClampJwa.Push(MoveInfo, true, MoveInfo.MoveParam.WareCode);
EDataManager.UpdateParam(DeviceID, 1, MoveInfo.MoveParam);
}
else if (MoveInfo.IsStep(LineMoveStep.MI_05_CylinderOpen))
......@@ -588,9 +588,9 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(LineMoveStep.MI_06_CylinderUp))
{
if (ClampJwa.HasReel())
if (ClampJwa.HasReel() || (!LineManager.NeedWaitHassReel(MoveInfo.MoveParam.WareCode)))
{
MI_08_WaitBox();
MI_08_WaitBox();
}
else
{
......
......@@ -282,5 +282,37 @@ namespace OnlineStore.DeviceLibrary
}
return trayHeightList;
}
private static List<string> PnList = null;
public static List<string> GetPnList()
{
if (PnList == null)
{
string config = ConfigAppSettings.GetValue(Setting_Init.PNList);
string[] array = config.Split('#');
foreach (string s in array)
{
if (!String.IsNullOrEmpty(s))
{
PnList.Add(s);
}
}
}
return PnList;
}
public static bool NeedWaitHassReel(string code)
{
List<string> list = GetPnList();
foreach(string pn in list)
{
if (code.Contains(pn))
{
return false;
}
}
return true;
}
}
}
......@@ -49,7 +49,7 @@ namespace OnlineStore.DeviceLibrary
}
}
public void Push(LineMoveInfo moveInfo = null, bool checkHasReel = true)
public void Push(LineMoveInfo moveInfo = null, bool checkHasReel = true, string code = "")
{
if (rmaxis != null && rmaxis.IsPortOpen)
{
......@@ -58,7 +58,7 @@ namespace OnlineStore.DeviceLibrary
if (moveInfo != null)
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampReached((int)config.Distance));
if (checkHasReel)
if (checkHasReel && LineManager.NeedWaitHassReel(code))
{
moveInfo.WaitList.Add(WaitResultInfo.WaitClampHasReel());
//有一个到位就算到位
......
......@@ -18,7 +18,7 @@ namespace OnlineStore.DeviceLibrary
CurrPosId = "";
}
public BoxInfo(int id,string cid,int seq,int ss,int runs,int hasTray,int alarmType,List<string> inList,string currPosId)
public BoxInfo(int id,string cid,int seq,int ss,int runs,int hasTray,int alarmType,List<string> inList,string currPosId,string rfids)
{
this.ID = id;
CId = cid;
......@@ -30,6 +30,7 @@ namespace OnlineStore.DeviceLibrary
this.HasTray = hasTray;
this.WaitInStoreList = inList;
this.CurrPosId = currPosId;
this.rfids = rfids;
}
public string ToShowStr()
......@@ -79,5 +80,10 @@ namespace OnlineStore.DeviceLibrary
/// 当前出入库的库位号
/// </summary>
public string CurrPosId = "";
/// <summary>
/// 出料机构料架号
/// </summary>
public string rfids = "";
}
}
......@@ -444,36 +444,36 @@ namespace OnlineStore.DeviceLibrary
// string[] msgArray = msg.Split(cmd_spilt);
msg = msg.Replace("\r", "");
// LogUtil.debug("收到【" + client.AddStr + "】的消息【" + msg + "】");
StoreSendBean storeSMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg);
StoreSendBean sMsg = JsonHelper.DeserializeJsonToObject<StoreSendBean>(msg);
if (storeSMsg == null)
if (sMsg == null)
{
LogUtil.error("收到【" + client.AddStr + "】的消息【" + msg + "】,解析失败");
}
else
{
int id = storeSMsg.StoreId;
BoxInfo box = new BoxInfo(storeSMsg.StoreId, storeSMsg.Cid, storeSMsg.Seq, storeSMsg.SStatus, storeSMsg.SRunStatus, storeSMsg.DoorHasTray, storeSMsg.AlarmType, storeSMsg.WaitInStoreList,storeSMsg.CurrPosId);
int id = sMsg.StoreId;
BoxInfo box = new BoxInfo(sMsg.StoreId, sMsg.Cid, sMsg.Seq, sMsg.SStatus, sMsg.SRunStatus, sMsg.DoorHasTray, sMsg.AlarmType, sMsg.WaitInStoreList,sMsg.CurrPosId,sMsg.rfids);
SaveBoxClient(id, box, client );
string cmd = storeSMsg.Cmd;
string cmd = sMsg.Cmd;
if (cmd.StartsWith(cmd_heart))
{
}
else if (cmd.StartsWith(cmd_outend))
{
if (storeSMsg.data == null)
if (sMsg.data == null)
{
LogUtil.info("收到【" + client.AddStr + "】的出库完成消息【" + msg + "】出库信息为空,不处理");
}
else
{
LogUtil.info("收到【" + client.AddStr + "】的出库完成消息【" + msg + "】");
string posId = storeSMsg.data.posId;
int plateH = Convert.ToInt32(storeSMsg.data.plateH.Trim());
int plateW = Convert.ToInt32(storeSMsg.data.plateW.Trim());
InOutParam param = new InOutParam(0, storeSMsg.data.barcode, posId, plateH, plateW,false,
storeSMsg.data.urgentReel,storeSMsg.data.cutReel,storeSMsg.data.smallReel,storeSMsg.data.rfid,storeSMsg.data.rfidLoc);
string posId = sMsg.data.posId;
int plateH = Convert.ToInt32(sMsg.data.plateH.Trim());
int plateW = Convert.ToInt32(sMsg.data.plateW.Trim());
InOutParam param = new InOutParam(0, sMsg.data.barcode, posId, plateH, plateW,false,
sMsg.data.urgentReel,sMsg.data.cutReel,sMsg.data.smallReel,sMsg.data.rfid,sMsg.data.rfidLoc);
LineManager.Line.boxBean_OutStoreEnd(id, param);
}
}
......@@ -514,19 +514,19 @@ namespace OnlineStore.DeviceLibrary
public static string S_NG = "IsNg";
}
public class StoreReviceBean
{
public string Cmd = "";
public int CanOutStore = 0;
public string PosId = "";
public string PlateH = "0";
public string PlateW = "0";
public string WareCode = "";
public int IsDebug = 0;
}
//public class StoreReviceBean
//{
// public string Cmd = "";
// public int CanOutStore = 0;
// public string PosId = "";
// public string PlateH = "0";
// public string PlateW = "0";
// public string WareCode = "";
// public int IsDebug = 0;
//}
public class StoreSendBean
{
public StoreSendBean(int id, string cid, int ss, int runs, int doorHasTray, int alarmType)
public StoreSendBean(int id, string cid, int ss, int runs, int doorHasTray, int alarmType,string rfids)
{
this.StoreId = id;
this.Cid = cid;
......@@ -534,7 +534,7 @@ namespace OnlineStore.DeviceLibrary
this.SRunStatus = runs;
this.DoorHasTray = doorHasTray;
this.AlarmType = alarmType;
this.rfids = rfids;
}
public string Cmd = "";
public int StoreId = 0;
......@@ -544,17 +544,12 @@ namespace OnlineStore.DeviceLibrary
public int SRunStatus = 0;
public int DoorHasTray = 0;
public int AlarmType = 0;
//public string PosId = "";
//public string PlateH = "0";
//public string PlateW = "0";
///// <summary>
///// 目标料架
///// </summary>
//public string tShelfI = "";
public List<string> WaitInStoreList = new List<string>();
public InOutData data = null;
public string CurrPosId = "";
public string rfids = "";
}
public class InOutData
{
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!