Commit b96e30eb LN

皮带线判断修改

1 个父辈 ab2d5cda
......@@ -288,6 +288,9 @@ IO_Value增加None的定义,防止误操作
扫码获取图片方式修改。
料盘到达接驳台后,给服务器发送条码信息,arriveRobotLocation增加barcode参数
20200312
皮带线判断修改
......
......@@ -124,7 +124,7 @@ namespace OnlineStore.DeviceLibrary
CheckAndMove(IO_Type.DLine_Run2, IO_VALUE.LOW);
CheckAndMove(IO_Type.DLine_Run3, IO_VALUE.LOW);
CheckAndMove(IO_Type.SeparateDevice_Run, IO_VALUE.LOW);
if (DeviceID.Equals(302))
if (IsNewType)
{
LogInfo("后退NG气缸,后退扫码NG气缸");
CylinderMove(MoveInfo, IO_Type.NGCylinder_Before, IO_Type.NGCylinder_After);
......@@ -313,7 +313,7 @@ namespace OnlineStore.DeviceLibrary
}
internal bool InStoreNgISBack()
{
if (DeviceID.Equals(302))
if (IsNewType)
{
if (IOValue(IO_Type.NGCylinder_After).Equals(IO_VALUE.HIGH) && IOValue(IO_Type.NGCylinder_Before).Equals(IO_VALUE.LOW))
{
......@@ -437,71 +437,64 @@ namespace OnlineStore.DeviceLibrary
}
private void NewTypeScan(bool isfirst = false)
{
// if (IsNewType)
IsInScanCode = true;
string LastCode = "";
Task.Factory.StartNew(delegate
{
IsInScanCode = true;
string LastCode = "";
//LastCodeList = new List<string
Task.Factory.StartNew(delegate
if (isfirst)
{
if (isfirst)
{
StationInfo_NG = new StationTrayInfo(IO_VALUE.HIGH);
}
else
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);
}
Thread.Sleep(300);
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
IsInScanCode = false;
}
else
{
try
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.LOW);
if (DeviceID.Equals(301))
LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode);
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (LastCodeList.Count <= 0)
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
Thread.Sleep(300);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
IsInScanCode = false;
}
else
{
try
if (LastCodeList.Count <= 0)
{
LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode);
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
if (LastCodeList.Count <= 0)
{
Thread.Sleep(300);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
if (LastCodeList.Count <= 0)
{
Thread.Sleep(300);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
LastCode = SServerManager.ProcessCodeList(LastCodeList);
// Thread.Sleep(5000);
Thread.Sleep(300);
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), Name);
}
catch (Exception ex)
{
LogUtil.error(Name + "扫码错误:" + ex.ToString());
LastCode = SServerManager.ProcessCodeList(LastCodeList);
// Thread.Sleep(5000);
}
finally
catch (Exception ex)
{
LogUtil.error(Name + "扫码错误:" + ex.ToString());
}
finally
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode);
if (DeviceID.Equals(301))
{
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode);
if (DeviceID.Equals(301))
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
IsInScanCode = false;
LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode);
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
}
IsInScanCode = false;
});
}
LogUtil.info(hengyiName + " 扫码工位 : 扫码结束 ," + StationInfo_Scan.ToStr + " IsInScanCode = " + IsInScanCode);
}
}
});
}
protected override void IOTimeOutProcess()
{
......@@ -624,7 +617,7 @@ namespace OnlineStore.DeviceLibrary
}
public void ScanNgForward(LineMoveInfo moveInfo = null)
{
if (DeviceID.Equals(302))
if (IsNewType)
{
if (moveInfo != null)
{
......@@ -637,7 +630,7 @@ namespace OnlineStore.DeviceLibrary
}
public void ScanNgBack(LineMoveInfo moveInfo)
{
if (DeviceID.Equals(302))
if (IsNewType)
{
if (moveInfo != null)
{
......
......@@ -24,6 +24,16 @@ namespace OnlineStore.DeviceLibrary
}
return false;
}
private int GetRobotIndex()
{
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}return robotIndex;
}
#region 是否可移栽料盘
......@@ -109,11 +119,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.DO_03_GetTraySize);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LastWidth = 0;
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
int robotIndex = GetRobotIndex();
string result = SServerManager.GetTraySize(Name, robotIndex, StationInfo_Move.CodeStr, out LastWidth);
LogUtil.info(hengyiName + "出口有料,二维码[" + StationInfo_Move.CodeStr + "] 获取料盘尺寸【" + LastWidth + "】【" + result + "】");
}
......@@ -181,14 +187,9 @@ namespace OnlineStore.DeviceLibrary
{
MoveInfo.NextMoveStep(LineMoveStep.DO_08_CRun);
if (IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.HIGH))
{
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
LogUtil.info(hengyiName + "出口有料,转动接驳台皮带线2000 , 收到SeparateDevice_Check信号,调用arriveRobotLocation=" + robotIndex);
{
int robotIndex = GetRobotIndex();
LogUtil.info(hengyiName + "出口有料,转动接驳台皮带线2000 , 收到SeparateDevice_Check信号,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
}
else
......@@ -274,14 +275,9 @@ namespace OnlineStore.DeviceLibrary
else if (MoveInfo.MoveStep.Equals(LineMoveStep.DON_01_WaitTime))
{
MoveInfo.NextMoveStep(LineMoveStep.DON_03_GetTraySize);
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LastWidth = 0;
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
MoveInfo.WaitList.Add(WaitResultInfo.WaitTime(3000));
LastWidth = 0;
int robotIndex = GetRobotIndex();
string result = SServerManager.GetTraySize(Name, robotIndex, StationInfo_Move.CodeStr, out LastWidth);
LogUtil.info(hengyiName + MoveInfo.SLog + "送料: [" + StationInfo_Move.CodeStr + "] 获取尺寸【" + LastWidth + "】【" + result + "】");
}
......@@ -334,11 +330,7 @@ namespace OnlineStore.DeviceLibrary
MoveInfo.NextMoveStep(LineMoveStep.DON_08_CRun);
if (IOValue(IO_Type.SeparateDevice_Check).Equals(IO_VALUE.HIGH))
{
int robotIndex = 1;
if (DeviceID.Equals(301))
{
robotIndex = 2;
}
int robotIndex = GetRobotIndex();
LogUtil.info(hengyiName + MoveInfo.SLog + "送料,接驳台有料盘,等待2000,调用arriveRobotLocation=" + robotIndex);
SServerManager.arriveRobotLocation(Name, robotIndex, StationInfo_Move.CodeStr);
......
......@@ -495,15 +495,21 @@ namespace OnlineStore.DeviceLibrary
//{
// wait.IsEnd = LineManager.Line.SideWay34HasTray().Equals(false);
//}
if (wait.IsEnd && moveInfo.OneWaitCanEndStep)
if (wait.IsEnd)
{
isOk = true;
break;
if (MoveInfo.OneWaitCanEndStep)
{
isOk = true;
break;
}
}
else if (!moveInfo.OneWaitCanEndStep)
else
{
isOk = false;
break;
if (!MoveInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
if (isOk)
......
......@@ -152,15 +152,21 @@ namespace OnlineStore.DeviceLibrary
{
wait.IsEnd = SwCanUpMove(wait.TargetPosition);
}
if (wait.IsEnd && checkWaitInfo.OneWaitCanEndStep)
if (wait.IsEnd)
{
isOk = true;
break;
if (MoveInfo.OneWaitCanEndStep)
{
isOk = true;
break;
}
}
else if (!checkWaitInfo.OneWaitCanEndStep && wait.IsEnd.Equals(false))
else
{
isOk = false;
break;
if (!MoveInfo.OneWaitCanEndStep)
{
isOk = false;
break;
}
}
}
if (isOk)
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!