| | |
| | | return msg; |
| | | } |
| | | |
| | | string barcodeNow; |
| | | |
| | | [ProcessMethod("ImageCheck", "ReadBarcode2", "读栏具码", InvokeType.TestInvoke)] |
| | | public ResponseMessage ReadBarcode2(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | |
| | | if (ConfigAOI1.ISupMES) |
| | | { |
| | | //string zword = mqtt.MESForBasketAsync("2", "DS02217", barcode, "1", num.ToString()).Result; |
| | | string zwordstr = Task.Run(() => mqtt.MESForBasketAsync("2", "DS02217", barcode, "1", ConfigAOI1.mesnum2.ToString())).Result; |
| | | |
| | | ConfigAOI1.mesnum2++; |
| | | if (ConfigAOI1.ISokMes) |
| | | if (barcode == barcodeNow) |
| | | { |
| | | Plc1.WriteSingleAddress(1524, 1, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"已强制读栏具码运行设备"); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"重复读码,已强制读栏具码运行设备"); |
| | | } |
| | | else |
| | | { |
| | | try |
| | | string zwordstr = Task.Run(() => mqtt.MESForBasketAsync("2", "DS02217", barcode, "1", ConfigAOI1.mesnum2.ToString())).Result; |
| | | |
| | | ConfigAOI1.mesnum2++; |
| | | if (ConfigAOI1.ISokMes) |
| | | { |
| | | var obj = JsonConvert.DeserializeObject<AutoLineMacQueueBak>(zwordstr); |
| | | if (!string.IsNullOrEmpty(obj.zwoid) && obj.zstatus == "200") |
| | | Plc1.WriteSingleAddress(1524, 1, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"已强制读栏具码运行设备"); |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | ConfigAOI1.zwoid = obj.zwoid; |
| | | Plc1.WriteSingleAddress(1524, 1, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ zwoid获取成功 {obj.zstatus} {obj.zwoid} "); |
| | | } |
| | | else |
| | | { |
| | | try |
| | | var obj = JsonConvert.DeserializeObject<AutoLineMacQueueBak>(zwordstr); |
| | | if (!string.IsNullOrEmpty(obj.zwoid) && obj.zstatus == "200") |
| | | { |
| | | if (zwordstr.Contains("version错误")) |
| | | ConfigAOI1.zwoid = obj.zwoid; |
| | | Plc1.WriteSingleAddress(1524, 1, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ zwoid获取成功 {obj.zstatus} {obj.zwoid} "); |
| | | |
| | | barcodeNow = barcode; |
| | | } |
| | | else |
| | | { |
| | | try |
| | | { |
| | | Regex reg = new Regex("[0-9]+", RegexOptions.IgnoreCase | RegexOptions.Singleline, TimeSpan.FromSeconds(2)); |
| | | MatchCollection matches = reg.Matches(obj.zerrmsg); |
| | | if (matches[0] != null && matches.Count == 3) |
| | | if (zwordstr.Contains("version错误")) |
| | | { |
| | | ConfigAOI1.mesnum2 = int.Parse(matches[0].Value)+1; |
| | | } |
| | | else |
| | | { |
| | | ConfigAOI1.mesnum2 = 0; |
| | | Regex reg = new Regex("[0-9]+", RegexOptions.IgnoreCase | RegexOptions.Singleline, TimeSpan.FromSeconds(2)); |
| | | MatchCollection matches = reg.Matches(obj.zerrmsg); |
| | | if (matches[0] != null && matches.Count == 3) |
| | | { |
| | | ConfigAOI1.mesnum2 = int.Parse(matches[0].Value) + 1; |
| | | } |
| | | else |
| | | { |
| | | ConfigAOI1.mesnum2 = 0; |
| | | } |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | Plc1.WriteSingleAddress(1524, 2, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ zwoid获取失败 {zwordstr} "); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | Plc1.WriteSingleAddress(1524, 2, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Information, $"RabbitMQ zwoid获取失败 {zwordstr} "); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"RabbitMQ zwoid获取异常 返回数据为 {zwordstr},异常错误{ex.GetExceptionMessage()}"); |
| | | } |
| | | } |
| | | catch(Exception ex) |
| | | { |
| | | Plc1.WriteSingleAddress(1524, 2, out _); |
| | | Plc1.WriteSingleAddress(1514, 1, out _); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"RabbitMQ zwoid获取异常 返回数据为 {zwordstr},异常错误{ex.GetExceptionMessage()}"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | else |
| | | { |
| | |
| | | M141Config.numpro = 0; |
| | | } |
| | | M141Config.numpro++; |
| | | if (M141Config.mesnum2 >= 50) |
| | | { |
| | | M141Config.mesnum2 = 0; |
| | | } |
| | | M141Config.mesnum2++; |
| | | var tems = Task.Run(() => mqtt.MESForProduceAsync(pro, M141Config.mesnum2.ToString(), M141Config.numpro, endtray)).Result; |
| | | if (tems == null) |
| | | { |
| | |
| | | else |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Exception, $"产品{pro.PID}数据上传MES失败 {tems}"); |
| | | result = "obj.zerrmsg"; |
| | | result = string.Empty; |
| | | if (obj.zerrmsg.Contains("重复数据")) |
| | | { |
| | | return true; |
| | |
| | | |
| | | Plc3 = invokeDevice as PLCBase; |
| | | |
| | | bool Issuccess = false; |
| | | |
| | | bool Issuccess = false; |
| | | bool Issuccess1 = false; |
| | | |
| | | //LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品信息记录保存触发"); |
| | | |
| | | var plcnum = Plc3.Read(2100, 1, out _); |
| | | |
| | | Issuccess = GetProImformation(plcnum[0]); |
| | | |
| | | |
| | | var plcnum = Plc3.Read(2100, 1, out _); |
| | | var plcnum1 = Plc3.Read(2102, 1, out _); |
| | | //上传MES |
| | | Issuccess = GetProImformation(plcnum[0]); |
| | | Issuccess1 = GetProImformation(plcnum1[0]); |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品信息记录保存触发 获取PLC序号{plcnum[0]}和{plcnum1[0]}"); |
| | |
| | | |
| | | private bool GetProImformation(int PLC_order) |
| | | { |
| | | bool reasult = false; |
| | | if (PLC_order == 0) |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"PLC反馈机械手吸盘无产品"); |
| | |
| | | var plist = mysqlhelper.GetProductList(PLC_order + "_1"); |
| | | if (plist != null) |
| | | { |
| | | if (!M141Config.Productioncode.Any(u => u.PID == plist[0].PID)) |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | //正常上传 |
| | | reasult = UptoMES(newp, "N", out tary_ID); |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | int num = M141Config.Productioncode.Count + 1; |
| | | M141Config.Productioncode.Add(new ProductionID |
| | | M141Config.MES_codes.Add(new MES_code |
| | | { |
| | | Uptomesid = num, |
| | | PID = plist[0].PID, |
| | | SEQUENCE = plist[0].SEQUENCE, |
| | | BasketCode = plist[0].BasketCode, |
| | | Zword = plist[0].Zword, |
| | | //newp.Result = "OK"; |
| | | SN = plist[0].SN |
| | | Printers_code = tary_ID |
| | | }); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{plist[0].PID}数据记录成功"); |
| | | return true; |
| | | } |
| | | else |
| | | { |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"产品{plist[0].PID}数据重复,记录失败"); |
| | | return false; |
| | | } |
| | | //isStartclear = true; |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"MES上传产品{plist[0].PID}时获取到条码{tary_ID}"); |
| | | } |
| | | return reasult; |
| | | //if (!M141Config.Productioncode.Any(u => u.PID == plist[0].PID)) |
| | | //{ |
| | | // int num = M141Config.Productioncode.Count + 1; |
| | | // M141Config.Productioncode.Add(new ProductionID |
| | | // { |
| | | // Uptomesid = num, |
| | | // PID = plist[0].PID, |
| | | // SEQUENCE = plist[0].SEQUENCE, |
| | | // BasketCode = plist[0].BasketCode, |
| | | // Zword = plist[0].Zword, |
| | | // //newp.Result = "OK"; |
| | | // SN = plist[0].SN |
| | | // }); |
| | | // LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{plist[0].PID}数据记录成功"); |
| | | // return true; |
| | | //} |
| | | //else |
| | | //{ |
| | | // LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"产品{plist[0].PID}数据重复,记录失败"); |
| | | // return false; |
| | | //} |
| | | } |
| | | else |
| | | { |
| | |
| | | |
| | | } |
| | | |
| | | ///// <summary> |
| | | ///// 产品零盘上传启动标识 |
| | | ///// </summary> |
| | | //private bool isStartclear =false; |
| | | |
| | | [ProcessMethod("", "MEStogetcode", "MES上传整批数据并获取条码", InvokeType.TestInvoke)] |
| | | public ResponseMessage MEStogetcode(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | bool Issuccess = false; |
| | | bool Issuccess1 = false; |
| | | |
| | | // LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品信息上传mes触发"); |
| | | var plcnum = Plc3.Read(2100, 1, out _); |
| | | Issuccess = GetProImformation(plcnum[0]); |
| | | |
| | | var plcnum = Plc3.Read(2100, 1, out _); |
| | | var plcnum1 = Plc3.Read(2102, 1, out _); |
| | | Issuccess1 = GetProImformation(plcnum1[0]); |
| | | |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品信息上传mes触发,获取PLC序号{plcnum[0]}和{plcnum1[0]}"); |
| | | |
| | | string saveTary_ID=string.Empty; |
| | | |
| | | //if (!Issuccess && !Issuccess1) |
| | | //{ |
| | | // Plc3.WriteSingleAddress(2120, 2, out _); |
| | | // return msg; |
| | | //} |
| | | |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品信息上传MES触发,产品信息数量为:{M141Config.Productioncode.Count}"); |
| | | |
| | | if (M141Config.Productioncode.Count == 50) |
| | | { |
| | | //产品正常上传 |
| | | while (M141Config.Productioncode.Count>0) |
| | | { |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = M141Config.Productioncode[0].SEQUENCE; |
| | | newp.PID = M141Config.Productioncode[0].PID; |
| | | newp.BasketCode = M141Config.Productioncode[0].BasketCode; |
| | | newp.Zword = M141Config.Productioncode[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = M141Config.Productioncode[0].SN; |
| | | string tary_ID = string.Empty; |
| | | bool isok = UptoMES(newp, "N", out tary_ID); |
| | | if (!isok) |
| | | { |
| | | Plc3.WriteSingleAddress(2120, 2, out _); |
| | | return msg; |
| | | } |
| | | if (M141Config.Isprint && !string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | saveTary_ID = tary_ID; |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Add(new MES_code |
| | | { |
| | | Printers_code = tary_ID |
| | | }); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | } |
| | | M141Config.Productioncode.RemoveAt(0); |
| | | } |
| | | M141Config.Productioncode.Clear(); |
| | | } |
| | | else if (M141Config.Productioncode.Count > 50) |
| | | if (plcnum[0] != 0 && plcnum1[0] != 0) |
| | | { |
| | | //中途有产品被取走 |
| | | for (int i = 0; i < 50; i++) |
| | | //正常上传一片产品 |
| | | Issuccess = GetProImformation(plcnum[0]); |
| | | //最后一片产品判断是否需要上传尾盘零数 |
| | | if (M141Config.MES_codes.Count>0) |
| | | { |
| | | //需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum1[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | int count = M141Config.Productioncode.Count; |
| | | newp.SEQUENCE = M141Config.Productioncode[count - 1].SEQUENCE; |
| | | newp.PID = M141Config.Productioncode[count - 1].PID; |
| | | newp.BasketCode = M141Config.Productioncode[count - 1].BasketCode; |
| | | newp.Zword = M141Config.Productioncode[count - 1].Zword; |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = M141Config.Productioncode[count - 1].SN; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | bool isok = UptoMES(newp, "N", out tary_ID); |
| | | if (!isok) |
| | | { |
| | | Plc3.WriteSingleAddress(2120, 2, out _); |
| | | return msg; |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "Y", out tary_ID); |
| | | |
| | | } |
| | | if (M141Config.Isprint && !string.IsNullOrEmpty(tary_ID)) |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | saveTary_ID = tary_ID; |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Add(new MES_code |
| | | { |
| | | Printers_code = tary_ID |
| | | }); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}零盘尾数已触发S6打印并且保存"); |
| | | M141Config.mesnum2 = 0; |
| | | } |
| | | M141Config.Productioncode.RemoveAt(count - 1); |
| | | |
| | | } |
| | | M141Config.Productioncode.Clear(); |
| | | } |
| | | else if (M141Config.Productioncode.Count > 0 && M141Config.Productioncode.Count < 50) |
| | | { |
| | | //产品缺少需要额外的条码补救 |
| | | while (M141Config.Productioncode.Count > 0) |
| | | else |
| | | { |
| | | //不需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum1[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = M141Config.Productioncode[0].SEQUENCE; |
| | | newp.PID = M141Config.Productioncode[0].PID; |
| | | newp.BasketCode = M141Config.Productioncode[0].BasketCode; |
| | | newp.Zword = M141Config.Productioncode[0].Zword; |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = M141Config.Productioncode[0].SN; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | bool isok = false; |
| | | |
| | | if (M141Config.Productioncode.Count==1) |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "N", out tary_ID); |
| | | |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | isok = UptoMES(newp, "Y", out tary_ID); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"产品{newp.PID}触发零数尾盘"); |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | } |
| | | else |
| | | { |
| | | isok = UptoMES(newp, "N", out tary_ID); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | } |
| | | if (!isok) |
| | | } |
| | | } |
| | | else if (plcnum1[0] == 0 && plcnum[0] != 0) |
| | | { |
| | | Issuccess =true; |
| | | if (M141Config.MES_codes.Count > 0) |
| | | { |
| | | //需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "Y", out tary_ID); |
| | | |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | Plc3.WriteSingleAddress(2120, 2, out _); |
| | | return msg; |
| | | } |
| | | if (M141Config.Isprint && !string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | saveTary_ID = tary_ID; |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Add(new MES_code |
| | | { |
| | | Printers_code = tary_ID |
| | | }); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}零盘尾数已触发S6打印并且保存"); |
| | | M141Config.mesnum2 = 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //不需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "N", out tary_ID); |
| | | |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | } |
| | | M141Config.Productioncode.RemoveAt(0); |
| | | } |
| | | M141Config.Productioncode.Clear(); |
| | | } |
| | | else if (M141Config.Productioncode.Count == 0) |
| | | else if(plcnum[0] == 0 && plcnum1[0] != 0) |
| | | { |
| | | if (M141Config.Isprint && !string.IsNullOrEmpty(saveTary_ID)) |
| | | Issuccess = true; |
| | | if (M141Config.MES_codes.Count > 0) |
| | | { |
| | | StartPrint(saveTary_ID, "Honeywell PX240S (300 dpi)"); |
| | | } |
| | | //需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum1[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "Y", out tary_ID); |
| | | |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}零盘尾数已触发S6打印并且保存"); |
| | | M141Config.mesnum2 = 0; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | //不需要上传尾盘 |
| | | var plist = mysqlhelper.GetProductList(plcnum1[0] + "_1"); |
| | | ProductModel newp = new ProductModel(); |
| | | newp.SEQUENCE = plist[0].SEQUENCE; |
| | | newp.PID = plist[0].PID; |
| | | newp.BasketCode = plist[0].BasketCode; |
| | | newp.Zword = plist[0].Zword; |
| | | newp.Result = "OK"; |
| | | newp.SN = plist[0].SN; |
| | | string tary_ID = string.Empty; |
| | | //正常上传 |
| | | Issuccess1 = UptoMES(newp, "N", out tary_ID); |
| | | |
| | | if (!string.IsNullOrEmpty(tary_ID)) |
| | | { |
| | | StartPrint(tary_ID, "Honeywell PX240S (300 dpi)"); |
| | | M141Config.MES_codes.Clear(); |
| | | LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"条码:{tary_ID}已触发S6打印并且保存"); |
| | | |
| | | } |
| | | } |
| | | } |
| | | //if (Issuccess && Issuccess1) |
| | | //{ |
| | | Plc3.WriteSingleAddress(2120, 1, out _); |
| | | return msg; |
| | | //} |
| | | //else |
| | | //{ |
| | | // Plc3.WriteSingleAddress(2120, 2, out _); |
| | | // return msg; |
| | | //} |
| | | |
| | | |
| | | if (Issuccess && Issuccess1) |
| | | { |
| | | Plc3.WriteSingleAddress(2120, 1, out _); |
| | | } |
| | | else |
| | | { |
| | | Plc3.WriteSingleAddress(2120, 2, out _); |
| | | } |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | [ProcessMethod("", "MESup1", "MES上传进料口空篮", InvokeType.TestInvoke)] |