Commit e404a5c7 LN

出库送料架逻辑修改,出库增加参数:taskCount

1 个父辈 c7f834f6
......@@ -216,12 +216,12 @@ namespace OnlineStore.ACPackingStore
private void btnLocationUp_Click(object sender, EventArgs e)
{
boxBean.CylinderMove(null, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
// boxBean.CylinderMove(null, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
}
private void btnLocationDown_Click(object sender, EventArgs e)
{
boxBean.CylinderMove(null, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
// boxBean.CylinderMove(null, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
}
private void FrmIOStatus_Shown(object sender, EventArgs e)
......
......@@ -77,7 +77,8 @@ agv客户端启动时需要设置状态为none。
20200224
增加agv的cancelState的修改功能。
20200225
出库送料架逻辑修改,出库增加参数:taskCount
......
......@@ -224,5 +224,13 @@ namespace OnlineStore.Common
public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode";
/// <summary>
/// 剩余任务数量,当剩余任务 《=1时,出库完成需要送出料架
/// 剩余任务数为0, 或者料架已放满,或者料架rfid与上一个任务不同,料架就要放出去
/// 剩余任务数为1时, 当前的料放完就可以把料架放出去了
///当前料放完,料架已满,也把料架放出去
/// </summary>
public static string taskCount = "taskCount";
}
}
......@@ -210,6 +210,7 @@ namespace OnlineStore.DeviceLibrary
#region 原点返回和复位处理
private void ReturnHome()
{
CurrShelfID = "";
WaitShelfEnter = false;
lastPosId = "";
lastPosIdStatus = StoreStatus.ResetMove;
......@@ -683,8 +684,9 @@ namespace OnlineStore.DeviceLibrary
{
StartShelfInStore();
}
//判断是否要更新状态为None
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW))
//判断是否要更新状态为None 顶升下降时才需要needEnter
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW)
&&IOValue(IO_Type.TopCylinder_Down).Equals(IO_VALUE.HIGH)&&IOValue(IO_Type.TopCylinder_Up).Equals(IO_VALUE.LOW) )
{
AgvClient.NeedEnter(Config.AgvNodeName);
}
......
......@@ -755,26 +755,44 @@ namespace OnlineStore.DeviceLibrary
storeRunStatus = StoreRunStatus.Busy;
MoveInfo.NewMove(StoreMoveType.OutStore, param);
LogInfo("启动出库【" + param.ToStr() + "】 ");
//当前无料架,或料架位置为空
if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || MoveInfo.MoveParam.ShelfPosID.Equals(""))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf);
InOutStoreLog("出库 " + MoveInfo.SLog + ": 通知agv调度准备带料架的agv["+ param.rfid + "],等待agv到达或检测到料架信号,进出轴到P1");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//需要先叫agv到达
AgvClient.SetStatus(Config.AgvNodeName,param.rfid, param.rfid, ClientAction.NeedEnter,ClientLevel.High,true);
MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)ClientAction.Arrive));
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
////判断当前料架是否正确
//if (MoveInfo.MoveParam.ShelfPosID.Equals(""))
//{
MoveInfo.NextMoveStep(StoreMoveStep.SO_01_DeviceBack);
InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 开始");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
}
//}
////当前无料架,或料架位置为空
//if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || MoveInfo.MoveParam.ShelfPosID.Equals(""))
//{
// MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf);
// InOutStoreLog("出库 " + MoveInfo.SLog + ": 通知agv调度准备带料架的agv["+ param.rfid + "],等待agv到达或检测到料架信号,进出轴到P1");
// InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
// //需要先叫agv到达
// AgvClient.SetStatus(Config.AgvNodeName,param.rfid, param.rfid, ClientAction.NeedEnter,ClientLevel.High,true);
// MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)ClientAction.Arrive));
//}
//else
//{
// MoveInfo.NextMoveStep(StoreMoveStep.SO_01_DeviceBack);
// InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 开始");
// InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//}
return true;
}
private void SO_03_ToBagPosition()
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点) ,顶升上升");
ACAxisMove(Config.Comp_Axis, MoveInfo.MoveParam.MoveP.ComPress_P3, Config.CompAxis_P3_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);
CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
}
protected override void OutStoreProcess()
{
LineMoveP moveP = MoveInfo.MoveParam.MoveP;
......@@ -788,19 +806,56 @@ namespace OnlineStore.DeviceLibrary
}
#region 出入库步骤
if (MoveInfo.MoveStep == StoreMoveStep.SO_01_LocationDown)
if (MoveInfo.MoveStep == StoreMoveStep.SO_01_DeviceBack)
{
//判断是否需要送出料架,是否需要进入料架,是否可以直接开始
if (CurrShelfID.Equals(""))
{
SO_03_ToBagPosition();
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_TopCylinderDown);
InOutStoreLog("出库 " + MoveInfo.SLog + ":料架顶升下降");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
}
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_02_TopCylinderDown)
{
if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH))
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_02_DeviceBack);
InOutStoreLog("出库 " + MoveInfo.SLog + ":进出轴到P1 ");
if (IsRightShelfId(CurrShelfID, MoveInfo.MoveParam.rfid))
{
SO_03_ToBagPosition();
}
else
{
LogUtil.error("入库,当前料架【" + CurrShelfID + "】和目标料架【" + MoveInfo.MoveParam.rfid + "】不是同一个料架,送出当前料架,稍后重新出库");
//送出料架,并且记录出库信息,等会重新出库
StartShelfOut();
//重新记录
LogInfo(" 执行出库【" + MoveInfo.MoveParam.ToStr() + "】失败,料架号不一致,加入等待队列");
waitOutStoreList.Enqueue(MoveInfo.MoveParam);
}
}
else if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || (!MoveInfo.MoveParam.ShelfPosID.Equals("")))
{
string rfid = MoveInfo.MoveParam.rfid;
MoveInfo.NextMoveStep(StoreMoveStep.BI_00_ReadyShelf);
InOutStoreLog("出库 " + MoveInfo.SLog + ": 通知agv调度准备带料架的agv[" + rfid + "],等待agv到达或检测到料架信号,进出轴到P1");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//需要先叫agv到达
AgvClient.SetStatus(Config.AgvNodeName, rfid, rfid, ClientAction.NeedEnter, ClientLevel.High, true);
MoveInfo.WaitList.Add(WaitResultInfo.WaitAgvAction((int)ClientAction.Arrive));
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_02_DeviceBack)
else
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_03_ToBagPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到库位,压紧轴至P3(压紧前点) ,旋转轴至P2(库位点),升降轴至P5(库位出库前点)");
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.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
SO_03_ToBagPosition();
}
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_03_ToBagPosition)
{
......@@ -903,10 +958,11 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep == StoreMoveStep.SO_13_DeviceOutFromDoor)
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_14_GoBack);
InOutStoreLog("出库 " + MoveInfo.SLog + ": 升降轴返回,升降轴到P1");
InOutStoreLog("出库 " + MoveInfo.SLog + ": 升降轴返回,升降轴到P1,料架顶升下降");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_P1, Config.UpDownAxis_P1_Speed);
//发送消息给流水线
// SendOutStoreEnd(MoveInfo);
CylinderMove(MoveInfo, IO_Type.TopCylinder_Up, IO_Type.TopCylinder_Down);
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_14_GoBack)
{
......@@ -936,6 +992,11 @@ namespace OnlineStore.DeviceLibrary
isNeedSend = true;
}
}
else if (MoveInfo.MoveParam.taskCount <= 1)
{
InOutStoreLog("出库完成,料架【" + CurrShelfID + "】没有出库任务,taskCount=" + MoveInfo.MoveParam.taskCount + " 送出料架");
isNeedSend = true;
}
if (isNeedSend)
{
StartShelfOut();
......@@ -953,7 +1014,7 @@ namespace OnlineStore.DeviceLibrary
}
#endregion
else if (MoveInfo.MoveStep <= StoreMoveStep.SO_01_LocationDown)
else if (MoveInfo.MoveStep <= StoreMoveStep.SO_01_DeviceBack)
{
ShelfEnterProcess();
}
......@@ -967,6 +1028,28 @@ namespace OnlineStore.DeviceLibrary
}
}
private bool IsRightShelfId(string currShelfID, string rfid)
{
if (String.IsNullOrEmpty(currShelfID) || String.IsNullOrEmpty(rfid))
{
return true ;
}
string theTarget = rfid.Trim().PadLeft(3, '0');
string num = theTarget.Substring(0, 2);
string type = theTarget.Substring(2, 1);
if (currShelfID.Equals(type + num))
{
return true;
}
else if (num.Equals("00"))
{
return true;
}
return false;
}
#endregion
......
......@@ -314,7 +314,8 @@ namespace OnlineStore.DeviceLibrary
//结束
MoveEndToRuningStatus();
EmprtShelfList = new ConcurrentQueue<string>();
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束 ,设置状态为None");
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,送出料架结束 ,设置状态为None,清空当前料架:"+CurrShelfID);
CurrShelfID = "";
AgvClient.SetStatus(Config.AgvNodeName);
}
}
......@@ -515,6 +516,8 @@ namespace OnlineStore.DeviceLibrary
string rfid = data.ContainsKey(ParamDefine.rfid) ? data[ParamDefine.rfid] : "";
int rfidLoc = FormUtil.GetIntData(data, ParamDefine.rfidLoc);
string barcode = data.ContainsKey(ParamDefine.barcode) ? data[ParamDefine.barcode] : "";
int taskCount = FormUtil.GetIntData(data,ParamDefine.taskCount,0);
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
......@@ -530,7 +533,7 @@ namespace OnlineStore.DeviceLibrary
index++;
string plateW = plateWArray[index];
string plateH = plateHArray[index];
InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc);
InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc, taskCount);
//根据发送的posId获取位置列表
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
if (position == null)
......
......@@ -21,7 +21,7 @@ namespace OnlineStore.DeviceLibrary
this.WareCode = "";
MoveP = null;
}
public InOutParam(string wareNo, string posId, string ShelfPosID, string platew = "", string plateh = "", bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0)
public InOutParam(string wareNo, string posId, string ShelfPosID, string platew = "", string plateh = "", bool urgentReel = false, bool cutReel = false, bool smallReel = false, string rfid = "", int rfidLoc = 0,int taskCount=0)
{
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
......@@ -34,6 +34,7 @@ namespace OnlineStore.DeviceLibrary
this.smallReel = smallReel;
this.rfid = rfid;
this.rfidLoc = rfidLoc;
this.taskCount = taskCount;
}
public InOutParam(string wareNo, string posId, string ShelfPosID,LineMoveP linePosition )
{
......@@ -48,6 +49,7 @@ namespace OnlineStore.DeviceLibrary
this.smallReel = false ;
this.rfid = "";
this.rfidLoc = 0;
this.taskCount = 0;
}
/// <summary>
/// 物品二维码信息
......@@ -104,7 +106,13 @@ namespace OnlineStore.DeviceLibrary
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary>
public int rfidLoc { get; set; }
/// <summary>
/// 剩余任务数量,当剩余任务 《=1时,出库完成需要送出料架
/// 剩余任务数为0, 或者料架已放满,或者料架rfid与上一个任务不同,料架就要放出去
/// 剩余任务数为1时, 当前的料放完就可以把料架放出去了
///当前料放完,料架已满,也把料架放出去
/// </summary>
public int taskCount { get; set; }
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
......@@ -142,7 +150,7 @@ namespace OnlineStore.DeviceLibrary
{
return " 料架号[" + ShelfPosID + "],库位号 [" + PosID + "], [" + WareCode + "], [" + PlateW + "x" + PlateH + "]" +
"NeedEnterShelf【" + NeedEnterShelf + "】NeedOutShelf【" + NeedOutShelf + "】"+
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]";
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "],taskCount ["+ taskCount + "]";
}
public string ToShortStr()
{
......
......@@ -211,13 +211,14 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
///料仓出库,,定位气缸下降
///料仓出库:叉子先运动到P1
/// </summary>
SO_01_LocationDown = 2001,
SO_01_DeviceBack = 2002,
/// <summary>
///料仓出库:叉子先运动到P1
///料仓出库,,顶升气缸下降,先检测料架
/// </summary>
SO_02_DeviceBack = 2002,
SO_02_TopCylinderDown = 2001,
/// <summary>
/// 料仓出库,,所有轴运行到库位,压紧轴到压紧前点P3 ,旋转轴到库位点P2,轴2(上下) 至P5(库位出库前点)
......@@ -271,7 +272,7 @@ namespace OnlineStore.DeviceLibrary
SO_13_DeviceOutFromDoor = 2013,
/// <summary>
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点)
/// 料仓出库,,升降轴返回,, 轴2至P1( 待机点),顶升气缸下降
/// </summary>
SO_14_GoBack = 2044,
......
......@@ -105,14 +105,14 @@ namespace OnlineStore.LoadCSVLibrary
/// DI L侧顶升装置下降端 TopCylinder_Down 13 X34 DI-34
/// </summary>
public static string TopCylinder_Down = "TopCylinder_Down";
/// <summary>
/// DI L侧定位装置上升端 LocationCylinder_Up 14 X35 DI-35
/// </summary>
public static string LocationCylinder_Up = "LocationCylinder_Up";
/// <summary>
/// DI L侧定位装置下降端 LocationCylinder_Down 15 X36 DI-36
/// </summary>
public static string LocationCylinder_Down = "LocationCylinder_Down";
///// <summary>
///// DI L侧定位装置上升端 LocationCylinder_Up 14 X35 DI-35
///// </summary>
//public static string LocationCylinder_Up = "LocationCylinder_Up";
///// <summary>
///// DI L侧定位装置下降端 LocationCylinder_Down 15 X36 DI-36
///// </summary>
//public static string LocationCylinder_Down = "LocationCylinder_Down";
/// <summary>
/// DO 自动指示灯 AutoRun_HddLed 0 Y01 DO-01
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!