|
|
|
@ -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<int> positions = new List<int>();
|
|
|
|
|
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<int> positions = new List<int>();
|
|
|
|
|
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();
|
|
|
|
|
|
|
|
|
|