| | |
| | | { |
| | | LogHelper.Info("即产即用工单"); |
| | | //即产即用在起点为线边 |
| | | var bcpInfo = Settings.areaInfos.Where(a => a.areaName == "瓶胚即产满框" && a.enable == 1).FirstOrDefault(); |
| | | var bcpInfo = Settings.areaInfos.Where(a => a.areaName == "瓶坯即产满框" && a.enable == 1).FirstOrDefault(); |
| | | if (bcpInfo != null) |
| | | { |
| | | startArea = bcpInfo.areaCode; |
| | |
| | | { |
| | | LogHelper.Info("非即产即用工单"); |
| | | //非即产即用起点为库区 |
| | | string areaName = plc.deviceName.Split('-')[1].Substring(0, 1) + "号瓶胚翻斗机非即产满框"; |
| | | string areaName = plc.deviceName.Split('-')[1].Substring(0, 1) + "号瓶坯翻斗机非即产满框"; |
| | | var bcpInfo = Settings.areaInfos.Where(a => a.areaName == areaName && a.enable == 1).FirstOrDefault(); |
| | | if (bcpInfo != null) |
| | | { |
| | |
| | | |
| | | if (data.Length == 6) |
| | | { |
| | | if (data.Substring(0, 2) == "11") |
| | | if (data.Substring(2, 2) == "22") |
| | | { |
| | | if (LocationHelper.CheckLocFree(plc.TN_Location[0])) |
| | | { |
| | |
| | | //初始状态,无托盘,直接上满托(非即产即用需要校验 套袋完成,即产即用直接使用) |
| | | if (workInfo.S_UsingNow == "Y") |
| | | { |
| | | LogHelper.Info($"瓶胚即产满框 查找"); |
| | | LogHelper.Info($"瓶坯即产满框 查找"); |
| | | startLoca = getFDSXArea(db, workInfo, startArea); |
| | | } |
| | | else |
| | | { |
| | | LogHelper.Info($"瓶胚翻斗机非即产满框 查找"); |
| | | LogHelper.Info($"瓶坯翻斗机非即产满框 查找"); |
| | | startLoca = getFDSXArea(db, workInfo, startArea); |
| | | } |
| | | |
| | |
| | | |
| | | if (data.Length == 6) |
| | | { |
| | | if (data.Substring(0, 2) == "11") |
| | | if (data.Substring(2, 2) == "22") |
| | | { |
| | | if (LocationHelper.CheckLocFree(plc.TN_Location[0])) |
| | | { |
| | |
| | | taskType = "注塑库存满托下线(瓶坯)"; |
| | | } |
| | | //endArea = Settings.GetLinJiangBCPAreaList().Where(a => a.AreaName == "瓶坯满托" && a.Enable == "1").FirstOrDefault().AreaNo; |
| | | if (data.Length == 4) |
| | | if (data.Length == 8) |
| | | { |
| | | if (data == "1122") LinZhialysisBottleCapAndPreformTwo(plc, db, workInfo, endArea, taskType, plc.TN_Location[0], "瓶坯机"); |
| | | if (data.Substring(0,2) == "12") LinZhialysisBottleCapAndPreformTwo(plc, db, workInfo, endArea, taskType, plc.TN_Location[0], "瓶坯机"); |
| | | |
| | | if (data == "1221") LinZhialysisBottleCapAndPreformTwo(plc, db, workInfo, endArea, taskType, plc.TN_Location[1], "瓶坯机"); |
| | | if (data.Substring(2,2) == "22") LinZhialysisBottleCapAndPreformTwo(plc, db, workInfo, endArea, taskType, plc.TN_Location[1], "瓶坯机"); |
| | | } |
| | | } |
| | | else LogHelper.Info($"瓶坯机:{plc.deviceName} 未开启工单,不可触发满托下线", "瓶坯机"); |
| | |
| | | if (mst.S_TYPE.Contains("翻斗机")) |
| | | { |
| | | LogHelper.Info($"查询翻斗机允许取空信号 允许取空信号={LineState[mst.S_START_LOC.Trim()].status} 时间间隔={DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds}", "安全交互"); |
| | | if ((LineState[mst.S_START_LOC.Trim()].status == "112100" || LineState[mst.S_START_LOC.Trim()].status == "112200") && DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds < 10) |
| | | if (LineState[mst.S_START_LOC.Trim()].status.Substring(4,2) == "00" && DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds < 10) |
| | | { |
| | | //NDCHelper.ChangeParam(mst.S_CODE.Trim(), 1101, 18); |
| | | NDCApi.ChangeOrderParam(mst.S_CODE.Trim(), 18, "1101"); |
| | |
| | | LogHelper.Info($"查询输送线允许取满信号 允许取满信号={LineState[mst.S_START_LOC.Trim()].status} 时间间隔={DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds}", "安全交互"); |
| | | if (mst.S_TYPE.Contains("满托下线")) |
| | | { |
| | | if ((LineState[mst.S_START_LOC.Trim()].status.Substring(4,2) == "01" || LineState[mst.S_START_LOC.Trim()].status.Substring(6,2) == "02") && DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds < 10) |
| | | if ((LineState[mst.S_START_LOC.Trim()].status.Substring(4,2) == "00" || LineState[mst.S_START_LOC.Trim()].status.Substring(4,2) == "02") && DateTime.Now.Subtract(LineState[mst.S_START_LOC.Trim()].modify).TotalSeconds < 10) |
| | | { |
| | | //NDCHelper.ChangeParam(mst.S_CODE.Trim(), 1101, 18); |
| | | NDCApi.ChangeOrderParam(mst.S_CODE.Trim(), 18, "1101"); |
| | |
| | | TaskProcess.sendSing(mst, 1101); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | else LogHelper.Info($"字典中未找到该key的数据,key:{mst.S_START_LOC}"); |
| | |
| | | if (mst.S_TYPE.Contains("翻斗机")) |
| | | { |
| | | LogHelper.Info($"查询翻斗机允许上满信号 允许上满信号={LineState[mst.S_END_LOC.Trim()].status} 时间间隔={DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds}", "安全交互"); |
| | | if ((LineState[mst.S_END_LOC.Trim()].status == "112100" || LineState[mst.S_END_LOC.Trim()].status == "112200") && DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds < 10) |
| | | if (LineState[mst.S_END_LOC.Trim()].status.Substring(4,2) == "00" && DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds < 10) |
| | | { |
| | | //NDCHelper.ChangeParam(mst.S_CODE.Trim(), 1103, 18); |
| | | NDCApi.ChangeOrderParam(mst.S_CODE.Trim(), 18, "1103"); |
| | |
| | | LogHelper.Info($"查询输送线允许补空信号 允许补空信号={LineState[mst.S_END_LOC.Trim()].status} 时间间隔={DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds}", "安全交互"); |
| | | if (mst.S_TYPE.Contains("空托上线")) |
| | | { |
| | | if ((LineState[mst.S_END_LOC.Trim()].status.Substring(4,2) == "01" || LineState[mst.S_END_LOC.Trim()].status.Substring(6,2) == "02") && DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds < 10) |
| | | if ((LineState[mst.S_END_LOC.Trim()].status.Substring(4,2) == "00" || LineState[mst.S_END_LOC.Trim()].status.Substring(4,2) == "02") && DateTime.Now.Subtract(LineState[mst.S_END_LOC.Trim()].modify).TotalSeconds < 10) |
| | | { |
| | | //NDCHelper.ChangeParam(mst.S_CODE.Trim(), 1103, 18); |
| | | NDCApi.ChangeOrderParam(mst.S_CODE.Trim(), 18, "1103"); |