Commit 6a892985 LN

皮带线每次都扫码

1 个父辈 501ace35
...@@ -53,8 +53,8 @@ namespace OnlineStore.AssemblyLine ...@@ -53,8 +53,8 @@ namespace OnlineStore.AssemblyLine
/// </summary> /// </summary>
[STAThread] [STAThread]
static void Main(string[] Args) static void Main(string[] Args)
{ {
//string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600"; //string code = " (X: 380,Y: 148) L00000000000WG9D19055;E20191230 0180;B7H.10618.5B1008082019123004000;R0080820191230E9600";
//string r = CodeManager.ReplaceCode(code); //string r = CodeManager.ReplaceCode(code);
Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException); Application.SetUnhandledExceptionMode(UnhandledExceptionMode.CatchException);
......
...@@ -519,12 +519,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -519,12 +519,15 @@ namespace OnlineStore.DeviceLibrary
} }
Thread.Sleep(300); Thread.Sleep(300);
if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW)) if (IOValue(IO_Type.ExitTray_Check3).Equals(IO_VALUE.LOW))
{ {
StationInfo_Scan = new StationTrayInfo(IO_VALUE.LOW); UpdateScanInfo(IO_VALUE.LOW,"");
if (DeviceID.Equals(301)) List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), hengyiName, true);
LastCode = SServerManager.ProcessCodeList(LastCodeList);
if (LastCodeList.Count > 0)
{ {
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr); UpdateScanInfo(IO_VALUE.HIGH, LastCode);
} }
IsInScanCode = false; IsInScanCode = false;
} }
else else
...@@ -532,12 +535,12 @@ namespace OnlineStore.DeviceLibrary ...@@ -532,12 +535,12 @@ namespace OnlineStore.DeviceLibrary
try try
{ {
LastCode = ""; LastCode = "";
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode); // StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode);
UpdateScanInfo(IO_VALUE.HIGH, LastCode);
if (DeviceID.Equals(301)) if (DeviceID.Equals(301))
{ {
if (Line3LastTrayP > Line3MaxPosition) { Line3LastTrayP = Line3MaxPosition; } if (Line3LastTrayP > Line3MaxPosition) { Line3LastTrayP = Line3MaxPosition; }
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr); // StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
} }
else else
{ {
...@@ -547,24 +550,20 @@ namespace OnlineStore.DeviceLibrary ...@@ -547,24 +550,20 @@ namespace OnlineStore.DeviceLibrary
} }
} }
LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode); LogUtil.info(hengyiName + "扫码工位:开始扫码,IsInScanCode=" + IsInScanCode);
List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), hengyiName,true); List<string> LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), hengyiName, true);
if (LastCodeList.Count <= 0) if (LastCodeList.Count <= 0)
{ {
LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), hengyiName,true); LastCodeList = CodeManager.CameraScan(Config.GetCameraList(), hengyiName, true);
}
LastCode = SServerManager.ProcessCodeList(LastCodeList);
} }
LastCode = SServerManager.ProcessCodeList(LastCodeList);
}
catch (Exception ex) catch (Exception ex)
{ {
LogUtil.error(Name + "扫码错误:" + ex.ToString()); LogUtil.error(Name + "扫码错误:" + ex.ToString());
} }
finally finally
{ {
StationInfo_Scan = new StationTrayInfo(IO_VALUE.HIGH, LastCode); UpdateScanInfo(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);
...@@ -572,6 +571,15 @@ namespace OnlineStore.DeviceLibrary ...@@ -572,6 +571,15 @@ namespace OnlineStore.DeviceLibrary
} }
}); });
} }
private void UpdateScanInfo(IO_VALUE value,string code)
{
StationInfo_Scan = new StationTrayInfo(value,code);
if (DeviceID.Equals(301))
{
StationInfo_NG = new StationTrayInfo(StationInfo_Scan.TrayValue, StationInfo_Scan.CodeStr);
}
}
protected override void IOTimeOutProcess() protected override void IOTimeOutProcess()
{ {
try try
......
...@@ -13,8 +13,9 @@ namespace OnlineStore.DeviceLibrary ...@@ -13,8 +13,9 @@ namespace OnlineStore.DeviceLibrary
#region 出料流程 #region 出料流程
private int OutStoreHeight = -1; private int OutStoreHeight = -1;
private int OutStoreCount = -1; private int OutStoreCount = -1;
private TaskData taskData = null; private TaskData taskData = null;
private InOutParam LastOutParam = new InOutParam(); private InOutParam LastOutParam = new InOutParam();
private bool NeedCheckShelf = true ;
internal bool CanStartCheckOut(int trayNum) internal bool CanStartCheckOut(int trayNum)
{ {
...@@ -292,8 +293,10 @@ namespace OnlineStore.DeviceLibrary ...@@ -292,8 +293,10 @@ namespace OnlineStore.DeviceLibrary
//判断是否是第一次获取料架,需要从服务器获取此料架的虚拟料架号,若无虚拟料架号,料架可以用 //判断是否是第一次获取料架,需要从服务器获取此料架的虚拟料架号,若无虚拟料架号,料架可以用
//有虚拟料架号,从服务器获取此料架剩余任务,若无任务,需要送出料架 //有虚拟料架号,从服务器获取此料架剩余任务,若无任务,需要送出料架
if (LastOutParam.rfid.Equals("")) if (LastOutParam.rfid.Equals("") && NeedCheckShelf)
{ {
//只有启动后第一个料架才需要验证
NeedCheckShelf = false;
string tempRfid = ""; string tempRfid = "";
string msg = SServerManager.findTempRfid(Name, CurrShelfId, out tempRfid); string msg = SServerManager.findTempRfid(Name, CurrShelfId, out tempRfid);
if (!String.IsNullOrEmpty(msg)) if (!String.IsNullOrEmpty(msg))
...@@ -307,7 +310,7 @@ namespace OnlineStore.DeviceLibrary ...@@ -307,7 +310,7 @@ namespace OnlineStore.DeviceLibrary
return; return;
} }
} }
//定位工位有料架,直接开始入料 //定位工位有料架,直接开始入料
MoveInfo.NextMoveStep(LineMoveStep.FO_05_LocationUp); MoveInfo.NextMoveStep(LineMoveStep.FO_05_LocationUp);
OutLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡下降, 定位气缸上升,读取料架号"); OutLog("定位工位检测到料架: " + MoveInfo.SLog + " 缓冲阻挡下降, 定位气缸上升,读取料架号");
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!