Commit 5bd88572 LN

入料模块料架rfid增加缓存功能。

1 个父辈 3e1330f3
20200528
20200529
1.上料模块料架号增加缓存
20200528
RFID更改为最新方式。
接驳台等待料盘到位去掉超时时间。
......
......@@ -91,5 +91,7 @@ namespace OnlineStore.Common
public static string NeedCheckTray = "NeedCheckTray";
public static string RfidServer_Port = "RfidServer_Port";
public static string Feed_LastShelfID_ = "Feed_LastShelfID_";
}
}
......@@ -865,7 +865,7 @@ namespace OnlineStore.DeviceLibrary
});
}
private bool UpdateShelfId()
private bool ReadShelfId()
{
try
{
......@@ -876,6 +876,15 @@ namespace OnlineStore.DeviceLibrary
//发送料架信息给调度系统
// AgvClient.SendRFID(Config.AgvInName, CurrShelfId);
LogUtil.info(Name + "读取到料架编号:" + CurrShelfId);
if (CurrShelfId.EndsWith("00"))
{
string saveShelf = GetShelfID();
if ((!String.IsNullOrEmpty(saveShelf)) && (!saveShelf.EndsWith("00")))
{
LogUtil.info(Name + "读取到的料架号【" + CurrShelfId + "】无效,使用 缓存料架RFID:" + saveShelf);
CurrShelfId = saveShelf;
}
}
}
catch (Exception ex)
{
......@@ -883,6 +892,22 @@ namespace OnlineStore.DeviceLibrary
}
return true;
}
#region 料架号保存
private void UpdateLastShelfID(string currRfid = "")
{
string configStr = Setting_Init.Feed_LastShelfID_ + DeviceID;
ConfigAppSettings.SaveValue(configStr, currRfid);
LogUtil.info(Name + " UpdateLastShelfID 缓存料架RFID更改:【" + configStr + "】=【" + currRfid + "】");
}
private string GetShelfID()
{
string configStr = Setting_Init.Feed_LastShelfID_ + DeviceID;
return ConfigAppSettings.GetValue(configStr);
}
#endregion
#endregion
private string lastcode = "";
public override string GetMoveStr()
......
......@@ -603,7 +603,8 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InLog("入料检测: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡下降500,缓冲阻挡前进1000,流水线转动 1000");
InLog("入料检测: " + MoveInfo.SLog + " 阻挡工位有新料架,清理缓存料架RFID ,进料阻挡下降500,缓冲阻挡前进1000,流水线转动 1000");
UpdateLastShelfID();
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH, 500);//进料阻挡下降
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH, 1000);//缓冲阻挡前进1000
// IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
......@@ -615,7 +616,7 @@ namespace OnlineStore.DeviceLibrary
} else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_03_LineStart);
InLog("入料检测: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡上升,缓冲阻挡前进1000,流水线转动 1000");
InLog("入料检测: " + MoveInfo.SLog + " 进料口有新料架,进料阻挡上升,缓冲阻挡前进1000,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH, 1000);//缓冲阻挡前进1000
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
......@@ -671,7 +672,8 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
UpdateShelfId();
ReadShelfId();
if (CurrShelfId.EndsWith("00"))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_33_BatchAxisToP1);
......@@ -684,8 +686,8 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.ShelfNoTray = false;
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FI_05_LocationCylinder_Up);
InLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升,读取料架号");
// IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
InLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升,读取并缓存料架RFID" + CurrShelfId);
UpdateLastShelfID(CurrShelfId);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SL_LocationCylinder_Up);
}
}
......@@ -695,14 +697,7 @@ namespace OnlineStore.DeviceLibrary
InLog(" 未检测到料架,入料结束");
}
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_05_WaitS))
//{
// //定位工位有料架,直接开始入料
// MoveInfo.NextMoveStep(LineMoveStep.FI_07_LocationCylinder_Up);
// InLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡上升, 定位气缸上升");
// IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
// CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
//}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_05_LocationCylinder_Up))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_06_BatchAxisToP2);
......@@ -866,7 +861,7 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_20_SaveSize))
{
{
if (MoveCylineIsUp())
{
MoveInfo.NextMoveStep(LineMoveStep.FI_21_CylinderGive);
......@@ -886,35 +881,30 @@ namespace OnlineStore.DeviceLibrary
if (!MoveInfo.ShelfNoTray)
{
FI_BatchAxisDown();
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_BatchAxisDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_23_WaitTray);
}
int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
string log = ":移栽伺服下降到P2:" + targetPositon;
InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + "");
UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
//if (!MoveInfo.ShelfNoTray)
//{
// YuScanCode();
//}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitTray))//TODO
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_22_BatchAxisDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_24_WaitTray);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
//int targetPositon = Config.GetUpdownP2Detial(LastHeight, LastWidth);
//string log = ":移栽伺服下降到P2:" + targetPositon;
//InLog("料盘移栽" + MoveInfo.SLog + ":等待空托盘到达 " + log + "");
//UpdownAxis.AbsMove(MoveInfo, targetPositon, Config.UpdownAxis_P2Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_WaitTray))//TODO
{
if (SecondMoveInfo.MoveStep.Equals(LineMoveStep.MO_11_CodeRember))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_24_CylinderDown);
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CylinderDown);
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
//if (!MoveInfo.ShelfNoTray)
//{
// InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,更新托盘为有料,获取库位号 , 提升轴下降指定位置");
// FI_21_BatchAxisDown();
//}
//else
//{
InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降, 托盘号【" + currTrayNum + "】,更新托盘为有料,获取库位号 ,");
//}
string code = CodeManager.ProcessCode(LastCodeList);
lastcode = code;
TrayManager.UpdateTrayInfo(currTrayNum, true, ReelType.InStore, new InOutParam(currTrayNum, code, "", LastHeight, LastWidth, false), "");
......@@ -951,50 +941,42 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = MoveInfo.Name + "[" + MoveInfo.MoveType + "][" + MoveInfo.SLog + "]等待空托盘到达超时[" + Math.Round(MoveInfo.StepSpan().TotalSeconds, 1) + "]秒";
LogUtil.error(WarnMsg, DeviceID * 1000 + 22);
Alarm(LineAlarmType.IoSingleTimeOut);
}
//送出料架处理
}
//else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_21_UpdownAxisToP2))
//{
// MoveInfo.NextMoveStep(LineMoveStep.FI_22_CylinderDown);
// InLog("料盘移栽" + MoveInfo.SLog + ":上料机构下降,");
// CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Up, IO_Type.SL_MoveCylinder_Down);
//}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_CylinderDown))
}
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_CylinderDown))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_25_CylinderRelax);
MoveInfo.NextMoveStep(LineMoveStep.FI_26_CylinderRelax);
InLog("料盘移栽" + MoveInfo.SLog + ":上料气缸放松");
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Tighten, IO_Type.SL_MoveCylinder_Slack);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_25_CylinderRelax))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_26_CylinderRelax))
{
if (Config.SidesWayNum.Equals(1))
{
FI_27_CylinderUp();
FI_28_CylinderUp();
}
else
{
MoveInfo.NextMoveStep(LineMoveStep.FI_26_WaitCylinderUp);
MoveInfo.NextMoveStep(LineMoveStep.FI_27_WaitCylinderUp);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.SL_MoveCylinder_Down, IO_VALUE.LOW));
CylinderMove(null, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
}
TrayPreMove();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_26_WaitCylinderUp))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_27_WaitCylinderUp))
{
FI_27_CylinderUp();
FI_28_CylinderUp();
TrayMoveOk();
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_27_CylinderUp))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_28_CylinderUp))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_28_UpDownAxisToP1);
MoveInfo.NextMoveStep(LineMoveStep.FI_29_UpDownAxisToP1);
InLog("料盘移栽" + MoveInfo.SLog + ":升降伺服到P1点");
TrayMoveOk(true);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_28_UpDownAxisToP1))
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_29_UpDownAxisToP1))
{
if (getPosTask == null || getPosTask.IsCompleted)
{
......@@ -1072,7 +1054,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_38_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FI_39_TopDown);
InLog("上料完成" + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 , ");
InLog("上料完成" + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 ,清理缓存料架RFID ");
UpdateLastShelfID();
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
}
......@@ -1088,9 +1071,9 @@ namespace OnlineStore.DeviceLibrary
#endregion
}
private Task getPosTask = null;
private void FI_27_CylinderUp()
private void FI_28_CylinderUp()
{
MoveInfo.NextMoveStep(LineMoveStep.FI_27_CylinderUp);
MoveInfo.NextMoveStep(LineMoveStep.FI_28_CylinderUp);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000));
CylinderMove(MoveInfo, IO_Type.SL_MoveCylinder_Down, IO_Type.SL_MoveCylinder_Up);
if (IOValue(IO_Type.SL_AxisLocationCheck).Equals(IO_VALUE.LOW) && MoveInfo.ShelfNoTray.Equals(false))
......@@ -1383,8 +1366,9 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
internal bool CurrTrayIsNeed(int trayNum, bool NeedSaveParam )
#region 判断托盘是否需要
internal bool CurrTrayIsNeed(int trayNum, bool NeedSaveParam)
{
try
{
......@@ -1424,7 +1408,7 @@ namespace OnlineStore.DeviceLibrary
}
//如果已经开始送出料架,暂不处理
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore)&& MoveInfo.MoveStep >= LineMoveStep.FO_30_BatchAxisToP2)
if (MoveInfo.MoveType.Equals(LineMoveType.OutStore) && MoveInfo.MoveStep >= LineMoveStep.FO_30_BatchAxisToP2)
{
LogUtil.error(Name + " 【" + info.ToStr() + "】需要出库,正在送出料架,暂不处理", DeviceID * 1000 + 18);
return false;
......@@ -1445,7 +1429,7 @@ namespace OnlineStore.DeviceLibrary
if (trayCanUse && runStatus.Equals(LineRunStatus.Busy) && MoveInfo.MoveType.Equals(LineMoveType.InStore))
{
//入料执行中, 且需要空托盘
if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_23_WaitTray) && MoveInfo.IsInWait.Equals(false))
if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_24_WaitTray) && MoveInfo.IsInWait.Equals(false))
//if (MoveInfo.MoveStep >= LineMoveStep.FI_11_CylinderUp && MoveInfo.MoveStep <= LineMoveStep.FI_20_WaitTray)
{
if (NeedSaveParam)
......@@ -1457,19 +1441,20 @@ namespace OnlineStore.DeviceLibrary
}
}
}
if (NeedSaveParam&&LineManager.Line.runStatus>=LineRunStatus.HomeMoving&& LineManager.Line.CanProcessLine())
if (NeedSaveParam && LineManager.Line.runStatus >= LineRunStatus.HomeMoving && LineManager.Line.CanProcessLine())
{
LogUtil.debug(" 【" + info.ToStr() + "】不需要出入库" );
LogUtil.debug(" 【" + info.ToStr() + "】不需要出入库");
}
}
catch (Exception ex)
{
LogUtil.error(Name + "CurrTrayIsNeed出错:" ,ex);
LogUtil.error(Name + "CurrTrayIsNeed出错:", ex);
}
return false;
}
#endregion
}
}
......@@ -222,7 +222,8 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_Stop_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
OutLog("准备出库料架: " + MoveInfo.SLog + " 阻挡工位检测有料架,进料阻挡下降500ms,缓冲阻挡前进1000,流水线转动 5000");
OutLog("准备出库料架: " + MoveInfo.SLog + " 阻挡工位有新料架,清理缓存料架RFID,进料阻挡下降500ms,缓冲阻挡前进1000,流水线转动 5000");
UpdateLastShelfID();
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.HIGH,500);
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH, 1000);//缓冲阻挡前进1000
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
......@@ -234,7 +235,7 @@ namespace OnlineStore.DeviceLibrary
else if (IOValue(IO_Type.SL_Entry_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_03_LineStart);
OutLog("准备出库料架: " + MoveInfo.SLog + " 进料口检测有料架,进料阻挡上升,缓冲阻挡前进1000,流水线转动 1000");
OutLog("准备出库料架: " + MoveInfo.SLog + " 进料口有新料架,进料阻挡上升,缓冲阻挡前进1000,流水线转动 1000");
IOMove(IO_Type.SL_Entry_StopDown, IO_VALUE.LOW);//进料阻挡上升
IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.HIGH, 1000);//缓冲阻挡前进1000
IOMove(IO_Type.SL_Line_Run, IO_VALUE.HIGH);
......@@ -290,7 +291,7 @@ namespace OnlineStore.DeviceLibrary
{
if (IOValue(IO_Type.SL_Location_Check).Equals(IO_VALUE.HIGH))
{
UpdateShelfId();
ReadShelfId();
if (CurrShelfId.EndsWith("00"))
{
SendOutShelfOut("料架号【" + CurrShelfId + "】无效");
......@@ -319,8 +320,8 @@ namespace OnlineStore.DeviceLibrary
//定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_05_LocationUp);
OutLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡下降, 定位气缸上升,读取料架号");
//IOMove(IO_Type.SL_Buffer_StopDown, IO_VALUE.LOW);//缓冲阻挡下降
OutLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡下降, 定位气缸上升,读取并缓存料架RFID");
UpdateLastShelfID(CurrShelfId);
CylinderMove(MoveInfo, IO_Type.SL_LocationCylinder_Down, IO_Type.SW4_LocationCylinder_Up);
}
......@@ -469,7 +470,8 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FO_37_LineStop))
{
MoveInfo.NextMoveStep(LineMoveStep.FO_38_TopDown);
OutLog("送出料串: " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 ,清空LastOutParam ");
OutLog("送出料串: " + MoveInfo.SLog + ", 料架到达出口,出口顶升下降 ,清空LastOutParam,清理缓存料架RFID ");
UpdateLastShelfID();
CylinderMove(MoveInfo, IO_Type.SL_OutTopCylinder_Up, IO_Type.SL_OutTopCylinder_Down);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(300));
LastOutParam = new InOutParam();
......
......@@ -61,15 +61,10 @@ namespace OnlineStore.DeviceLibrary
{
continue;
}
list.Add(str.Trim());
//string code = "=1+0x0-" + width + "x" + height + "=" + str.Trim();
list.Add(str.Trim());
string code = "=" + width + "x" + height + "=" + str.Trim();
codeStr = codeStr + code + spiltStr;
}
//if (String.IsNullOrEmpty(codeStr))
//{
// return msg = deviceName + "未扫到条码";
//}
}
codeStr = CodeManager.ReplaceCode(codeStr);
//http://localhost/myproject/service/store/emptyPosForPutin
// 参数:cids: 多个 cid
......
......@@ -666,34 +666,36 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
FI_22_BatchAxisDown,
/// <summary>
/// 料盘移栽:从服务器获取入库库位号
/// </summary>
FI_23_GetPosID,
/// <summary>
/// 料盘移栽:等待空托盘到达,移栽伺服下降到P2,并预扫码
/// </summary>
FI_23_WaitTray,
///// <summary>
///// 料盘移栽:移栽伺服下降到P2
///// </summary>
//FI_21_UpdownAxisToP2,
FI_24_WaitTray,
/// <summary>
/// 料盘移栽: 上料机构下降
/// </summary>
FI_24_CylinderDown,
FI_25_CylinderDown,
/// <summary>
/// 料盘移栽: 上料气缸放松
/// </summary>
FI_25_CylinderRelax,
FI_26_CylinderRelax,
/// <summary>
/// 料盘移栽: 上料横移机构上升
/// </summary>
FI_26_WaitCylinderUp,
FI_27_WaitCylinderUp,
/// <summary>
/// 料盘移栽:上料横移机构上升,定位或者顶升可以先下降
/// </summary>
FI_27_CylinderUp,
FI_28_CylinderUp,
/// <summary>
/// 料盘移栽:升降伺服到P1点
/// </summary>
FI_28_UpDownAxisToP1,
FI_29_UpDownAxisToP1,
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!