| | |
| | | if (trayCode.errCode == 0 && trayCode.result.Length == 80) |
| | | { |
| | | //获取托盘码等信息 读取通道 10、11、12的数据作为托盘码 读取其它通道 重量 叠包等信息 所有数据存入MachineInfo表 |
| | | GetMachineData(pmInfo, trayCode.result); |
| | | string location = ""; |
| | | GetMachineData(pmInfo,ref location, trayCode.result); |
| | | var tray = MongoDBSingleton.Instance.FindOne<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo"); |
| | | if (tray != null && tray.addState == 0) |
| | | { |
| | |
| | | if (trayCode.errCode == 0 && trayCode.result.Length == 95) |
| | | { |
| | | //获取托盘码等信息 读取通道 11、12、13的数据作为托盘码 读取其它通道 重量 叠包等信息 所有数据存入MachineInfo表 |
| | | GetMachineData(pmInfo, trayCode.result, false, "1"); |
| | | |
| | | string flLoc = ""; |
| | | string location = ""; |
| | | GetMachineData(pmInfo,ref location, trayCode.result, false, "1"); |
| | | if (pmInfo.location.Contains("FLZT")) |
| | | { |
| | | flLoc = pmInfo.location; |
| | | pmInfo.location = location; |
| | | } |
| | | |
| | | var tray = MongoDBSingleton.Instance.FindOne<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo"); |
| | | if (tray != null) |
| | | { |
| | |
| | | { |
| | | CMMLog.Info($"物料编码:{tray.materialCode},批次号:{tray.lotNo}"); |
| | | string timeStamp = ProcessHelper.GetTimeStamp(31, 1, 1); |
| | | pmInfo.location = !string.IsNullOrEmpty(flLoc) ? flLoc : pmInfo.location; |
| | | HHAmsExecuteResult req = AMSHelper.CreateTask(DateTime.Now.Ticks.ToString(), pmInfo.location, PlcBit02, "3楼包装取料", 0, tray.trayCode, timeStamp); |
| | | ProcessHelper.deleteInfo(pmInfo.location + "-包装下线"); |
| | | //包装取料卸货完成,设备生产数量加一 |
| | |
| | | if (trayCode.errCode == 0 && trayCode.result.Length == 80) |
| | | { |
| | | //获取托盘码等信息 读取通道 10、11、12的数据作为托盘码 读取其它通道 重量 叠包等信息 所有数据存入MachineInfo表 |
| | | GetMachineData(pmInfo, trayCode.result); |
| | | string location = ""; |
| | | GetMachineData(pmInfo,ref location, trayCode.result); |
| | | var tray = MongoDBSingleton.Instance.FindOne<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo"); |
| | | if (tray != null && tray.addState == 0) |
| | | { |
| | |
| | | if (trayCode.errCode == 0 && trayCode.result.Length == 95) |
| | | { |
| | | //获取托盘码等信息 读取通道 11、12、13的数据作为托盘码 读取其它通道 重量 叠包等信息 所有数据存入MachineInfo表 |
| | | GetMachineData(pmInfo, trayCode.result, false, "2"); |
| | | string flLoc = ""; |
| | | string location = ""; |
| | | GetMachineData(pmInfo,ref location, trayCode.result, false, "2"); |
| | | if (pmInfo.location.Contains("FLZT")) |
| | | { |
| | | flLoc = pmInfo.location; |
| | | pmInfo.location = location; |
| | | } |
| | | var tray = MongoDBSingleton.Instance.FindOne<MachineInfo>(Query.EQ("machineNo", pmInfo.location), "MachineInfo"); |
| | | if (tray != null) |
| | | { |
| | |
| | | { |
| | | CMMLog.Info($"物料编码:{tray.materialCode},批次号:{tray.lotNo}"); |
| | | string timeStamp = ProcessHelper.GetTimeStamp(31, 1, 1); |
| | | pmInfo.location = !string.IsNullOrEmpty(flLoc) ? flLoc : pmInfo.location; |
| | | HHAmsExecuteResult req; |
| | | if (pmInfo.deviceType == "22") |
| | | { |
| | |
| | | /// <param name="info"></param> |
| | | /// <param name="result"></param> |
| | | /// <param name="noPack">true : MES交互方式 false : 无MES交互方式</param> |
| | | private static void GetMachineData(Settings.PlcInfo pmInfo,int[] result ,bool noPack = true,string isOne = "") |
| | | private static void GetMachineData(Settings.PlcInfo pmInfo, ref string loc, int[] result ,bool noPack = true,string isOne = "") |
| | | { |
| | | //Console.WriteLine($"进入数据处理流程!"); |
| | | CMMLog.Info($"进入数据处理流程!"); |
| | |
| | | string empCode = RemoveNull(GetTrayCode(result.Take(5).ToArray()));//员工编码 |
| | | string trayCode = RemoveNull(GetTrayCode(result.Skip(5).Take(3).ToArray()));//托盘码 |
| | | string location = RemoveNull(GetTrayCode(result.Skip(8).Take(1).ToArray()));//设备货位编码 |
| | | loc = location; |
| | | #region 2024-12-30 变更 加入mes生产订单编号 分录ID 变更注释 |
| | | string orderCode = ""; //生产订单编号 |
| | | int fEntryID = 0; //分录ID |