Commit 7290c4f8 张东亮

横移10#12#17不放行

1 个父辈 47660d67
......@@ -59,54 +59,55 @@ namespace OnlineStore.DeviceLibrary
{
//if (Monitor.TryEnter(lockObj, TrayManager.mTimeOut))
//{
try
try
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheckLowWait.Stop();
}
else
trayCheckLowWait.Stop();
}
else
{
CheckStopWatch(trayCheckLowWait, 30000, false);
}
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && IOValue(IO_Type.HY_OL_Full_Check).Equals(IO_VALUE.LOW))
{
bool canpro = true;
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
{
trayCheckLowWait.Stop();
if (canpro && CheckStopWatch(trayCheckWait, TrayWaitTime, true))
{
CheckStopWatch(trayCheckLowWait, 30000, false);
Start_JHY_05_TrayCheck();
}
LogUtil.error(Name + " CheckFixture " + " 不在空闲中,直接返回 ");
return;
}
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None) && IOValue(IO_Type.HY_OL_Full_Check).Equals(IO_VALUE.LOW))
else
{
bool canpro = true;
if (IOValue(IO_Type.HY_TrayCheck).Equals(IO_VALUE.HIGH))
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false);
if (IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
trayCheckLowWait.Stop();
if (canpro && CheckStopWatch(trayCheckWait, TrayWaitTime, true))
//CheckStopWatch(trayCheckWait, TrayWaitTime, false) &&
if (check2IsOk && canpro)
{
Start_JHY_05_TrayCheck();
StartTrayCheck();
}
}
else
// else
{
bool check2IsOk = CheckStopWatch(trayCheckLowWait, TrayWaitTime, false);
if (IOValue(IO_Type.HY_FrontStopCheck).Equals(IO_VALUE.HIGH))
{
if (CheckStopWatch(trayCheckWait, TrayWaitTime, false) && check2IsOk && canpro)
{
StartTrayCheck();
}
}
else
{
trayCheckWait.Stop();
}
trayCheckWait.Stop();
}
}
}
catch (Exception ex)
{
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
}
catch (Exception ex)
{
LogUtil.error(Name + " CheckFixture " + " 出错:" + ex.ToString());
}
// finally
// {
// Monitor.Exit(lockObj);
......@@ -124,7 +125,7 @@ namespace OnlineStore.DeviceLibrary
try
{
if (SecondMoveInfo.MoveType.Equals(LineMoveType.None).Equals(false))
{
{
LogUtil.error(Name + " CheckFixture Start_JHY_05_TrayCheck " + " 不在空闲中,直接返回 ");
return;
}
......@@ -190,8 +191,9 @@ namespace OnlineStore.DeviceLibrary
SecondMoveInfo.NewMove(LineMoveType.Fixture);
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_05_TrayCheck);
CheckLog("接驳台托盘" + SecondMoveInfo.SLog + "前阻挡上升,等待托盘到位 ");
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
CheckLog("接驳台托盘" + SecondMoveInfo.SLog + "前阻挡下降1.2s,等待托盘到位 ");
//IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.HIGH, 1200);
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_FrontStopDown, IO_VALUE.LOW));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.HIGH));
......@@ -235,7 +237,7 @@ namespace OnlineStore.DeviceLibrary
{
LogUtil.error("trayCheckStop error: " + ex.ToString());
}
}
private bool IsNgPro()
{
......@@ -332,13 +334,13 @@ namespace OnlineStore.DeviceLibrary
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_07_TopUp))
{
{
if (IsLocationCylinderUp())
{
{
JHY_09_WaitProcessReel();
}
else
{
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_08_LocationUp);
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":料盘需要横移,定位上升");
LocationCylinderUp(SecondMoveInfo);
......@@ -347,7 +349,7 @@ namespace OnlineStore.DeviceLibrary
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_08_LocationUp))
{
JHY_09_WaitProcessReel();
}
else if (SecondMoveInfo.IsStep(LineMoveStep.JHY_09_WaitProcessReel))
{
......@@ -403,7 +405,7 @@ namespace OnlineStore.DeviceLibrary
{
time = 800;
}
CheckLog(" 托盘放行" + SecondMoveInfo.SLog + ":等待"+ time + "ms,托盘检测无信号");
CheckLog(" 托盘放行" + SecondMoveInfo.SLog + ":等待" + time + "ms,托盘检测无信号");
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitTime(time));
SecondMoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_TrayCheck, IO_VALUE.LOW));
}
......@@ -460,7 +462,7 @@ namespace OnlineStore.DeviceLibrary
private void JHY_11_TopDown()
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_11_TopDown);
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_11_TopDown);
IOMove(IO_Type.HY_FrontStopDown, IO_VALUE.LOW);
if (IsNgPro())
{
......@@ -487,7 +489,7 @@ namespace OnlineStore.DeviceLibrary
string code = SecondMoveInfo.MoveParam.WareCode;
bool isNg = false;
string result = SServerManager.GetTraySize(Name, robotIndex, code, out LastWidth, out isNg);
OutLog("接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】"+(isNg?"NG":"")+"【" + result + "】",1);
OutLog("接驳台托盘[" + currTrayNum + "] [" + code + "] 获取尺寸【" + LastWidth + "】" + (isNg ? "NG" : "") + "【" + result + "】", 1);
if (LastWidth > 0)
{
......@@ -505,7 +507,7 @@ namespace OnlineStore.DeviceLibrary
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + result);
}
else if (string.IsNullOrEmpty(code))
{
{
TrayManager.UpdateInStoreNG(currTrayNum, true, "二维码为空");
LogInfo("更新工单出库料[" + currTrayNum + "] [" + code + "]为NG料:" + "二维码为空");
}
......@@ -516,10 +518,10 @@ namespace OnlineStore.DeviceLibrary
{
//更新托盘为空
if (SecondMoveInfo.IsStep(LineMoveStep.JHY_09_WaitProcessReel))
{
{
SecondMoveInfo.NextMoveStep(LineMoveStep.JHY_10_ReelProEnd);
if (IsNgPro())
{
{
OutLog(Name + " 料盘已移走,更新托盘[" + currTrayNum + "]为空");
CheckLog(" 接驳台托盘" + SecondMoveInfo.SLog + ":料盘已移走,更新托盘[" + currTrayNum + "]为空");
TrayManager.UpdateTrayInfo(currTrayNum);
......@@ -536,7 +538,7 @@ namespace OnlineStore.DeviceLibrary
}
}
private bool ReelNeedMove()
{
try
......@@ -552,7 +554,7 @@ namespace OnlineStore.DeviceLibrary
if (!trayInfo.IsFull)
{
return false;
}
}
InOutParam inoup = trayInfo.InoutPar;
if (inoup.IsNG)
{
......@@ -561,7 +563,7 @@ namespace OnlineStore.DeviceLibrary
if (trayInfo.InOrOutStore.Equals(ReelType.OutStore) && inoup.urgentReel.Equals(false) && inoup.cutReel.Equals(false))
{
LogInfo(" 工单料->接驳台:" + "" + inoup.ToStr());
SecondMoveInfo.MoveParam = inoup;
SecondMoveInfo.MoveParam = inoup;
return true;
}
......@@ -574,7 +576,7 @@ namespace OnlineStore.DeviceLibrary
return false;
}
private bool ReelNeedToNG()
{
try
......@@ -588,13 +590,13 @@ namespace OnlineStore.DeviceLibrary
return false;
}
InOutParam inoup = trayInfo.InoutPar;
if (trayInfo.IsFull && trayInfo.InoutPar.IsNG && this.DeviceID.Equals(217)&& trayInfo.InOrOutStore.Equals(1))
if (trayInfo.IsFull && trayInfo.InoutPar.IsNG && this.DeviceID.Equals(217) && trayInfo.InOrOutStore.Equals(1))
{
LogInfo(" NG料->NG箱" + "" + inoup.ToStr());
//如果分配了库位,需要调用取消
if (trayInfo.InoutPar.WareCode != "" && trayInfo.InoutPar.PosId != "")
{
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode,false );
SServerManager.cancelPutInTask(Name, trayInfo.InoutPar.WareCode, false);
}
SecondMoveInfo.MoveParam = inoup;
//MoveInfo.MoveParam = inoup;
......@@ -672,7 +674,8 @@ namespace OnlineStore.DeviceLibrary
{
JM_02_CylinderTake();
}
else {
else
{
MoveInfo.NextMoveStep(LineMoveStep.JM_01_UpdownToP1);
OutLog("托盘移栽 升降气缸上升 ");
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
......@@ -722,7 +725,7 @@ namespace OnlineStore.DeviceLibrary
/// </summary>
private bool getTrayReelOk = true;
protected override void OutStoreProcess()
{
{
if (MoveInfo.IsInWait)
{
CheckWait(MoveInfo);
......@@ -737,7 +740,7 @@ namespace OnlineStore.DeviceLibrary
}
else if (MoveInfo.IsStep(LineMoveStep.JM_02_CylinderTake))
{
int p2 = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH,MoveInfo.MoveParam.PlateW);
int p2 = Config.GetUpdownP2Detial(MoveInfo.MoveParam.PlateH, MoveInfo.MoveParam.PlateW);
MoveInfo.NextMoveStep(LineMoveStep.JM_03_UpdownToP2);
OutLog(logName + MoveInfo.SLog + ":升降轴下降到取料点P2 [" + p2 + "]");
UpdownAxis.AbsMove(MoveInfo, p2, Config.UpdownAxis_P2Speed);
......@@ -758,7 +761,7 @@ namespace OnlineStore.DeviceLibrary
{
OutTrayNum = currTrayNum;
MoveInfo.NextMoveStep(LineMoveStep.JM_06_UpdownToP1);
OutLog(logName + MoveInfo.SLog + ":升降轴到P1 [" + Config.UpDownAxisP1 + "],更新 getTrayReelOk=true,更新当前出库托盘号="+ OutTrayNum);
OutLog(logName + MoveInfo.SLog + ":升降轴到P1 [" + Config.UpDownAxisP1 + "],更新 getTrayReelOk=true,更新当前出库托盘号=" + OutTrayNum);
UpdownAxis.AbsMove(MoveInfo, Config.UpDownAxisP1, Config.UpdownAxis_P1Speed);
getTrayReelOk = true;
//如果不是NG口,提前放托盘离开
......@@ -786,10 +789,10 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.IsStep(LineMoveStep.JM_07_ClampCheck))
{
//判断是否正常抓取料
if(IOValue(IO_Type.HY_ClampCylinder_Check).Equals(IO_VALUE.LOW))
if (IOValue(IO_Type.HY_ClampCylinder_Check).Equals(IO_VALUE.LOW))
{
getTrayReelOk = false;
LogInfo("从托盘["+ OutTrayNum + "]上抓取无料失败,夹爪气缸料盘检测信号=LOW");
LogInfo("从托盘[" + OutTrayNum + "]上抓取无料失败,夹爪气缸料盘检测信号=LOW");
}
//TrayCanGo();
if (IsNgPro())
......@@ -852,7 +855,7 @@ namespace OnlineStore.DeviceLibrary
//接驳台有料,直接发arrive
int robotIndex = GetRobotIndex();
string msg = SServerManager.arrive3fRobotLocation(Name, robotIndex, code);
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台,更新托盘[" + OutTrayNum + "]为空 ,发送 arrive3fRobotLocation = " + msg,1);
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台,更新托盘[" + OutTrayNum + "]为空 ,发送 arrive3fRobotLocation = " + msg, 1);
afterPutCutOK = true;
//清空托盘
TrayManager.UpdateTrayInfo(OutTrayNum);
......@@ -865,19 +868,19 @@ namespace OnlineStore.DeviceLibrary
afterPutCutOK = true;
if (getTrayReelOk)
{
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台失败 ,更新托盘[" + OutTrayNum + "]为NG ,发送 clearOutTask=" + msg,1);
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台失败 ,更新托盘[" + OutTrayNum + "]为NG ,发送 clearOutTask=" + msg, 1);
//更新托盘为NG
TrayManager.UpdateInStoreNG(OutTrayNum, true, "工单料放料到接驳台失败");
}
else
{
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台失败 (未抓起料盘),更新托盘[" + OutTrayNum + "]为NG ,发送 clearOutTask=" + msg,1);
OutLog(logName + MoveInfo.SLog + ",工单料到达接驳台失败 (未抓起料盘),更新托盘[" + OutTrayNum + "]为NG ,发送 clearOutTask=" + msg, 1);
//更新托盘为NG
TrayManager.UpdateInStoreNG(OutTrayNum, true, "工单料放料到接驳台失败(未抓起料盘)");
}
}
MoveInfo.NextMoveStep(LineMoveStep.JM_15_ClampCheck);
OutLog(logName + MoveInfo.SLog + ":夹爪料盘检测无料 ",1);
OutLog(logName + MoveInfo.SLog + ":夹爪料盘检测无料 ", 1);
MoveInfo.WaitList.Add(WaitResultInfo.WaitIO(IO_Type.HY_ClampCylinder_Check, IO_VALUE.LOW));
}
......@@ -902,7 +905,8 @@ namespace OnlineStore.DeviceLibrary
TaskData taskData;
string msg = SServerManager.afterPutCut(Name, "BN", code, "", 1, out taskData);
afterPutCutOK = true;
}else if (MoveInfo.MoveParam.cutReel)
}
else if (MoveInfo.MoveParam.cutReel)
{
OutLog(logName + MoveInfo.SLog + ",分盘料已放入NG箱,发送 afterPutCut ");
TaskData taskData;
......@@ -937,7 +941,7 @@ namespace OnlineStore.DeviceLibrary
}
if (afterPutCutOK)
{
ClearTimeoutAlarm("给服务器发送 "+ log + " 完成");
ClearTimeoutAlarm("给服务器发送 " + log + " 完成");
MoveEndS();
}
else if (MoveInfo.IsTimeOut(60))
......@@ -948,11 +952,11 @@ namespace OnlineStore.DeviceLibrary
else
{
LogUtil.error(Name + "OutStoreProcess 未找到[" + MoveInfo.MoveType + "][" + MoveInfo.MoveStep + "]的处理");
}
}
}
private void JM_11_CylinderGive()
{
{
MoveInfo.NextMoveStep(LineMoveStep.JM_11_CylinderGive);
OutLog(logName + MoveInfo.SLog + ":接驳台气缸放料 ");
CylinderMove(MoveInfo, IO_Type.HY_MoveCylinder_Take, IO_Type.HY_MoveCylinder_Give);
......@@ -1023,7 +1027,7 @@ namespace OnlineStore.DeviceLibrary
int tLength = 15;
if (!String.IsNullOrEmpty(RFIDIP))
{
msg += "当前托盘:" + currTrayNum + " 上个托盘:" + preTrayNum + ",料盘托盘:"+OutTrayNum+"\n";
msg += "当前托盘:" + currTrayNum + " 上个托盘:" + preTrayNum + ",料盘托盘:" + OutTrayNum + "\n";
}
msg += "runS: " + runStatus + "\n";
msg += "alarm: " + alarmType + " " + LastAlarmTime.ToLongTimeString() + "\n";
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!