Commit 4c471de1 LN

皮带线3优化

1 个父辈 915db7af
...@@ -276,15 +276,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -276,15 +276,8 @@ namespace OnlineStore.DeviceLibrary
else else
{ {
//皮带线3出口有料,分盘定位装置无料 //皮带线3出口有料,分盘定位装置无料
if (Line3TurnIsStop() && IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW)) if (Line3TurnIsStop() && IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.LOW) && StationInfo_NG.TrayValue.Equals(IO_VALUE.HIGH))
{ {
//开始扫码然后送出料盘
//1.扫码,
//2.从服务器获取尺寸
//3.顶升或下降定位气缸
//皮带线3转动,分料皮带转动,
//等待料盘到达工位。
StartOutStoreMove(new InOutParam()); StartOutStoreMove(new InOutParam());
} }
} }
...@@ -376,16 +369,14 @@ namespace OnlineStore.DeviceLibrary ...@@ -376,16 +369,14 @@ namespace OnlineStore.DeviceLibrary
TrayLine2.Line3CanRun && TrayLine2.Line3CanRun &&
ngNoTray && ngNoTray &&
Line3HasTray() Line3HasTray()
&& (IsInScanCode.Equals(false))
&& (IsNewType.Equals(false) || IsInScanCode.Equals(false))
) )
{ {
//判断皮带三还有料盘,需要转动一个工位 //判断皮带三还有料盘,需要转动一个工位
UpdateLastP(); UpdateLastP();
LogUtil.debug(hengyiName + "空闲,且流水线还有料盘,转动一个工位"); LogUtil.debug(hengyiName + "空闲,且流水线还有料盘,转动一个工位");
Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess); Line3Turn.StartLineRun(IO_Type.DLine_Run3, IO_Type.Location_Check3, Line3EndProcess);
} }
} }
private void UpdateLastP() private void UpdateLastP()
{ {
...@@ -447,39 +438,44 @@ namespace OnlineStore.DeviceLibrary ...@@ -447,39 +438,44 @@ namespace OnlineStore.DeviceLibrary
private void NewTypeScan(bool isfirst = false) private void NewTypeScan(bool isfirst = false)
{ {
if (IsNewType) // if (IsNewType)
{ {
IsInScanCode = true; IsInScanCode = true;
LastCode = ""; string LastCode = "";
//LastCodeList = new List<string>(); //LastCodeList = new List<string
if (isfirst)
{ Task.Factory.StartNew(delegate
StationInfo_NG = new StationTrayInfo(IO_VALUE.HIGH);
}
else
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.LOW);
IsInScanCode = false;
}
else
{ {
Task.Factory.StartNew(delegate if (isfirst)
{
StationInfo_NG = new StationTrayInfo(IO_VALUE.HIGH);
}
else
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
Thread.Sleep(300);
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.LOW);
if (DeviceID.Equals(301))
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
IsInScanCode = false;
}
else
{ {
try try
{ {
LogUtil.info(hengyiName + "扫码工位:200ms后开始扫码,IsInScanCode=" + IsInScanCode); LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode);
Thread.Sleep(200); List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
if (LastCodeList.Count <= 0) if (LastCodeList.Count <= 0)
{ {
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name); LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
} }
LastCode = SServerManager.ProcessCodeList(LastCodeList); LastCode = SServerManager.ProcessCodeList(LastCodeList);
// Thread.Sleep(5000); // Thread.Sleep(5000);
} }
catch (Exception ex) catch (Exception ex)
{ {
...@@ -488,13 +484,17 @@ namespace OnlineStore.DeviceLibrary ...@@ -488,13 +484,17 @@ namespace OnlineStore.DeviceLibrary
finally finally
{ {
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode); StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode);
if (DeviceID.Equals(301))
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
IsInScanCode = false; IsInScanCode = false;
LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode); LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode);
} }
}); }
}
});
} }
} }
protected override void IOTimeOutProcess() protected override void IOTimeOutProcess()
...@@ -546,7 +546,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -546,7 +546,7 @@ namespace OnlineStore.DeviceLibrary
} }
else else
{ {
msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + " " + LastWidth + "=" + LastCode + "\n"; msg += "Move:" + MoveInfo.MoveType + " " + MoveInfo.MoveStep + " " + LastWidth + "=" + StationInfo_Move.CodeStr + "\n";
} }
msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n"; msg += "扫码工位:" + StationInfo_Scan.ToStr + "\n";
msg += "NG 工位:" + StationInfo_NG.ToStr + "\n"; msg += "NG 工位:" + StationInfo_NG.ToStr + "\n";
......
...@@ -12,18 +12,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -12,18 +12,18 @@ namespace OnlineStore.DeviceLibrary
partial class DischargeLine partial class DischargeLine
{ {
// private List<string> LastCodeList = new List<string>(); // private List<string> LastCodeList = new List<string>();
private string LastCode = ""; // private string LastCode = "";
private int LastWidth = 0; private int LastWidth = 0;
private int scanCodeCount = 0; // private int scanCodeCount = 0;
protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait) protected override bool CheckWaitResult(LineMoveInfo moveInfo, WaitResultInfo wait)
{ {
if (wait.WaitType.Equals(WaitEnum.W301_DLineScanCode)) if (wait.WaitType.Equals(WaitEnum.W301_DLineScanCode))
{ {
if (String.IsNullOrEmpty(LastCode).Equals(false)) //if (String.IsNullOrEmpty(LastCode).Equals(false))
{ //{
return true; // return true;
} //}
} }
return false; return false;
} }
...@@ -54,17 +54,18 @@ namespace OnlineStore.DeviceLibrary ...@@ -54,17 +54,18 @@ namespace OnlineStore.DeviceLibrary
{ {
if (runStatus.Equals(LineRunStatus.Runing)) if (runStatus.Equals(LineRunStatus.Runing))
{ {
StationInfo_Move = new StationTrayInfo(StationInfo_NG.TrayValue, StationInfo_NG.CodeStr);
runStatus = LineRunStatus.Busy; runStatus = LineRunStatus.Busy;
MoveInfo.MoveParam = param; MoveInfo.MoveParam = param;
MoveInfo.NewMove(LineMoveType.OutStore); MoveInfo.NewMove(LineMoveType.OutStore);
LogUtil.info(hengyiName + "出口有料,NG气缸后退,等待1000后扫码"); LogUtil.info(hengyiName + "出口有料,NG气缸后退,等待100后获取盘尺寸");
MoveInfo.NextMoveStep(LineMoveStep.DO_01_WaitTime); MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(1000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(100));
ScanNgBack(MoveInfo); ScanNgBack(MoveInfo);
//LastCodeList = new List<string>(); //LastCodeList = new List<string>();
LastCode = ""; // LastCode = StationInfo_Move.CodeStr;
LastWidth = 0; LastWidth = 0;
scanCodeCount = 0; // scanCodeCount = 0;
return true; return true;
} }
else else
...@@ -73,42 +74,42 @@ namespace OnlineStore.DeviceLibrary ...@@ -73,42 +74,42 @@ namespace OnlineStore.DeviceLibrary
return false; return false;
} }
} }
private void ScanCode() //private void ScanCode()
{ //{
MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode); // MoveInfo.NextMoveStep(LineMoveStep.DO_02_ScanCode);
List<string> cameraList = Config.GetCameraList(); // List<string> cameraList = Config.GetCameraList();
if (cameraList.Count > 0) // if (cameraList.Count > 0)
{ // {
scanCodeCount++; // scanCodeCount++;
LogUtil.info(hengyiName + "出口有料,开始第【" + scanCodeCount + "】次扫码,皮带线停止转动"); // LogUtil.info(hengyiName + "出口有料,开始第【" + scanCodeCount + "】次扫码,皮带线停止转动");
MoveInfo.OneWaitCanEndStep = true; // MoveInfo.OneWaitCanEndStep = true;
MoveInfo.WaitList.Add(WaitResultInfo.WaitDLineScanCode()); // MoveInfo.WaitList.Add(WaitResultInfo.WaitDLineScanCode());
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
try // try
{ // {
Task<List<string>> scanTask = Task.Factory.StartNew(delegate // Task<List<string>> scanTask = Task.Factory.StartNew(delegate
{ // {
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name); // List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
if (LastCodeList.Count <= 0) // if (LastCodeList.Count <= 0)
{ // {
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name); // LastCodeList = CodeManager.CameraScan(Config.GetCameraList(),Name);
} // }
LastCode = SServerManager.ProcessCodeList(LastCodeList); // LastCode = SServerManager.ProcessCodeList(LastCodeList);
return LastCodeList; // return LastCodeList;
}); // });
} // }
catch (Exception ex) // catch (Exception ex)
{ // {
LogUtil.error("FI_13_ScanCode扫码出错:", ex); // LogUtil.error("FI_13_ScanCode扫码出错:", ex);
} // }
} // }
else // else
{ // {
LogUtil.info(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续"); // LogUtil.info(hengyiName + "出口有料,未取到相机名称,不扫码,等待1000后继续");
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000)); // MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(6000));
} // }
} //}
private void WaitSeparateCheck() private void WaitSeparateCheck()
{ {
...@@ -126,7 +127,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -126,7 +127,7 @@ namespace OnlineStore.DeviceLibrary
&& Line3TurnIsStop() && Line3TurnIsStop()
&& Line3Turn.CanStart() && Line3Turn.CanStart()
&& ScanNgIsBack() && ScanNgIsBack()
&& (IsNewType.Equals(false) || IsInScanCode.Equals(false)) && ( IsInScanCode.Equals(false))
) )
{ {
return true; return true;
...@@ -149,32 +150,22 @@ namespace OnlineStore.DeviceLibrary ...@@ -149,32 +150,22 @@ namespace OnlineStore.DeviceLibrary
} }
#region 原有方式的横移料盘处理 #region 原有方式的横移料盘处理
if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_01_WaitTime)) //if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_01_WaitTime))
{ //{
ScanCode(); // ScanCode();
} //}
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_02_ScanCode)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_02_ScanCode))
{ {
MoveInfo.NextMoveStep(LineMoveStep.DO_03_GetTraySize); MoveInfo.NextMoveStep(LineMoveStep.DO_03_GetTraySize);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000)); MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
//如果未扫到条码,重新扫码3次
//if (scanCodeCount < 3 && LastCode.Equals("") && Config.GetCameraList().Count > 0)
//{
// ScanCode();
//}
//else
//{
LastWidth = 0; LastWidth = 0;
int robotIndex = 1; int robotIndex = 1;
if (DeviceID.Equals(301)) if (DeviceID.Equals(301))
{ {
robotIndex = 2; robotIndex = 2;
} }
string result = SServerManager.GetTraySize(Name, robotIndex, LastCode, out LastWidth); string result = SServerManager.GetTraySize(Name, robotIndex, StationInfo_Move.CodeStr, out LastWidth);
LogUtil.info(hengyiName + "出口有料,二维码[" + LastCode + "] 获取料盘尺寸【" + LastWidth + "】【" + result + "】"); LogUtil.info(hengyiName + "出口有料,二维码[" + StationInfo_Move.CodeStr + "] 获取料盘尺寸【" + LastWidth + "】【" + result + "】");
//}
// MoveInfo.EndMove();
} }
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_03_GetTraySize)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.DO_03_GetTraySize))
{ {
......
...@@ -72,7 +72,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -72,7 +72,10 @@ namespace OnlineStore.DeviceLibrary
StopMove(); StopMove();
} }
} }
public virtual void CheckAlarmProcess(LineMoveInfo moveInfo,LineAlarmType alarmType)
{
}
public bool MoveStop = false; public bool MoveStop = false;
/// <summary> /// <summary>
/// 运动处理 /// 运动处理
...@@ -88,22 +91,6 @@ namespace OnlineStore.DeviceLibrary ...@@ -88,22 +91,6 @@ namespace OnlineStore.DeviceLibrary
{ {
CheckFixtureProcess(); CheckFixtureProcess();
} }
//switch (MoveInfo.MoveType)
//{
// case LineMoveType.InStore:
// InStoreProcess();
// break;
// case LineMoveType.OutStore:
// OutStoreProcess();
// break;
// case LineMoveType.ReturnHome:
// ResetProcess();
// break;
// case LineMoveType.Reset:
// ResetProcess();
// break;
// default: break;
//}
if (MoveInfo.MoveType.Equals(LineMoveType.InStore) || this.SecondMoveInfo.MoveType.Equals(LineMoveType.InStore)) if (MoveInfo.MoveType.Equals(LineMoveType.InStore) || this.SecondMoveInfo.MoveType.Equals(LineMoveType.InStore))
{ {
InStoreProcess(); InStoreProcess();
...@@ -422,6 +409,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -422,6 +409,7 @@ namespace OnlineStore.DeviceLibrary
WarnMsg = Name + msg; WarnMsg = Name + msg;
Alarm(LineAlarmType.AxisMoveError); Alarm(LineAlarmType.AxisMoveError);
CheckAlarmProcess(moveInfo, LineAlarmType.AxisMoveError);
LogUtil.error(WarnMsg, DeviceID + 18); LogUtil.error(WarnMsg, DeviceID + 18);
break; break;
} }
...@@ -454,12 +442,13 @@ namespace OnlineStore.DeviceLibrary ...@@ -454,12 +442,13 @@ namespace OnlineStore.DeviceLibrary
ConfigIO io = baseConfig.getWaitIO(wait.IoType); ConfigIO io = baseConfig.getWaitIO(wait.IoType);
WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时"; WarnMsg = moveInfo.Name + "[" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] 等待" + NotOkMsg + " 超时";
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
CheckAlarmProcess(moveInfo, LineAlarmType.IoSingleTimeOut);
LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13); LogUtil.error(MoveInfo.Name + WarnMsg, DeviceID + 13);
} }
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "] " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds,1) + "秒,重写DO:";
bool isLog = false; bool isLog = false;
foreach (WaitResultInfo ww in list) foreach (WaitResultInfo ww in list)
{ {
...@@ -536,6 +525,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -536,6 +525,7 @@ namespace OnlineStore.DeviceLibrary
} }
LogUtil.error(WarnMsg, DeviceID + 15, second); LogUtil.error(WarnMsg, DeviceID + 15, second);
Alarm(LineAlarmType.IoSingleTimeOut); Alarm(LineAlarmType.IoSingleTimeOut);
CheckAlarmProcess(moveInfo, LineAlarmType.IoSingleTimeOut);
} }
} }
catch (Exception ex) catch (Exception ex)
......
...@@ -45,7 +45,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -45,7 +45,15 @@ namespace OnlineStore.DeviceLibrary
} }
return false; return false;
} }
public override void CheckAlarmProcess(LineMoveInfo moveInfo, LineAlarmType alarmType)
{
if (moveInfo.MoveType.Equals(LineMoveStep.FI_18_WaitNoLocationCheck)&&alarmType.Equals(LineAlarmType.IoSingleTimeOut))
{
string code = CodeManager.ProcessCode(LastCodeList);
LogUtil.error(moveInfo.Name + " [" + moveInfo.MoveType + "][" + moveInfo.MoveStep + "]等待SL_AxisLocationCheck=LOW超时,清空当前料盘条码:"+code);
LastCodeList = new List<string>();
}
}
public event TrayProcessEnd TrayPEndEvent; public event TrayProcessEnd TrayPEndEvent;
#region 托盘检测 #region 托盘检测
private InOutParam CheckParam = new InOutParam(); private InOutParam CheckParam = new InOutParam();
...@@ -676,7 +684,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -676,7 +684,7 @@ namespace OnlineStore.DeviceLibrary
} }
#endregion #endregion
#region 检测到托盘,扫码,取料并放入托盘 #region 检测到托盘,扫码,取料并放入托盘
else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_10_AxisUpMove)) else if (MoveInfo.MoveStep.Equals(LineMoveStep.FI_10_AxisUpMove))
{ {
CheckHasTray(); CheckHasTray();
...@@ -1127,7 +1135,8 @@ namespace OnlineStore.DeviceLibrary ...@@ -1127,7 +1135,8 @@ namespace OnlineStore.DeviceLibrary
} }
} }
if (LastHeight <= 8) { LastHeight = 8; } if (LastHeight <= 8) { LastHeight = 8; }
string msg = Name + " 计算盘高:上升前 [" + StartMovePosition + "]实时[ " + EndMovePosition + "]差值[" + (EndMovePosition - StartMovePosition) + "]系数[" + AxisChangeValue + "] 计算后"+buchongStr+"[" + height + "]" + ",归类为【" + LastHeight + "mm】"; string code = CodeManager.ProcessCode(LastCodeList);
string msg = Name + " 计算盘高:上升前 [" + StartMovePosition + "]实时[ " + EndMovePosition + "]差值[" + (EndMovePosition - StartMovePosition) + "]系数[" + AxisChangeValue + "] 计算后"+buchongStr+"[" + height + "]" + ",归类为【" + LastHeight + "mm】条码【"+code+"】";
LogUtil.info(msg); LogUtil.info(msg);
return LastHeight; return LastHeight;
} }
......
...@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -113,7 +113,7 @@ namespace OnlineStore.DeviceLibrary
else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2) else if (rwSpan.TotalSeconds > 5 && span.TotalSeconds > 6 && span.TotalSeconds < LineManager.Config.IOSingle_TimerOut * 2)
{ {
preRWTime = DateTime.Now; preRWTime = DateTime.Now;
string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Abs(span.TotalSeconds) + "秒,重写DO:"; string msg = checkWaitInfo.Name + " " + NotOkMsg + "已等待 " + Math.Round(span.TotalSeconds,1) + "秒,重写DO:";
bool isLog = false; bool isLog = false;
foreach (WaitResultInfo ww in list) foreach (WaitResultInfo ww in list)
{ {
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!