Commit 6a892985 LN

皮带线每次都扫码

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