diff --git a/MaterialTraceability.Business/Impl/MQSignalReadBusiness.cs b/MaterialTraceability.Business/Impl/MQSignalReadBusiness.cs index aa1ba1c..bdfbcb7 100644 --- a/MaterialTraceability.Business/Impl/MQSignalReadBusiness.cs +++ b/MaterialTraceability.Business/Impl/MQSignalReadBusiness.cs @@ -95,13 +95,13 @@ namespace MaterialTraceability.Business.Impl //判断放卷生产轴 if (appConfig.machineId == 3) { - if (PlcBusiness.readPlc("MW24816") == 1) upPosition = 6; - if (PlcBusiness.readPlc("MW24818") == 1) upPosition = 5; + if (PlcBusiness.readPlc(appConfig.mqAddress.左放卷状态) == 1) upPosition = 6; + if (PlcBusiness.readPlc(appConfig.mqAddress.右放卷状态) == 1) upPosition = 5; } else { - if (PlcBusiness.readPlc("MW24816") == 1) upPosition = 5; - if (PlcBusiness.readPlc("MW24818") == 1) upPosition = 6; + if (PlcBusiness.readPlc(appConfig.mqAddress.左放卷状态) == 1) upPosition = 5; + if (PlcBusiness.readPlc(appConfig.mqAddress.右放卷状态) == 1) upPosition = 6; } LogHelper.Info("当前放卷生产轴为:" + Which(upPosition)); ProShaftInfo shaftInfo = this.GetShaftInfoByPosition(upPosition).Result; @@ -125,17 +125,17 @@ namespace MaterialTraceability.Business.Impl //判断收卷生产轴 if (appConfig.machineId == 3) { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(4); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(2); } else { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(2); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(4); } if (positions.Count == 0) @@ -155,7 +155,7 @@ namespace MaterialTraceability.Business.Impl if (info) { LogHelper.Info("触发合卷报警,下发PLC报警指令写入2"); - plcBusiness.writeDoublePlc("MW24624", 2); + plcBusiness.writeDoublePlc(appConfig.mqAddress.全局报警, 2); return; } @@ -529,17 +529,17 @@ namespace MaterialTraceability.Business.Impl //EA新地址 Add by wenjy 2022-11-10 if (appConfig.machineId == 3) { - if (position == 3) qty = PlcBusiness.readPlc("MW25928"); - if (position == 1) qty = PlcBusiness.readPlc("MW25930"); - if (position == 4) qty = PlcBusiness.readPlc("MW25932"); - if (position == 2) qty = PlcBusiness.readPlc("MW25934"); + if (position == 3) qty = PlcBusiness.readPlc(appConfig.mqAddress.上左收卷EA); + if (position == 1) qty = PlcBusiness.readPlc(appConfig.mqAddress.上右收卷EA); + if (position == 4) qty = PlcBusiness.readPlc(appConfig.mqAddress.下左收卷EA); + if (position == 2) qty = PlcBusiness.readPlc(appConfig.mqAddress.下右收卷EA); } else { - if (position == 1) qty = PlcBusiness.readPlc("MW25928"); - if (position == 3) qty = PlcBusiness.readPlc("MW25930"); - if (position == 2) qty = PlcBusiness.readPlc("MW25932"); - if (position == 4) qty = PlcBusiness.readPlc("MW25934"); + if (position == 1) qty = PlcBusiness.readPlc(appConfig.mqAddress.上左收卷EA); + if (position == 3) qty = PlcBusiness.readPlc(appConfig.mqAddress.上右收卷EA); + if (position == 2) qty = PlcBusiness.readPlc(appConfig.mqAddress.下左收卷EA); + if (position == 4) qty = PlcBusiness.readPlc(appConfig.mqAddress.下右收卷EA); } LogRefreshEvent.Invoke(LogType.PlcLog, String.Format("{0}轴读取设备EA值:{1}", logStr, qty)); @@ -554,7 +554,7 @@ namespace MaterialTraceability.Business.Impl LogHelper.Info(logStr + "获取设备EA为:" + qty + "绑定信息为:" + shaftInfo.bindEaValue + ",不进行完工处理"); //upLoadBusiness.SaveLogRecord(position, logStr + "获取设备EA为:" + qty + "绑定信息为:" + shaftInfo.bindEaValue + ",不进行完工处理"); AllowBlank(position); - plcBusiness.writeDoublePlc("MW24624", 0);//清除合卷报警 + plcBusiness.writeDoublePlc(appConfig.mqAddress.全局报警, 0);//清除合卷报警 //清空卷轴绑定的物料信息 shaftInfo.bindRfid = ""; @@ -794,8 +794,7 @@ namespace MaterialTraceability.Business.Impl }); LogHelper.Info(logStr + "下料成功解除合卷报警限制,MW24624写0"); - //upLoadBusiness.SaveLogRecord(position, logStr + "下料成功解除合卷报警限制,MW24624写0"); - plcBusiness.writeDoublePlc("MW24624", 0); + plcBusiness.writeDoublePlc(appConfig.mqAddress.全局报警, 0); //更新下料记录 //downRecord.DownMaterialId = shaftInfo.bindRfid; @@ -1628,66 +1627,66 @@ namespace MaterialTraceability.Business.Impl { if (position == 1) { - plcBusiness.writePlc("MW24652", result); - plcBusiness.writePlc("MW24656", alarm); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷报警, alarm); } if (position == 2) { - plcBusiness.writePlc("MW24668", result); - plcBusiness.writePlc("MW24672", alarm); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷报警, alarm); } if (position == 3) { - plcBusiness.writePlc("MW24644", result); - plcBusiness.writePlc("MW24648", alarm); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷报警, alarm); } if (position == 4) { - plcBusiness.writePlc("MW24660", result); - plcBusiness.writePlc("MW24664", alarm); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷报警, alarm); } if (position == 5) { - plcBusiness.writePlc("MW24636", result); //RFID扫描结果 - plcBusiness.writePlc("MW24640", alarm); //RFID报警信息 + plcBusiness.writePlc(appConfig.mqAddress.右放卷读取结果, result); //RFID扫描结果 + plcBusiness.writePlc(appConfig.mqAddress.右放卷报警, alarm); //RFID报警信息 } if (position == 6) { - plcBusiness.writePlc("MW24628", result); - plcBusiness.writePlc("MW24632", alarm); + plcBusiness.writePlc(appConfig.mqAddress.左放卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.左放卷报警, alarm); } } else { if (position == 3) { - plcBusiness.writePlc("MW24652", result); - plcBusiness.writePlc("MW24656", alarm); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷报警, alarm); } if (position == 4) { - plcBusiness.writePlc("MW24668", result); - plcBusiness.writePlc("MW24672", alarm); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷报警, alarm); } if (position == 1) { - plcBusiness.writePlc("MW24644", result); - plcBusiness.writePlc("MW24648", alarm); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷报警, alarm); } if (position == 2) { - plcBusiness.writePlc("MW24660", result); - plcBusiness.writePlc("MW24664", alarm); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷报警, alarm); } if (position == 5) { - plcBusiness.writePlc("MW24628", result); - plcBusiness.writePlc("MW24632", alarm); //RFID报警信息 + plcBusiness.writePlc(appConfig.mqAddress.左放卷读取结果, result); + plcBusiness.writePlc(appConfig.mqAddress.左放卷报警, alarm); //RFID报警信息 } if (position == 6) { - plcBusiness.writePlc("MW24636", result); //RFID扫描结果 - plcBusiness.writePlc("MW24640", alarm); + plcBusiness.writePlc(appConfig.mqAddress.右放卷读取结果, result); //RFID扫描结果 + plcBusiness.writePlc(appConfig.mqAddress.右放卷报警, alarm); } } } @@ -1703,54 +1702,54 @@ namespace MaterialTraceability.Business.Impl { if (position == 1) { - plcBusiness.writePlc("MW24652", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷读取结果, 1); } if (position == 2) { - plcBusiness.writePlc("MW24668", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷读取结果, 1); } if (position == 3) { - plcBusiness.writePlc("MW24644", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷读取结果, 1); } if (position == 4) { - plcBusiness.writePlc("MW24660", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷读取结果, 1); } if (position == 5) { - plcBusiness.writePlc("MW24636", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷读取结果, 1); } if (position == 6) { - plcBusiness.writePlc("MW24628", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷读取结果, 1); } } else { if (position == 3) { - plcBusiness.writePlc("MW24652", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷读取结果, 1); } if (position == 4) { - plcBusiness.writePlc("MW24668", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷读取结果, 1); } if (position == 1) { - plcBusiness.writePlc("MW24644", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷读取结果, 1); } if (position == 2) { - plcBusiness.writePlc("MW24660", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷读取结果, 1); } if (position == 5) { - plcBusiness.writePlc("MW24628", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷读取结果, 1); } if (position == 6) { - plcBusiness.writePlc("MW24636", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷读取结果, 1); } } @@ -1765,33 +1764,33 @@ namespace MaterialTraceability.Business.Impl if (appConfig.machineId==3) { if (position == 1) - plcBusiness.writePlc("MW24826", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷下料, 1); if (position == 2) - plcBusiness.writePlc("MW24830", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷下料, 1); if (position == 3) - plcBusiness.writePlc("MW24824", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷下料, 1); if (position == 4) - plcBusiness.writePlc("MW24828", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷下料, 1); if (position == 5) - plcBusiness.writePlc("MW24822", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷下料, 1); if (position == 6) - plcBusiness.writePlc("MW24820", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷下料, 1); } else { if (position == 1) - plcBusiness.writePlc("MW24824", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷下料, 1); if (position == 2) - plcBusiness.writePlc("MW24828", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷下料, 1); if (position == 3) - plcBusiness.writePlc("MW24826", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷下料, 1); if (position == 4) - plcBusiness.writePlc("MW24830", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷下料, 1); if (position == 5) - plcBusiness.writePlc("MW24820", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷下料, 1); if (position == 6) - plcBusiness.writePlc("MW24822", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷下料, 1); } } @@ -1805,33 +1804,33 @@ namespace MaterialTraceability.Business.Impl { if (position == 3) - plcBusiness.writePlc("MW24824", 0); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷下料, 0); if (position == 1) - plcBusiness.writePlc("MW24826", 0); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷下料, 0); if (position == 4) - plcBusiness.writePlc("MW24828", 0); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷下料, 0); if (position == 2) - plcBusiness.writePlc("MW24830", 0); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷下料, 0); if (position == 5) - plcBusiness.writePlc("MW24822", 0); + plcBusiness.writePlc(appConfig.mqAddress.右放卷下料, 0); if (position == 6) - plcBusiness.writePlc("MW24820", 0); + plcBusiness.writePlc(appConfig.mqAddress.左放卷下料, 0); } else { if (position == 1) - plcBusiness.writePlc("MW24824", 0); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷下料, 0); if (position == 3) - plcBusiness.writePlc("MW24826", 0); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷下料, 0); if (position == 2) - plcBusiness.writePlc("MW24828", 0); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷下料, 0); if (position == 4) - plcBusiness.writePlc("MW24830", 0); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷下料, 0); if (position == 5) - plcBusiness.writePlc("MW24820", 0); + plcBusiness.writePlc(appConfig.mqAddress.左放卷下料, 0); if (position == 6) - plcBusiness.writePlc("MW24822", 0); + plcBusiness.writePlc(appConfig.mqAddress.右放卷下料, 0); } } @@ -1876,32 +1875,32 @@ namespace MaterialTraceability.Business.Impl if (appConfig.machineId==3) { if (position == 3) - PLCaddress = "MW24848"; + PLCaddress = appConfig.mqAddress.上左收卷SFC; if (position == 1) - PLCaddress = "MW24850"; + PLCaddress = appConfig.mqAddress.上右收卷SFC; if (position == 4) - PLCaddress = "MW24852"; + PLCaddress = appConfig.mqAddress.下左收卷SFC; if (position == 2) - PLCaddress = "MW24854"; + PLCaddress = appConfig.mqAddress.下右收卷SFC; if (position == 5) - PLCaddress = "MW24846"; + PLCaddress = appConfig.mqAddress.右放卷SFC; if (position == 6) - PLCaddress = "MW248544"; + PLCaddress = appConfig.mqAddress.左放卷SFC; } else { if (position == 1) - PLCaddress = "MW24848"; + PLCaddress = appConfig.mqAddress.上左收卷SFC; if (position == 3) - PLCaddress = "MW24850"; + PLCaddress = appConfig.mqAddress.上右收卷SFC; if (position == 2) - PLCaddress = "MW24852"; + PLCaddress = appConfig.mqAddress.下左收卷SFC; if (position == 4) - PLCaddress = "MW24854"; + PLCaddress = appConfig.mqAddress.下右收卷SFC; if (position == 5) - PLCaddress = "MW248544"; + PLCaddress = appConfig.mqAddress.左放卷SFC; if (position == 6) - PLCaddress = "MW24846"; + PLCaddress = appConfig.mqAddress.右放卷SFC; } LogHelper.Info(str + "向PLC地址:" + PLCaddress + "写入SFC:" + sfc); PlcBusiness.writeStrPlc(PLCaddress, sfc); @@ -1911,17 +1910,17 @@ namespace MaterialTraceability.Business.Impl { if (appConfig.machineId==3) { - if (position == 3) plcBusiness.writePlc("MW24648", alarmType); - if (position == 1) plcBusiness.writePlc("MW24656", alarmType); - if (position == 4) plcBusiness.writePlc("MW24664", alarmType); - if (position == 2) plcBusiness.writePlc("MW24672", alarmType); + if (position == 3) plcBusiness.writePlc(appConfig.mqAddress.上左收卷报警, alarmType); + if (position == 1) plcBusiness.writePlc(appConfig.mqAddress.上右收卷报警, alarmType); + if (position == 4) plcBusiness.writePlc(appConfig.mqAddress.下左收卷报警, alarmType); + if (position == 2) plcBusiness.writePlc(appConfig.mqAddress.下右收卷报警, alarmType); } else { - if (position == 1) plcBusiness.writePlc("MW24648", alarmType); - if (position == 3) plcBusiness.writePlc("MW24656", alarmType); - if (position == 2) plcBusiness.writePlc("MW24664", alarmType); - if (position == 4) plcBusiness.writePlc("MW24672", alarmType); + if (position == 1) plcBusiness.writePlc(appConfig.mqAddress.上左收卷报警, alarmType); + if (position == 3) plcBusiness.writePlc(appConfig.mqAddress.上右收卷报警, alarmType); + if (position == 2) plcBusiness.writePlc(appConfig.mqAddress.下左收卷报警, alarmType); + if (position == 4) plcBusiness.writePlc(appConfig.mqAddress.下右收卷报警, alarmType); } } @@ -1933,32 +1932,32 @@ namespace MaterialTraceability.Business.Impl if (appConfig.machineId==3) { if (position == 3) - plcBusiness.writePlc("MW24836", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷写入, 1); if (position == 1) - plcBusiness.writePlc("MW24838", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷写入, 1); if (position == 4) - plcBusiness.writePlc("MW24840", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷写入, 1); if (position == 2) - plcBusiness.writePlc("MW24842", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷写入, 1); if (position == 5) - plcBusiness.writePlc("MW24834", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷写入, 1); if (position == 6) - plcBusiness.writePlc("MW24832", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷写入, 1); } else { if (position == 1) - plcBusiness.writePlc("MW24836", 1); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷写入, 1); if (position == 3) - plcBusiness.writePlc("MW24838", 1); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷写入, 1); if (position == 2) - plcBusiness.writePlc("MW24840", 1); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷写入, 1); if (position == 4) - plcBusiness.writePlc("MW24842", 1); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷写入, 1); if (position == 5) - plcBusiness.writePlc("MW24832", 1); + plcBusiness.writePlc(appConfig.mqAddress.左放卷写入, 1); if (position == 6) - plcBusiness.writePlc("MW24834", 1); + plcBusiness.writePlc(appConfig.mqAddress.右放卷写入, 1); } } @@ -2108,17 +2107,17 @@ namespace MaterialTraceability.Business.Impl List positions = new List(); if (appConfig.machineId == 3) { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(4); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(2); } else { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(2); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(4); } foreach (int item in positions) @@ -2510,17 +2509,17 @@ namespace MaterialTraceability.Business.Impl if (appConfig.machineId==3) { - if (position == 1) treeTop = PlcBusiness.readStrPlc("MW44400", 60); //上右 - if (position == 2) treeTop = PlcBusiness.readStrPlc("MW45200", 60); //下右 - if (position == 3) treeTop = PlcBusiness.readStrPlc("MW44000", 60); //上左 - if (position == 4) treeTop = PlcBusiness.readStrPlc("MW44800", 60); //下左 + if (position == 1) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.上右打标数, 60); //上右 + if (position == 2) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.下右打标数, 60); //下右 + if (position == 3) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.上左打标数, 60); //上左 + if (position == 4) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.下左打标数, 60); //下左 } else { - if (position == 3) treeTop = PlcBusiness.readStrPlc("MW44000", 60); //上左 - if (position == 4) treeTop = PlcBusiness.readStrPlc("MW44800", 60); //下左 - if (position == 1) treeTop = PlcBusiness.readStrPlc("MW44400", 60); //上右 - if (position == 2) treeTop = PlcBusiness.readStrPlc("MW45200", 60); //下右 + if (position == 3) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.上右打标数, 60); //上左 + if (position == 4) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.下右打标数, 60); //下左 + if (position == 1) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.上左打标数, 60); //上右 + if (position == 2) treeTop = PlcBusiness.readStrPlc(appConfig.mqAddress.下左打标数, 60); //下右 } LogHelper.Info("通过PLC获取CCD打标数:" + treeTop); string[] array = treeTop.Replace("\0","").Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries); @@ -2676,17 +2675,17 @@ namespace MaterialTraceability.Business.Impl int directions = 0; if (position > 4) { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20000.0")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.放卷方向)); } else { if (position % 2 != 0) //上轴 { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20001.0")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.上轴方向)); } else //下轴 { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20001.1")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.下轴方向)); } } //绑定信息存储运行方向 @@ -2819,17 +2818,17 @@ namespace MaterialTraceability.Business.Impl List positions = new List(); if (appConfig.machineId == 3) { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(4); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(2); } else { - if (PlcBusiness.readPlc("MW24676") == 1) positions.Add(1); - if (PlcBusiness.readPlc("MW24678") == 1) positions.Add(3); - if (PlcBusiness.readPlc("MW24680") == 1) positions.Add(2); - if (PlcBusiness.readPlc("MW24682") == 1) positions.Add(4); + if (PlcBusiness.readPlc(appConfig.mqAddress.上左收卷状态) == 1) positions.Add(1); + if (PlcBusiness.readPlc(appConfig.mqAddress.上右收卷状态) == 1) positions.Add(3); + if (PlcBusiness.readPlc(appConfig.mqAddress.下左收卷状态) == 1) positions.Add(2); + if (PlcBusiness.readPlc(appConfig.mqAddress.下右收卷状态) == 1) positions.Add(4); } int position = positions.Max(); diff --git a/MaterialTraceability.Business/MainBusiness.cs b/MaterialTraceability.Business/MainBusiness.cs index 229c740..c906eeb 100644 --- a/MaterialTraceability.Business/MainBusiness.cs +++ b/MaterialTraceability.Business/MainBusiness.cs @@ -291,7 +291,7 @@ namespace MaterialTraceability.Business /// public void MqSignalInit() { - plcBusiness.writePlc("MW25678", 0); + plcBusiness.writePlc(appConfig.mqAddress.开机启动, 0); LogHelper.Info("模切程序初始化开机启动信号复位,MW25678写0"); } diff --git a/MaterialTraceability.Business/MaterialFeatureBusiness.cs b/MaterialTraceability.Business/MaterialFeatureBusiness.cs index ac13b58..0e475dc 100644 --- a/MaterialTraceability.Business/MaterialFeatureBusiness.cs +++ b/MaterialTraceability.Business/MaterialFeatureBusiness.cs @@ -204,17 +204,17 @@ namespace MaterialTraceability.Business int directions = 0; if (position > 4) { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20000.0")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.放卷方向)); } else { if (position % 2 != 0) //上轴 { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20001.0")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.上轴方向)); } else //下轴 { - directions = Convert.ToInt32(PlcBusiness.readBoolPlc("MW20001.1")); + directions = Convert.ToInt32(PlcBusiness.readBoolPlc(appConfig.mqAddress.下轴方向)); } } diff --git a/MaterialTraceability.Business/PlcBusiness.cs b/MaterialTraceability.Business/PlcBusiness.cs index 6924e93..76f859b 100644 --- a/MaterialTraceability.Business/PlcBusiness.cs +++ b/MaterialTraceability.Business/PlcBusiness.cs @@ -393,16 +393,16 @@ namespace MaterialTraceability.Business { //开机启动信号 Add By WenJy 2022-10-12 - if (plcInstance.readInt32ByAddress("MW25678") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.开机启动) == 1) { - plcInstance.writeInt32ByAddress("MW25678", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.开机启动, 0); SignalRefreshEvent?.Invoke(8, 0); } //左放卷 涨紧信号 - if (plcInstance.readInt32ByAddress("MW24800") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.左放卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24800", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.左放卷涨紧, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(1, 6); @@ -415,9 +415,9 @@ namespace MaterialTraceability.Business } //右放卷 涨紧信号 - if (plcInstance.readInt32ByAddress("MW24802") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.右放卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24802", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.右放卷涨紧, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(1, 5); @@ -430,7 +430,7 @@ namespace MaterialTraceability.Business } //左放卷 开始信号 - if (plcInstance.readBoolByAddress("MW1021.2")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.左放卷开始)) { if (isReadFlag(ref lastReadTime_A_Begin)) { @@ -449,7 +449,7 @@ namespace MaterialTraceability.Business } //右放卷 开始信号 - if (plcInstance.readBoolByAddress("MW1021.6")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.右放卷开始)) { if (isReadFlag(ref lastReadTime_A_End)) { @@ -467,9 +467,9 @@ namespace MaterialTraceability.Business } //左放卷 结束信号 - if (plcInstance.readInt32ByAddress("MW24844") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.左放卷结束) == 1) { - writePlc("MW24844", 0); + writePlc(appConfig.mqAddress.左放卷结束, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(2, 6); @@ -483,7 +483,7 @@ namespace MaterialTraceability.Business } //右放卷 结束信号 - if (plcInstance.readInt32ByAddress("MW24846") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.右放卷结束) == 1) { if (appConfig.machineId == 3) { @@ -494,13 +494,13 @@ namespace MaterialTraceability.Business { SignalRefreshEvent?.Invoke(2, 6); } - writePlc("MW24846", 0); + writePlc(appConfig.mqAddress.右放卷结束, 0); } //上收卷左侧涨紧 信号 - if (plcInstance.readInt32ByAddress("MW24804") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.上左收卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24804", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.上左收卷涨紧, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(3, 3); @@ -512,9 +512,9 @@ namespace MaterialTraceability.Business } //上收卷右侧涨紧 信号 - if (plcInstance.readInt32ByAddress("MW24806") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.上右收卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24806", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.上右收卷涨紧, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(3, 1); @@ -527,9 +527,9 @@ namespace MaterialTraceability.Business } //下收卷左侧涨紧 信号 - if (plcInstance.readInt32ByAddress("MW24808") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.下左收卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24808", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.下左收卷涨紧, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(3, 4); @@ -542,9 +542,9 @@ namespace MaterialTraceability.Business } //下收卷右侧涨紧 信号 - if (plcInstance.readInt32ByAddress("MW24810") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.下右收卷涨紧) == 1) { - plcInstance.writeInt32ByAddress("MW24810", 0); + plcInstance.writeInt32ByAddress(appConfig.mqAddress.下右收卷涨紧, 0); if (appConfig.machineId == 3) { @@ -558,7 +558,7 @@ namespace MaterialTraceability.Business } //上收卷左侧开始信号 - if (plcInstance.readBoolByAddress("MW1022.2")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.上左收卷开始)) { if (isReadFlag(ref lastReadTime_B_Begin)) { @@ -574,7 +574,7 @@ namespace MaterialTraceability.Business } //上收卷右侧开始信号 - if (plcInstance.readBoolByAddress("MW1022.6")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.上右收卷开始)) { if (isReadFlag(ref lastReadTime_B_End)) { @@ -591,7 +591,7 @@ namespace MaterialTraceability.Business } //下收卷左侧开始信号 - if (plcInstance.readBoolByAddress("MW1023.2")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.下左收卷开始)) { if (isReadFlag(ref lastReadTime_Force)) { @@ -608,7 +608,7 @@ namespace MaterialTraceability.Business } //下收卷右侧开始信号 - if (plcInstance.readBoolByAddress("MW1023.6")) + if (plcInstance.readBoolByAddress(appConfig.mqAddress.下右收卷开始)) { if (isReadFlag(ref lastReadTime_ForceSecond)) { @@ -625,9 +625,9 @@ namespace MaterialTraceability.Business } //上左收卷结束信号 - if (plcInstance.readInt32ByAddress("MW24848") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.上左收卷结束) == 1) { - writePlc("MW24848", 0); + writePlc(appConfig.mqAddress.上左收卷结束, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(4, 3); @@ -640,9 +640,9 @@ namespace MaterialTraceability.Business } //上右收卷结束信号 - if (plcInstance.readInt32ByAddress("MW24850") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.上右收卷结束) == 1) { - writePlc("MW24850", 0); + writePlc(appConfig.mqAddress.上右收卷结束, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(4, 1); @@ -655,9 +655,9 @@ namespace MaterialTraceability.Business } //下左收卷结束 - if (plcInstance.readInt32ByAddress("MW24852") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.下左收卷结束) == 1) { - writePlc("MW24852", 0); + writePlc(appConfig.mqAddress.下左收卷结束, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(4, 4); @@ -670,9 +670,9 @@ namespace MaterialTraceability.Business } //下右收卷结束 - if (plcInstance.readInt32ByAddress("MW24854") == 1) + if (plcInstance.readInt32ByAddress(appConfig.mqAddress.下右收卷结束) == 1) { - writePlc("MW24854", 0); + writePlc(appConfig.mqAddress.下右收卷结束, 0); if (appConfig.machineId == 3) { SignalRefreshEvent?.Invoke(4, 2); diff --git a/MaterialTraceability.Entity/Config/LyAddress.cs b/MaterialTraceability.Entity/Config/LyAddress.cs index 24a6ae8..f1d6f78 100644 --- a/MaterialTraceability.Entity/Config/LyAddress.cs +++ b/MaterialTraceability.Entity/Config/LyAddress.cs @@ -9,7 +9,7 @@ namespace MaterialTraceability.Entity.Config { public sealed class LyAddress { - private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI"); + private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); private static readonly Lazy lazy = new Lazy(() => new LyAddress()); diff --git a/MaterialTraceability.Entity/Config/MqAddress.cs b/MaterialTraceability.Entity/Config/MqAddress.cs new file mode 100644 index 0000000..beeea8f --- /dev/null +++ b/MaterialTraceability.Entity/Config/MqAddress.cs @@ -0,0 +1,171 @@ +using MaterialTraceability.Common; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace MaterialTraceability.Entity.Config +{ + public sealed class MqAddress + { + private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); + + private static readonly Lazy lazy = new Lazy(() => new MqAddress()); + + public static MqAddress Instance + { + get + { + return lazy.Value; + } + } + + private MqAddress() { } + + public string 上左收卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷涨紧"); + + public string 下左收卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷涨紧"); + + public string 上右收卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷涨紧"); + + public string 下右收卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷涨紧"); + + public string 左放卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "左放卷涨紧"); + + public string 右放卷涨紧 = iNIFile.IniReadValue("MQPLcAddress", "右放卷涨紧"); + + // + public string 上左收卷开始 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷开始"); + + public string 下左收卷开始 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷开始"); + + public string 上右收卷开始 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷开始"); + + public string 下右收卷开始 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷开始"); + + public string 左放卷开始 = iNIFile.IniReadValue("MQPLcAddress", "左放卷开始"); + + public string 右放卷开始 = iNIFile.IniReadValue("MQPLcAddress", "右放卷开始"); + + // + public string 上左收卷结束 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷结束"); + + public string 下左收卷结束 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷结束"); + + public string 上右收卷结束 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷结束"); + + public string 下右收卷结束 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷结束"); + + public string 左放卷结束 = iNIFile.IniReadValue("MQPLcAddress", "左放卷结束"); + + public string 右放卷结束 = iNIFile.IniReadValue("MQPLcAddress", "右放卷结束"); + + // + public string 上左收卷EA = iNIFile.IniReadValue("MQPLcAddress", "上左收卷EA"); + + public string 下左收卷EA = iNIFile.IniReadValue("MQPLcAddress", "下左收卷EA"); + + public string 上右收卷EA = iNIFile.IniReadValue("MQPLcAddress", "上右收卷EA"); + + public string 下右收卷EA = iNIFile.IniReadValue("MQPLcAddress", "下右收卷EA"); + + // + public string 上左收卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷读取结果"); + + public string 下左收卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷读取结果"); + + public string 上右收卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷读取结果"); + + public string 下右收卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷读取结果"); + + public string 左放卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "左放卷读取结果"); + + public string 右放卷读取结果 = iNIFile.IniReadValue("MQPLcAddress", "右放卷读取结果"); + + // + public string 上左收卷报警 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷报警"); + + public string 下左收卷报警 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷报警"); + + public string 上右收卷报警 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷报警"); + + public string 下右收卷报警 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷报警"); + + public string 左放卷报警 = iNIFile.IniReadValue("MQPLcAddress", "左放卷报警"); + + public string 右放卷报警 = iNIFile.IniReadValue("MQPLcAddress", "右放卷报警"); + + // + public string 上左收卷写入 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷写入"); + + public string 下左收卷写入 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷写入"); + + public string 上右收卷写入 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷写入"); + + public string 下右收卷写入 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷写入"); + + public string 左放卷写入 = iNIFile.IniReadValue("MQPLcAddress", "左放卷写入"); + + public string 右放卷写入 = iNIFile.IniReadValue("MQPLcAddress", "右放卷写入"); + + // + public string 上左收卷SFC = iNIFile.IniReadValue("MQPLcAddress", "上左收卷SFC"); + + public string 下左收卷SFC = iNIFile.IniReadValue("MQPLcAddress", "下左收卷SFC"); + + public string 上右收卷SFC = iNIFile.IniReadValue("MQPLcAddress", "上右收卷SFC"); + + public string 下右收卷SFC = iNIFile.IniReadValue("MQPLcAddress", "下右收卷SFC"); + + public string 左放卷SFC = iNIFile.IniReadValue("MQPLcAddress", "左放卷SFC"); + + public string 右放卷SFC = iNIFile.IniReadValue("MQPLcAddress", "右放卷SFC"); + + // + public string 上左收卷下料 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷下料"); + + public string 下左收卷下料 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷下料"); + + public string 上右收卷下料 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷下料"); + + public string 下右收卷下料 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷下料"); + + public string 左放卷下料 = iNIFile.IniReadValue("MQPLcAddress", "左放卷下料"); + + public string 右放卷下料 = iNIFile.IniReadValue("MQPLcAddress", "右放卷下料"); + + // + public string 上左收卷状态 = iNIFile.IniReadValue("MQPLcAddress", "上左收卷状态"); + + public string 下左收卷状态 = iNIFile.IniReadValue("MQPLcAddress", "下左收卷状态"); + + public string 上右收卷状态 = iNIFile.IniReadValue("MQPLcAddress", "上右收卷状态"); + + public string 下右收卷状态 = iNIFile.IniReadValue("MQPLcAddress", "下右收卷状态"); + + public string 左放卷状态 = iNIFile.IniReadValue("MQPLcAddress", "左放卷状态"); + + public string 右放卷状态 = iNIFile.IniReadValue("MQPLcAddress", "右放卷状态"); + + // + public string 上左打标数 = iNIFile.IniReadValue("MQPLcAddress", "上左打标数"); + + public string 下左打标数 = iNIFile.IniReadValue("MQPLcAddress", "下左打标数"); + + public string 上右打标数 = iNIFile.IniReadValue("MQPLcAddress", "上右打标数"); + + public string 下右打标数 = iNIFile.IniReadValue("MQPLcAddress", "下右打标数"); + // + public string 开机启动 = iNIFile.IniReadValue("MQPLcAddress", "开机启动"); + + public string 全局报警 = iNIFile.IniReadValue("MQPLcAddress", "全局报警"); + + // + public string 放卷方向 = iNIFile.IniReadValue("MQPLcAddress", "放卷方向"); + + public string 上轴方向 = iNIFile.IniReadValue("MQPLcAddress", "上轴方向"); + + public string 下轴方向 = iNIFile.IniReadValue("MQPLcAddress", "下轴方向"); + } +} diff --git a/MaterialTraceability.Entity/Config/TbAddress.cs b/MaterialTraceability.Entity/Config/TbAddress.cs index 42629e2..63c6479 100644 --- a/MaterialTraceability.Entity/Config/TbAddress.cs +++ b/MaterialTraceability.Entity/Config/TbAddress.cs @@ -10,7 +10,7 @@ namespace MaterialTraceability.Entity.Config { public sealed class TbAddress { - private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/PlcConfig/App.InI"); + private static INIFile iNIFile = new INIFile(System.Environment.CurrentDirectory + "/App.InI"); private static readonly Lazy lazy = new Lazy(() => new TbAddress()); diff --git a/MaterialTraceability.Entity/DTO/AppConfigDto.cs b/MaterialTraceability.Entity/DTO/AppConfigDto.cs index 7fc5007..79ecba5 100644 --- a/MaterialTraceability.Entity/DTO/AppConfigDto.cs +++ b/MaterialTraceability.Entity/DTO/AppConfigDto.cs @@ -51,5 +51,7 @@ namespace MaterialTraceability.Entity.DTO public TbAddress TbAddress = TbAddress.Instance; public LyAddress LyAddress = LyAddress.Instance; + + public MqAddress mqAddress = MqAddress.Instance; } } diff --git a/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj b/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj index 7f5d1e7..f310f0b 100644 --- a/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj +++ b/MaterialTraceability.Entity/MaterialTraceability.Entity.csproj @@ -45,6 +45,7 @@ + diff --git a/MaterialTraceabilityUI/DieCuttingProcess.xaml.cs b/MaterialTraceabilityUI/DieCuttingProcess.xaml.cs index ae7b792..3cae7b0 100644 --- a/MaterialTraceabilityUI/DieCuttingProcess.xaml.cs +++ b/MaterialTraceabilityUI/DieCuttingProcess.xaml.cs @@ -970,7 +970,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("上左收卷强制下料"); ListBoxItemAdd(this.PlcLog, "上左收卷强制下料触发成功,MW24824写入0"); LogHelperBusiness.LogInfo("上左收卷强制下料触发,MW24824写入0"); - plcBusiness.writePlc("MW24824", 0); + plcBusiness.writePlc(appConfig.mqAddress.上左收卷下料, 0); int position = 0; if(appConfig.machineId == 3) { @@ -1000,7 +1000,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("上右收卷强制下料触发"); ListBoxItemAdd(this.PlcLog, "上右收卷强制下料触发成功,MW24826写入0"); LogHelperBusiness.LogInfo("上右收卷强制下料触发成功,MW24826写入0"); - plcBusiness.writePlc("MW24826", 0); + plcBusiness.writePlc(appConfig.mqAddress.上右收卷下料, 0); int position = 0; if (appConfig.machineId == 3) @@ -1031,7 +1031,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("下左收卷强制下料触发"); ListBoxItemAdd(this.PlcLog, "下左收卷强制下料触发成功,MW24828写入0"); LogHelperBusiness.LogInfo("下左收卷强制下料触发成功,MW24828写入0"); - plcBusiness.writePlc("MW24828", 0); + plcBusiness.writePlc(appConfig.mqAddress.下左收卷下料, 0); int position = 0; if (appConfig.machineId == 3) @@ -1062,7 +1062,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("下右收卷强制下料触发"); ListBoxItemAdd(this.PlcLog, "下右收卷强制下料触发成功,MW24830写入0"); LogHelperBusiness.LogInfo("下右收卷强制下料触发成功,MW24830写入0"); - plcBusiness.writePlc("MW24830", 0); + plcBusiness.writePlc(appConfig.mqAddress.下右收卷下料, 0); int position = 0; if (appConfig.machineId == 3) @@ -1225,7 +1225,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("左放卷强制下料"); ListBoxItemAdd(this.PlcLog, "左放卷强制下料触发成功"); LogHelperBusiness.LogInfo("左放卷强制下料触发"); - plcBusiness.writePlc("MW24820", 0); + plcBusiness.writePlc(appConfig.mqAddress.左放卷下料, 0); } } @@ -1245,7 +1245,7 @@ namespace MaterialTraceabilityUI MessageBox.Show("右放卷强制下料"); ListBoxItemAdd(this.PlcLog, "右放卷强制下料触发成功"); LogHelperBusiness.LogInfo("右放卷强制下料触发"); - plcBusiness.writePlc("MW24822", 0); + plcBusiness.writePlc(appConfig.mqAddress.右放卷下料, 0); } } @@ -1269,7 +1269,7 @@ namespace MaterialTraceabilityUI } ListBoxItemAdd(this.PlcLog, logStr + "强制下料触发成功,解除合卷报警"); LogHelperBusiness.LogInfo(logStr + "强制下料触发成功,解除合卷报警"); - plcBusiness.writeDoublePlc("MW24624", 0); + plcBusiness.writeDoublePlc(appConfig.mqAddress.全局报警, 0); }catch(Exception ex) { LogHelperBusiness.LogInfo("强制下料异常:"+ex.Message);