Commit 150c5755 LN

出库逻辑修改

1 个父辈 b76e97b6
......@@ -199,6 +199,30 @@ namespace OnlineStore.Common
/// <summary>
/// 温度报警值
/// </summary>
public static string maxTemperature = "temp";
public static string maxTemperature = "temp";
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public static string urgentReel = "urgentReel";
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public static string cutReel = "cutReel";
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public static string smallReel = "smallReel";
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public static string rfid = "rfid";
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
/// </summary>
public static string rfidLoc = "rfidLoc";
public static string barcode = "barcode";
}
}
......@@ -91,5 +91,36 @@ namespace OnlineStore.Common
}
return span.Hours.ToString().PadLeft(2, '0') + ":" + span.Minutes.ToString().PadLeft(2, '0') + ":" + seconds;
}
public static bool GetBoolData(Dictionary<string, string> data, string key, bool defaultValue = false)
{
if (data.ContainsKey(key))
{
try
{
return Convert.ToBoolean(data[key]);
}
catch (Exception ex)
{
}
}
return defaultValue;
}
public static int GetIntData(Dictionary<string, string> data, string key, int defaultValue = 0)
{
if (data.ContainsKey(key))
{
try
{
return Convert.ToInt32(data[key]);
}
catch (Exception ex)
{
}
}
return defaultValue;
}
}
}
......@@ -43,6 +43,7 @@ namespace OnlineStore.Common
{
if (sb.openPort())
{
serialBeanMap.Add(port, sb);
return true;
}
else
......
......@@ -26,7 +26,13 @@ namespace OnlineStore.DeviceLibrary
public string lastPosId = "";
public StoreStatus lastPosIdStatus = StoreStatus.StoreOnline;
public List<ConfigMoveAxis> moveAxisList = new List<ConfigMoveAxis>();
/// <summary>
/// 所有料仓库位列表
/// </summary>
public List<string> PositionNumList = new List<string>();
/// <summary>
/// 所有料架库位列表
/// </summary>
public List<string> ShelfPosList = new List<string>();
/// <summary>
/// 料架未放料盘的位置列表
......@@ -55,8 +61,8 @@ namespace OnlineStore.DeviceLibrary
//添加调试
IsDebug = config.IsInDebug.Equals(1);
Name = ("料仓BOX_" + config.DeviceID + " ").ToUpper();
this.DeviceID = config.DeviceID;
this.Config = config;
this.DeviceID = config.DeviceID;;
this.Config = config;
DoorBean = new EnteryDoorBean(DeviceID);
//温湿度
humBean = new HumitureBean(config.Humiture_Port, Name);
......@@ -884,15 +890,7 @@ namespace OnlineStore.DeviceLibrary
{
boxStatus.msg = CodeMsg;
lineOperation.msg = CodeMsg;
}
//if (CodeMsg.Equals(""))
//{
// if (storeRunStatus.Equals(StoreRunStatus.Runing) && IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
// {
// boxStatus.msg = "叉子料盘检测有料,请检查";
// lineOperation.msg = "叉子料盘检测有料,请检查";
// }
//}
}
CodeMsg = "";
//WarnMsg = "";
//状态
......@@ -976,22 +974,34 @@ namespace OnlineStore.DeviceLibrary
}
}
private void ReviceOutStoreProcess(Operation resultOperation)
{
DateTime time = DateTime.Now;
Dictionary<string, string> data = resultOperation.data;
if (data != null && data.ContainsKey(ParamDefine.posId)
&& data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
&& data.ContainsKey(ParamDefine.plateH) && data.ContainsKey(ParamDefine.plateW))
{
string posIdStr = data[ParamDefine.posId];
string plateWStr = data[ParamDefine.plateW];
string plateHStr = data[ParamDefine.plateH];
LogUtil.info("收到服务器出库消息:poaIs=" + posIdStr + ",platew=" + plateWStr + ",plateh=" + plateHStr);
char splitChar = '|';
string[] posIdArray = posIdStr.Split(splitChar);
string[] plateWArray = plateWStr.Split(splitChar);
string[] plateHArray = plateHStr.Split(splitChar);
string[] posIdArray = data[ParamDefine.posId].Split(splitChar);
string[] plateWArray = data[ParamDefine.plateW].Split(splitChar);
string[] plateHArray = data[ParamDefine.plateH].Split(splitChar);
bool urgentReel = FormUtil.GetBoolData(data, ParamDefine.urgentReel);
bool cutReel = FormUtil.GetBoolData(data, ParamDefine.cutReel);
bool smallReel = FormUtil.GetBoolData(data, ParamDefine.smallReel);
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] : "";
//urgentReel: true 表示紧急料,需要出到料串上
//cutReel: true 表示分盘料,需要出到料串上
//smallReel: true 小料(7x8),放置到小料架上
//rfid: 分配的料架RFID
//rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线, 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线, 70,71,72时只能分配到3 / 4号皮带线; 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3 / 4号皮带线
string dataStr = JsonHelper.SerializeObject(data);
LogUtil.info("收到服务器出库消息:【" + dataStr + "】");
int index = -1;
foreach (string posId in posIdArray)
{
......@@ -999,52 +1009,55 @@ namespace OnlineStore.DeviceLibrary
string plateW = plateWArray[index];
string plateH = plateHArray[index];
string[] posArray = posId.Split('#');
if (posArray.Length != 2)
{
WarnMsg = Name + "出库格式错误:库位号【" + posId + "】";
LogUtil.error(Name + "收到服务器出库命令:库位号【" + posId + "】格式错误");
continue;
}
int storeId = int.Parse(posArray[0]);
//if (posArray.Length != 2)
//{
// WarnMsg = Name + "出库格式错误:库位号【" + posId + "】";
// LogUtil.error(Name + "收到服务器出库命令:库位号【" + posId + "】格式错误");
// continue;
//}
InOutParam inoutParam = new InOutParam(barcode, posId, "", plateW, plateH, urgentReel, cutReel, smallReel, rfid, rfidLoc);
//根据发送的posId获取位置列表
ACBoxPosition position = CSVPositionReader<ACBoxPosition>.GetPositon(posId);
if (position == null)
{
//出入库没有找到服务器发送的库位,需要打印日志方便查询原因
WarnMsg = Name + "出库未找库位:【" + posId + "】";
LogUtil.error(Name + "收到服务器出库命令:未找到【" + posId + "】的库位信息");
WarnMsg = Name + "未找到库位:【" + inoutParam.ToStr() + "】";
LogUtil.error(WarnMsg);
continue;
}
else
try
{
InOutParam inoutParam = new InOutParam("", posId, plateW, plateH, "");
try
//判断是否接收过此库位的出库信息
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PosID.Equals(posId))
{
//判断是否接收过此库位的出库信息
if (MoveInfo.MoveType.Equals(StoreMoveType.OutStore) && MoveInfo.MoveParam.PosID.Equals(posId))
{
LogInfo(" 收到出库【" + inoutParam.ToStr() + "】重复,当前已在【" + posId + "】出库中");
continue;
}
else
{
//判断排队列表中是否已存在
List<InOutParam> reviceList = new List<InOutParam>(waitOutStoreList);
reviceList = (from m in reviceList where m.PosID.Equals(posId) select m).ToList<InOutParam>();
if (reviceList.Count > 0)
{
LogInfo(" 收到出库【" + inoutParam.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
continue;
}
}
LogUtil.error(Name + " 出库命令【" + inoutParam.ToStr() + "】重复,正在【" + posId + "】出库中");
continue;
}
catch (Exception ex)
//判断排队列表中是否已存在
List<InOutParam> reviceList = new List<InOutParam>(waitOutStoreList);
reviceList = (from m in reviceList where m.PosID.Equals(posId) select m).ToList<InOutParam>();
if (reviceList.Count > 0)
{
LogUtil.error("验证出库【" + inoutParam.ToStr() + "】是否重复出错:" + ex.ToString());
LogUtil.error(Name + " 出库命令【" + inoutParam.ToStr() + "】重复,排队列表中已存在【" + reviceList[0].ToStr() + "】");
continue;
}
string shelfPosID = "";
}
catch (Exception ex)
{
LogUtil.error(Name + "验证出库【" + inoutParam.ToStr() + "】是否重复出错:" + ex.ToString());
}
string shelfPosID = "";
if (inoutParam.rfidLoc > 0 && ShelfPosList.Count >= inoutParam.rfidLoc)
{
shelfPosID = ShelfPosList[inoutParam.rfidLoc - 1];
inoutParam.NeedEnterShelf = false;
inoutParam.NeedOutShelf = false;
inoutParam.ShelfPosID = shelfPosID;
}
else
{
bool hasShelf = EmprtShelfList.TryDequeue(out shelfPosID);
if (hasShelf)
{
......@@ -1056,15 +1069,16 @@ namespace OnlineStore.DeviceLibrary
{
inoutParam.NeedEnterShelf = true;
inoutParam.NeedOutShelf = false;
LogUtil.error(Name + "执行出库【" + inoutParam.ToStr() + "】,么有空料架,需要使用新料架");
LogInfo(Name + "执行出库【" + inoutParam.ToStr() + "】,没有空料架,需要使用新料架");
}
StartExecuctOut(inoutParam);
}
StartExecuctOut(inoutParam);
}
TimeSpan span = DateTime.Now - time;
if (span.TotalMilliseconds > 10)
{
LogUtil.info(Name + "执行TimerProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
LogInfo(Name + "执行 ReviceOutStoreProcess 共处理了【" + span.TotalMilliseconds + "】毫秒");
}
}
}
......
......@@ -79,13 +79,13 @@ namespace OnlineStore.DeviceLibrary
{
}
else if (wait.WaitType.Equals(WaitEnum.W008_Compress))
{
{
//等待信号亮或者走到绝对位置才停止
if (IOValue(TargetIoType).Equals(TargetIoValue))
{
LogUtil.info("CheckWait 检测到" + TargetIoType + "=" + TargetIoValue + ",停止压紧轴运行");
wait.IsEnd = true;
ComAxisStopCheck();
wait.IsEnd = true;
ComAxisStopCheck();
}
else
{
......@@ -93,7 +93,7 @@ namespace OnlineStore.DeviceLibrary
if (moveOk)
{
//TODO 判断是否达到高度,如果未达到,继续上升
wait.IsEnd = true;
wait.IsEnd = true;
ComAxisStopCheck();
}
}
......@@ -104,8 +104,34 @@ namespace OnlineStore.DeviceLibrary
}
else if (wait.WaitType.Equals(WaitEnum.W010_AgvStatus))
{
int agvA = (int)AgvClient.GetAction(Config.AgvNodeName);
wait.IsEnd = agvA.Equals(wait.TargetPosition);
if (!wait.IsEnd && span.TotalSeconds > 10)
{
//如果是等待AGV到达,等待有料架信号也算结束
if (wait.TargetPosition.Equals((int)Asa.Actions.Arrive)&&MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_ReadyShelf))
{
if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH))
{
LogInfo("BI_01_ReadyShelf 等待小车到达Arrive,检测到 LineTake_Check 信号,结束等待");
wait.IsEnd = true;
}
else if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
{
LogInfo("BI_01_ReadyShelf 等待小车到达Arrive,检测到 LineIn_Check 信号,结束等待");
wait.IsEnd = true;
}
}
else if (wait.TargetPosition.Equals((int)Asa.Actions.FinishOut))
{
if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.LOW))
{
LogInfo("等待小车离开FinishOut,检测到 LineTake_Check和LineIn_Check都没有信号,结束等待");
wait.IsEnd = true;
}
}
}
}
if (wait.IsEnd)
{
......@@ -138,8 +164,7 @@ namespace OnlineStore.DeviceLibrary
}
private static DateTime lastComRHomeTime = DateTime.Now;
private void InOutBackToP1(int InOut_P1)
{
{
//判断是否在P1,如果是,不需要运行
if (ACServerManager.isInPosition(Config.InOut_Axis, InOut_P1))
{
......@@ -241,7 +266,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NewMove(StoreMoveType.InStore, new InOutParam());
MoveInfo.MoveParam.MoveP = new LineMoveP(Config);
MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
MoveInfo.NextMoveStep(StoreMoveStep.BI_05_DoorClose);
MoveInfo.NextMoveStep(StoreMoveStep.BI_06_DoorClose);
LogInfo(" 空闲中,检测到入料口有料架,启动料架入库 " + MoveInfo.SLog + "");
}
else
......@@ -304,7 +329,7 @@ namespace OnlineStore.DeviceLibrary
#region 料架取料盘扫码获取POSID
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_08_StartGetTray))
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_10_StartGetTray))
{
if (MoveInfo.NextShelfPos())
{
......@@ -344,7 +369,7 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_14_UpdownToP102))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_15_StartCompress);
InOutStoreLog("料架取料 " + MoveInfo.SLog + ":压紧轴开始缓慢压紧到P4");
InOutStoreLog("料架取料 " + MoveInfo.SLog + ":压紧轴开始缓慢压紧到P4 :"+ Config.CompAxis_P4_Position);
MoveInfo.WaitList.Add(WaitResultInfo.WaitComAxis(Config.Comp_Axis, Config.CompAxis_P4_Position, Config.CompAxis_P4_Speed));
Config.Comp_Axis.TargetPosition = Config.CompAxis_P4_Position;
ACServerManager.AbsMove(Config.Comp_Axis.DeviceName, Config.Comp_Axis.GetAxisValue(), Config.CompAxis_P4_Position, Config.CompAxis_P4_Speed);
......@@ -533,7 +558,7 @@ namespace OnlineStore.DeviceLibrary
}
else
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_StartGetTray);
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
InOutStoreLog("料架入库 " + MoveInfo.SLog + ":上一盘入库结束, 耗时【" + FormUtil.GetSpanStr(span) + "】判断是否有下个料盘,扫码入库");
}
}
......@@ -583,13 +608,13 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_77_NGLineRun))
{
IOMove(IO_Type.NGLine_Run, IO_VALUE.LOW);
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_StartGetTray);
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
InOutStoreLog("料架入库 " + MoveInfo.SLog + ":停止NG线体转动,开始循环逐个取料盘,扫码入库");
}
#endregion
//料架进入逻辑
else if (MoveInfo.MoveStep < StoreMoveStep.BI_08_StartGetTray)
else if (MoveInfo.MoveStep < StoreMoveStep.BI_10_StartGetTray)
{
ShelfEnterProcess();
}
......@@ -655,7 +680,7 @@ namespace OnlineStore.DeviceLibrary
//发送扫码内容到服务器进行入库操作
Operation operation = getLineBoxStatus();
operation.op = 1;
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", DeviceID.ToString() } };
operation.data = new Dictionary<string, string>() { { "code", message }, { "boxId", 1.ToString() } };
string server = ConfigAppSettings.GetValue(Setting_Init.http_server);
Operation resultOperation = HttpHelper.Post(StoreManager.GetPostApi(server), operation, false);
if (resultOperation == null)
......@@ -729,7 +754,14 @@ namespace OnlineStore.DeviceLibrary
#endregion
#region 料架进出料仓处理:出入库模块共用
private void BI_04_WaitTakeSingle(string moveName)
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_04_WaitTakeSingle);
InOutStoreLog(moveName + MoveInfo.SLog + " 线体正转,等待LineIn_Check=Low, 信号LineTake_Check=High");
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineTake_Check, IO_VALUE.HIGH));
}
private void ShelfEnterProcess()
{
string moveName = "料架入库";
......@@ -741,25 +773,37 @@ namespace OnlineStore.DeviceLibrary
}
if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_01_ReadyShelf))
{
// MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,小车已到达,打开入料口移门");
MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen);
DoorBean.StartOpen(MoveInfo);
if (IOValue(IO_Type.LineIn_Check).Equals(IO_VALUE.HIGH))
{
BI_04_WaitTakeSingle(moveName);
}
else if (IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.HIGH))
{
BI_04_WaitTakeSingle(moveName);
}
else
{
// MoveInfo.ShelfPositionList = new List<string>(ShelfPosList);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,小车已到达,打开入料口移门");
MoveInfo.NextMoveStep(StoreMoveStep.BI_02_DoorOpen);
DoorBean.StartOpen(MoveInfo);
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_02_DoorOpen))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_03_LineRun);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,线体正转,等待取料位检测到信号");
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.MayEnter,线体正转,等待LineIn_Check信号");
AgvClient.MayEnter(Config.AgvNodeName);
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.LOW));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineTake_Check, IO_VALUE.HIGH));
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.LineIn_Check, IO_VALUE.HIGH));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_03_LineRun))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_04_LineStop);
BI_04_WaitTakeSingle(moveName);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_04_WaitTakeSingle))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_05_LineStop);
InOutStoreLog(moveName + MoveInfo.SLog + "调用AgvClient.FinishEnter,取料位检测到信号,停止线体正转");
LineStop();
AgvClient.FinishEnter(Config.AgvNodeName);
......@@ -787,9 +831,9 @@ namespace OnlineStore.DeviceLibrary
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_04_LineStop))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_05_LineStop))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_05_DoorClose);
MoveInfo.NextMoveStep(StoreMoveStep.BI_06_DoorClose);
InOutStoreLog(moveName + MoveInfo.SLog + "入料口移门关闭");
// CylinderMove(MoveInfo, IO_Type.EntranceDoor_Open, IO_Type.EntranceDoor_Close);
DoorBean.StartClose(MoveInfo);
......@@ -801,29 +845,29 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P5, Config.UpDownAxis_P5_Speed);
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_05_DoorClose))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_06_DoorClose))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_06_LineRun);
MoveInfo.NextMoveStep(StoreMoveStep.BI_07_LineRun);
InOutStoreLog(moveName + MoveInfo.SLog + "继续转动1500");
LineRun();
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1500));
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_06_LineRun))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_07_LineRun))
{
LineStop();
MoveInfo.NextMoveStep(StoreMoveStep.BI_07_LocationUp);
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_LocationUp);
InOutStoreLog(moveName + MoveInfo.SLog + "线体停止转动,定位装置上升");
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Down, IO_Type.LocationCylinder_Up);
if (!instoreShelf)
{
InOutStoreLog("出库 " + MoveInfo.SLog + ":叉子进入库位中, 进出轴至P3(库位取放料点) ");
ACAxisMove(Config.InOut_Axis, MoveInfo.MoveParam.MoveP.InOut_P3, Config.InOutAxis_P3_Speed);
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_07_LocationUp))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_08_LocationUp))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_StartGetTray);
MoveInfo.NextMoveStep(StoreMoveStep.BI_09_TopCylinderUp);
InOutStoreLog(moveName + MoveInfo.SLog + "顶升装置上升");
CylinderMove(MoveInfo, IO_Type.TopCylinder_Down, IO_Type.TopCylinder_Up);
......@@ -834,11 +878,11 @@ namespace OnlineStore.DeviceLibrary
ACAxisMove(Config.UpDown_Axis, MoveInfo.MoveParam.MoveP.UpDown_P6, Config.UpDownAxis_P6_Speed);
}
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_08_StartGetTray))
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BI_09_TopCylinderUp))
{
if (instoreShelf)
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_08_StartGetTray);
MoveInfo.NextMoveStep(StoreMoveStep.BI_10_StartGetTray);
InOutStoreLog(moveName + MoveInfo.SLog + "开始循环从第一个空位逐个取料盘,扫码入库");
}
else
......@@ -852,7 +896,7 @@ namespace OnlineStore.DeviceLibrary
lastPosId = posId;
lastPosIdStatus = StoreStatus.OutStoreBoxEnd;
storeStatus = StoreStatus.OutStoreBoxEnd;
}
}
}
}
......@@ -883,7 +927,7 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(StoreMoveStep.BS_02_LocatinCylinder_Down);
InOutStoreLog(moveName + MoveInfo.SLog + " :定位气缸下降");
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
// CylinderMove(MoveInfo, IO_Type.LocationCylinder_Up, IO_Type.LocationCylinder_Down);
}
else if (MoveInfo.MoveStep.Equals(StoreMoveStep.BS_02_LocatinCylinder_Down))
{
......@@ -936,8 +980,7 @@ namespace OnlineStore.DeviceLibrary
InOutStoreLog(moveName + MoveInfo.SLog + ":停止转动,料架入料结束");
LineStop();
}
}
}
#endregion
......@@ -995,6 +1038,7 @@ namespace OnlineStore.DeviceLibrary
private void StartExecuctOut(InOutParam param)
{
bool result = StartOutStoreMove(param);
if (!result)
{
......@@ -1014,29 +1058,26 @@ namespace OnlineStore.DeviceLibrary
(!storeRunStatus.Equals(StoreRunStatus.Runing))
|| (!MoveInfo.MoveType.Equals(StoreMoveType.None)))
{
LogUtil.error(Name + " 启动出库出错,忙碌或报警中 ,storeStatus=" + storeRunStatus + ",MoveType=" + MoveInfo.MoveType + ",isInSuddenDown=" + isInSuddenDown + ",isNoAirCheck" + isNoAirCheck);
LogUtil.error(Name + " 启动出库【" + param.ToStr() + "】失败,忙碌或报警中 ,storeStatus:" + storeRunStatus + ",MoveType:" + MoveInfo.MoveType + ",isInSuddenDown:" + isInSuddenDown + ",isNoAirCheck:" + isNoAirCheck);
return false;
}
if (!StoreManager.LoadInoutParam(param, false, this))
{
LogUtil.error(Name + " 启动出库【" + posId + "】出错,找不到库位信息");
LogUtil.error(Name + " 启动出库【" + param.ToStr() + "】出错,找不到库位信息");
return false;
}
//if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.HIGH))
//{
// LogUtil.error(Name + " 启动出库【" + posId + "】出错,叉子料盘检测有料");
// return false;
//}
storeStatus = StoreStatus.OutStoreExecute;
storeRunStatus = StoreRunStatus.Busy;
MoveInfo.NewMove(StoreMoveType.OutStore, param);
LogInfo("启动出库【" + posId + "】 NeedEnterShelf【" + MoveInfo.MoveParam.NeedEnterShelf + "】NeedOutShelf【" + MoveInfo.MoveParam.NeedOutShelf + "】 ");
LogInfo("启动出库【" + param.ToStr() + "】 ");
//当前无料架,或料架位置为空
if ((IOValue(IO_Type.LineTake_Check).Equals(IO_VALUE.LOW) && MoveInfo.MoveParam.NeedEnterShelf) || MoveInfo.MoveParam.ShelfPosID.Equals(""))
{
MoveInfo.NextMoveStep(StoreMoveStep.BI_01_ReadyShelf);
InOutStoreLog("出库 " + MoveInfo.SLog + ":ReadyShelf:通知agv调度准备带料架的小车,等待小车到达,进出轴到P1");
InOutStoreLog("出库 " + MoveInfo.SLog + ":ReadyShelf:通知agv调度准备带料架的小车,等待小车到达或检测到料架信号,进出轴到P1");
InOutBackToP1(MoveInfo.MoveParam.MoveP.InOut_P1);
//需要先叫小车到达
AgvClient.ReadyShelf(Config.AgvNodeName);
......@@ -1107,14 +1148,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.MoveStep == StoreMoveStep.SO_06_BagDeviceBack)
{
//if (IOValue(IO_Type.TrayCheck_Fixture).Equals(IO_VALUE.LOW))
//{
// string posId = MoveInfo.MoveParam != null ? MoveInfo.MoveParam.PosID : "";
// CodeMsg = "出库[" + posId + "]叉子从库位退出后,未检测到料盘有料";
// LogUtil.error(CodeMsg);
//}
{
MoveInfo.NextMoveStep(StoreMoveStep.SO_08_ToShelfPosition);
InOutStoreLog("出库 " + MoveInfo.SLog + ":走到料架位置,旋转轴至P101,升降轴至P102, ");
ACAxisMove(Config.UpDown_Axis, moveP.UpDown_HP102, Config.UpDownAxis_P102_Speed);
......
......@@ -20,39 +20,34 @@ namespace OnlineStore.DeviceLibrary
{
this.WareCode = "";
MoveP = null;
}
/// <summary>
/// 新建一个对象
/// </summary>
/// <param name="wareNo">物品二维码</param>
/// <param name="position">仓位号</param>
public InOutParam(string wareNo, string posId,string ShelfPosID)
{
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
PosID = posId;
MoveP = null;
IsSolderPaste = false;
}
public InOutParam(string wareNo, string posId,string plateH,string plateW, string ShelfPosID )
}
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)
{
this.ShelfPosID = ShelfPosID;
WareCode = wareNo;
PosID = posId;
MoveP = null;
this.PlateW = plateW;
this.PlateH = plateH;
IsSolderPaste = false;
this.PlateW = platew;
this.PlateH = plateh;
this.urgentReel = urgentReel;
this.cutReel = cutReel;
this.smallReel = smallReel;
this.rfid = rfid;
this.rfidLoc = rfidLoc;
}
public InOutParam(string wareNo, string posId, string ShelfPosID,LineMoveP linePosition )
{
WareCode = wareNo;
this.ShelfPosID = ShelfPosID;
PosID = posId;
MoveP = linePosition;
IsSolderPaste = false;
MoveP = linePosition;
NeedEnterShelf = false;
NeedOutShelf = false;
this.urgentReel = false ;
this.cutReel = false ;
this.smallReel = false ;
this.rfid = "";
this.rfidLoc = 0;
}
/// <summary>
/// 物品二维码信息
......@@ -75,10 +70,7 @@ namespace OnlineStore.DeviceLibrary
/// 料盘宽度
/// </summary>
public string PlateW { get; set; }
/// <summary>
/// 是否是放入锡膏(在线料仓才需要此字段)
/// </summary>
public bool IsSolderPaste { get; set; }
/// <summary>
/// 出入库时需要进入新料架
......@@ -88,6 +80,31 @@ namespace OnlineStore.DeviceLibrary
/// 出入库结束后需要将料架送出
/// </summary>
public bool NeedOutShelf = true;
/// <summary>
/// urgentReel: true 表示紧急料,需要出到料串上
/// </summary>
public bool urgentReel { get; set; }
/// <summary>
/// cutReel: true 表示分盘料,需要出到料串上
/// </summary>
public bool cutReel { get; set; }
/// <summary>
/// smallReel: true 小料(7x8),放置到小料架上
/// </summary>
public bool smallReel { get; set; }
/// <summary>
/// rfid: 分配的料架RFID
/// </summary>
public string rfid { get; set; }
/// <summary>
/// rfidLoc: 料架的架位,值为 - 1时,可以自由分配皮带线,
/// 小料时,架位为1 - 46优先走1 / 2号皮带线,47 - 92优先走3 / 4号皮带线,
/// 70,71,72时只能分配到3 / 4号皮带线;
/// 大料时,架位1 - 6优先走1 / 2号皮带线, 7 - 12优先走3/ 4号皮带线
/// </summary>
public int rfidLoc { get; set; }
/// <summary>
/// 根据PosId获取对应的料仓ID,若PosId=="",返回-1
......@@ -114,7 +131,9 @@ namespace OnlineStore.DeviceLibrary
}
public string ToStr()
{
return " ShelfPosID=["+ ShelfPosID + "],WareCode=【" + WareCode + "】,PosID=【" + PosID + "】,PlateW=【" + PlateW + "】,PlateH=【" + PlateH + "】";
return " ShelfPosID=[" + ShelfPosID + "],WareCode [" + WareCode + "],PosID [" + PosID + "],PlateW [" + PlateW + "],PlateH [" + PlateH + "]" +
"NeedEnterShelf【" + NeedEnterShelf + "】NeedOutShelf【" + NeedOutShelf + "】"+
"urgentReel [" + urgentReel + "],cutReel [" + cutReel + "],smallReel [" + smallReel + "],rfid [" + rfid + "],rfidLoc [" + rfidLoc + "]";
}
internal void UpdateShelfPosId(string pId)
......
......@@ -170,36 +170,40 @@ namespace OnlineStore.DeviceLibrary
BI_02_DoorOpen = 1002,
/// <summary>
/// 料架入库:线体正转
/// 料架入库:线体正转,等待入料口检测到信号
/// </summary>
BI_03_LineRun = 1003,
/// <summary>
/// 等待取料位检测到信号
/// </summary>
BI_04_WaitTakeSingle=1004,
/// <summary>
/// 料架入库:取料位检测到信号,停止线体正转
/// </summary>
BI_04_LineStop = 1004,
BI_05_LineStop = 1005,
/// <summary>
/// 料架入库:入料口移门关闭,等待1000
/// </summary>
BI_05_DoorClose = 1005,
BI_06_DoorClose = 1006,
/// <summary>
/// 线体再正转1秒
/// </summary>
BI_06_LineRun=1006,
BI_07_LineRun=1007,
/// <summary>
/// 料架入库:定位装置上升
/// </summary>
BI_07_LocationUp = 1007,
BI_08_LocationUp = 1008,
/// <summary>
/// 料架入库:顶升装置上升
/// </summary>
BI_08_TopCylinderUp = 1008,
BI_09_TopCylinderUp = 1009,
#endregion
#region 出库步骤 2000开始
/// <summary>
///料仓出库,,定位气缸下降
/// </summary>
......@@ -273,7 +277,7 @@ namespace OnlineStore.DeviceLibrary
/// <summary>
/// 料架入库:开始循环从第一个空位逐个取料盘,扫码入库
/// </summary>
BI_08_StartGetTray = 20008,
BI_10_StartGetTray = 3010,
/// <summary>
/// 料架取料:叉子后退到待机点P1
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!