|
|
|
|
@ -143,12 +143,12 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
epc = epc.Replace("\0", "").Trim();
|
|
|
|
|
//RFID写入PLC
|
|
|
|
|
//WriteRFIDtoPLC(position, epc);
|
|
|
|
|
//if (epc == "" || epc == null)
|
|
|
|
|
//{
|
|
|
|
|
// Random random = new Random();
|
|
|
|
|
if (epc == "" || epc == null)
|
|
|
|
|
{
|
|
|
|
|
Random random = new Random();
|
|
|
|
|
|
|
|
|
|
// epc = "JSLY4RDA0000" + random.Next(10, 99);
|
|
|
|
|
//}
|
|
|
|
|
epc = "JSLY4RDA0000" + random.Next(10, 99);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (StringExtension.IsBlank(epc) || !epc.Contains("JSLY") && !epc.Contains("CATT"))
|
|
|
|
|
@ -264,6 +264,16 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
{
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
//放卷结束置位手动上料
|
|
|
|
|
if (position == 0)
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.A手动上料, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.B手动上料, 0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
string logStr = position == 0 ? LanguageHelper.ShowMessage("A放卷轴") : LanguageHelper.ShowMessage("B放卷轴");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.PlcLog, logStr+ LanguageHelper.ShowMessage("放卷位结束信号触发成功"));
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + LanguageHelper.ShowMessage("放卷位结束信号触发成功"));
|
|
|
|
|
@ -306,15 +316,15 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2A状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
UpdateShaftEndFlag(3);
|
|
|
|
|
}
|
|
|
|
|
//if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2A状态) == 1)
|
|
|
|
|
//{
|
|
|
|
|
// UpdateShaftEndFlag(3);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2B状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
UpdateShaftEndFlag(4);
|
|
|
|
|
}
|
|
|
|
|
//if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2B状态) == 1)
|
|
|
|
|
//{
|
|
|
|
|
// UpdateShaftEndFlag(4);
|
|
|
|
|
//}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//更新放卷信息
|
|
|
|
|
@ -386,7 +396,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
if (FJSFC.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
FJSFC = FJSFC.Substring(0, 18);
|
|
|
|
|
FJSFC = FJSFC.Substring(0, 20);
|
|
|
|
|
}
|
|
|
|
|
if (StringExtension.IsBlank(FJSFC))
|
|
|
|
|
{
|
|
|
|
|
@ -401,14 +411,14 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
List<TagMessage> positionTag = equipBusiness.ReadEPCByAntanaGroup(positionList);
|
|
|
|
|
foreach (var item in positionList)
|
|
|
|
|
{
|
|
|
|
|
if (item == 1) logStr = LanguageHelper.ShowMessage("1A轴1#天线");
|
|
|
|
|
if (item == 2) logStr = LanguageHelper.ShowMessage("1A轴2#天线");
|
|
|
|
|
if (item == 3) logStr = LanguageHelper.ShowMessage("1B轴1#天线");
|
|
|
|
|
if (item == 4) logStr = LanguageHelper.ShowMessage("1B轴2#天线");
|
|
|
|
|
if (item == 5) logStr = LanguageHelper.ShowMessage("2A轴3#天线");
|
|
|
|
|
if (item == 6) logStr = LanguageHelper.ShowMessage("2A轴4#天线");
|
|
|
|
|
if (item == 7) logStr = LanguageHelper.ShowMessage("2B轴3#天线");
|
|
|
|
|
if (item == 8) logStr = LanguageHelper.ShowMessage("2B轴4#天线");
|
|
|
|
|
if (item == 1) logStr = LanguageHelper.ShowMessage("1A轴3#天线");
|
|
|
|
|
if (item == 2) logStr = LanguageHelper.ShowMessage("1A轴4#天线");
|
|
|
|
|
if (item == 3) logStr = LanguageHelper.ShowMessage("1B轴4#天线");
|
|
|
|
|
if (item == 4) logStr = LanguageHelper.ShowMessage("1B轴3#天线");
|
|
|
|
|
if (item == 5) logStr = LanguageHelper.ShowMessage("2A轴1#天线");
|
|
|
|
|
if (item == 6) logStr = LanguageHelper.ShowMessage("2A轴2#天线");
|
|
|
|
|
if (item == 7) logStr = LanguageHelper.ShowMessage("2B轴1#天线");
|
|
|
|
|
if (item == 8) logStr = LanguageHelper.ShowMessage("2B轴2#天线");
|
|
|
|
|
|
|
|
|
|
string epc = "";
|
|
|
|
|
//add by wenjy 判断读取结果是否为null 20220825
|
|
|
|
|
@ -542,23 +552,24 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
else if (ConfigHelper.GetConfig("tagAmount") == "3")
|
|
|
|
|
{
|
|
|
|
|
if (position < 3)
|
|
|
|
|
if (position > 2)
|
|
|
|
|
{
|
|
|
|
|
if (tagInfoList.Count == 2)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info("收卷位涨紧流程处理完工,下发OK信号");
|
|
|
|
|
this.sendSuccessByDownBegin(position);
|
|
|
|
|
//这里要判断是否存在其他位置
|
|
|
|
|
if (JudgeSame(tagInfoList, position))
|
|
|
|
|
{
|
|
|
|
|
WriteNGToPLC(position);
|
|
|
|
|
sendError(position, 2, false, 1);
|
|
|
|
|
LogHelper.Info(logStr + "RFID条码" + epc + "已存在其它位置,检查是否重复");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.AlarmLog, logStr + epc + LanguageHelper.ShowMessage("RFID条码已存在其它位置,检查是否重复"));
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info("收卷位涨紧流程处理完工,下发OK信号");
|
|
|
|
|
this.sendSuccessByDownBegin(position);
|
|
|
|
|
}
|
|
|
|
|
//if (JudgeSame(tagInfoList, position))
|
|
|
|
|
//{
|
|
|
|
|
// WriteNGToPLC(position);
|
|
|
|
|
// sendError(position, 2, false, 1);
|
|
|
|
|
// LogHelper.Info(logStr + "RFID条码" + epc + "已存在其它位置,检查是否重复");
|
|
|
|
|
// LogRefreshEvent?.Invoke(LogType.AlarmLog, logStr + epc + LanguageHelper.ShowMessage("RFID条码已存在其它位置,检查是否重复"));
|
|
|
|
|
//}
|
|
|
|
|
//else
|
|
|
|
|
//{
|
|
|
|
|
|
|
|
|
|
//}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -580,13 +591,24 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (position < 5)
|
|
|
|
|
{
|
|
|
|
|
if (tagInfoList.Count == 2)
|
|
|
|
|
{
|
|
|
|
|
LogHelper.Info("收卷位涨紧流程处理完工,下发OK信号");
|
|
|
|
|
this.sendSuccessByDownBegin(position);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (appConfig.isMesFlag == 1)
|
|
|
|
|
{
|
|
|
|
|
{
|
|
|
|
|
//解绑RFID与SFC的绑定信息
|
|
|
|
|
LogHelper.Info("解绑RFID条码" + epc + "绑定的SFC信息");
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + epc+ LanguageHelper.ShowMessage("解绑RFID条码绑定的SFC信息"));
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, logStr + epc + LanguageHelper.ShowMessage("解绑RFID条码绑定的SFC信息"));
|
|
|
|
|
this.UnBindRfidAndSfc(epc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -663,10 +685,10 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
LogHelper.Info(logStr + "收卷结束信号触发成功");
|
|
|
|
|
//通过PLC读取收卷轴绑定的放卷位SFC信
|
|
|
|
|
ProShaftInfo upMaterialInfo = new ProShaftInfo();
|
|
|
|
|
if (position == 1) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, 18).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 2) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, 18).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 3) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, 18).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 4) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, 18).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 1) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, 20).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 2) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, 20).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 3) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, 20).Replace("\0", "").Trim();
|
|
|
|
|
if (position == 4) upMaterialInfo.bindSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, 20).Replace("\0", "").Trim();
|
|
|
|
|
//LogHelper.PlcLog("通过PLC获取SFC截取前长度:" + upMaterialInfo.bindSfc.Length);
|
|
|
|
|
//LogHelper.PlcLog("PLC获取截取前的SFC为:" + upMaterialInfo.bindSfc);
|
|
|
|
|
if (StringExtension.IsBlank(upMaterialInfo.bindSfc))
|
|
|
|
|
@ -679,8 +701,8 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
|
|
|
|
|
if (upMaterialInfo.bindSfc.Length > 0)
|
|
|
|
|
{
|
|
|
|
|
//LogRefreshEvent?.Invoke(LogType.RfidLog, "PLC获取的18位SFC为:" + upMaterialInfo.bindSfc + "长度超过18位进行截取");
|
|
|
|
|
upMaterialInfo.bindSfc = upMaterialInfo.bindSfc.Substring(0, 18);
|
|
|
|
|
//LogRefreshEvent?.Invoke(LogType.RfidLog, "PLC获取的20位SFC为:" + upMaterialInfo.bindSfc + "长度超过20位进行截取");
|
|
|
|
|
upMaterialInfo.bindSfc = upMaterialInfo.bindSfc.Substring(0, 20);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
LogRefreshEvent?.Invoke(LogType.RfidLog, LanguageHelper.ShowMessage("通过PLC获取的SFC为:") + upMaterialInfo.bindSfc);
|
|
|
|
|
@ -1356,14 +1378,14 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
/// <returns></returns>
|
|
|
|
|
private bool GetSameSfcByPlc(string bindSfc, int position)
|
|
|
|
|
{
|
|
|
|
|
string SJ_1A = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, (ushort)18).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_1B = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, (ushort)18).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_2A = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, (ushort)18).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_2B = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, (ushort)18).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_1A = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, (ushort)20).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_1B = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, (ushort)20).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_2A = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, (ushort)20).Replace("\0", "").Trim();
|
|
|
|
|
string SJ_2B = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, (ushort)20).Replace("\0", "").Trim();
|
|
|
|
|
|
|
|
|
|
if (position != 1)
|
|
|
|
|
{
|
|
|
|
|
if (!SJ_1A.IsBlank() && SJ_1A.Length == 18)
|
|
|
|
|
if (!SJ_1A.IsBlank() && SJ_1A.Length == 20)
|
|
|
|
|
{
|
|
|
|
|
if (SJ_1A == bindSfc)
|
|
|
|
|
return true;
|
|
|
|
|
@ -1372,7 +1394,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
|
|
|
|
|
if (position != 2)
|
|
|
|
|
{
|
|
|
|
|
if (!SJ_1B.IsBlank() && SJ_1B.Length == 18)
|
|
|
|
|
if (!SJ_1B.IsBlank() && SJ_1B.Length == 20)
|
|
|
|
|
{
|
|
|
|
|
if (SJ_1B == bindSfc)
|
|
|
|
|
return true;
|
|
|
|
|
@ -1380,7 +1402,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
if (position != 3)
|
|
|
|
|
{
|
|
|
|
|
if (!SJ_2A.IsBlank() && SJ_2A.Length == 18)
|
|
|
|
|
if (!SJ_2A.IsBlank() && SJ_2A.Length == 20)
|
|
|
|
|
{
|
|
|
|
|
if (SJ_2A == bindSfc)
|
|
|
|
|
return true;
|
|
|
|
|
@ -1388,7 +1410,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
if (position != 4)
|
|
|
|
|
{
|
|
|
|
|
if (!SJ_2B.IsBlank() && SJ_2B.Length == 18)
|
|
|
|
|
if (!SJ_2B.IsBlank() && SJ_2B.Length == 20)
|
|
|
|
|
{
|
|
|
|
|
if (SJ_2B == bindSfc)
|
|
|
|
|
return true;
|
|
|
|
|
@ -1648,7 +1670,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//1A
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷1A状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, (ushort)18).Replace("\0", "").Trim().Substring(0,18);
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1ASFC, (ushort)20).Replace("\0", "").Trim().Substring(0,20);
|
|
|
|
|
LogHelper.Info("1A轴在生产,SFC:" + downSfc);
|
|
|
|
|
if (StringExtension.IsBlank(downSfc))
|
|
|
|
|
{
|
|
|
|
|
@ -1672,7 +1694,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//1B
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷1B状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, (ushort)18).Replace("\0", "").Trim().Substring(0, 18);
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷1BSFC, (ushort)20).Replace("\0", "").Trim().Substring(0, 20);
|
|
|
|
|
LogHelper.Info("1B轴在生产,SFC:" + downSfc);
|
|
|
|
|
if (StringExtension.IsBlank(downSfc))
|
|
|
|
|
{
|
|
|
|
|
@ -1696,7 +1718,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//2A
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2A状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, (ushort)18).Replace("\0", "").Trim().Substring(0, 18);
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2ASFC, (ushort)20).Replace("\0", "").Trim().Substring(0, 20);
|
|
|
|
|
LogHelper.Info("2A轴在生产,SFC:" + downSfc);
|
|
|
|
|
if (StringExtension.IsBlank(downSfc))
|
|
|
|
|
{
|
|
|
|
|
@ -1720,7 +1742,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//2B
|
|
|
|
|
if (PlcBusiness.readPlc(appConfig.LyAddress.收卷2B状态) == 1)
|
|
|
|
|
{
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, (ushort)18).Replace("\0", "").Trim().Substring(0, 18);
|
|
|
|
|
downSfc = PlcBusiness.readStrPlc(appConfig.LyAddress.收卷2BSFC, (ushort)20).Replace("\0", "").Trim().Substring(0, 20);
|
|
|
|
|
LogHelper.Info("2B轴在生产,SFC:" + downSfc);
|
|
|
|
|
if (StringExtension.IsBlank(downSfc))
|
|
|
|
|
{
|
|
|
|
|
@ -1823,7 +1845,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷上料1AOK, 1);
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料1AOK, 1);
|
|
|
|
|
}
|
|
|
|
|
if(appConfig.PLCType == "LY4NKLYPLcAddress")
|
|
|
|
|
if(appConfig.PLCType == "LY4NKLYPLcAddress" || appConfig.PLCType == "HNLYPLcAddress")
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料1AOK, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -1839,7 +1861,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷上料1BOK, 1);
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料1BOK, 1);
|
|
|
|
|
}
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress")
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress" || appConfig.PLCType == "HNLYPLcAddress")
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料1BOK, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -1856,7 +1878,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料2AOK, 1);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料2AOK, 0);
|
|
|
|
|
}
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress")
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress" || appConfig.PLCType == "HNLYPLcAddress")
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料2AOK, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -1873,7 +1895,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料2BOK, 1);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料2BOK, 0);
|
|
|
|
|
}
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress")
|
|
|
|
|
if (appConfig.PLCType == "LY4NKLYPLcAddress" || appConfig.PLCType == "HNLYPLcAddress")
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷上料2BOK, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -1893,62 +1915,19 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
{
|
|
|
|
|
if (position == 1)
|
|
|
|
|
{
|
|
|
|
|
if (appConfig.PLCType != ("LY4NKLYPLcAddress") && appConfig.PLCType != ("LY4YHLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 0);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料1AOK, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
if (position == 2)
|
|
|
|
|
{
|
|
|
|
|
if (appConfig.PLCType != ("LY4NKLYPLcAddress") && appConfig.PLCType != ("LY4YHLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1B控制下料, 0);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料1BOK, 1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1B控制下料, 1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1B控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
if (position == 3)
|
|
|
|
|
{
|
|
|
|
|
if (appConfig.PLCType != ("LY4NKLYPLcAddress") && appConfig.PLCType != ("LY4YHLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料, 0);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料2AOK, 1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料, 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
if (position == 4)
|
|
|
|
|
{
|
|
|
|
|
if (appConfig.PLCType != ("LY4NKLYPLcAddress") && appConfig.PLCType != ("LY4YHLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料, 0);
|
|
|
|
|
//plcBusiness.writePlc(appConfig.LyAddress.收卷下料2BOK, 1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1965,6 +1944,13 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
if (position == 3) plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料, 2);
|
|
|
|
|
if (position == 4) plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料, 2);
|
|
|
|
|
}
|
|
|
|
|
else if (appConfig.PLCType == ("HNLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
if (position == 1) plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 0);
|
|
|
|
|
if (position == 2) plcBusiness.writePlc(appConfig.LyAddress.收卷1B控制下料, 0);
|
|
|
|
|
if (position == 3) plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料, 0);
|
|
|
|
|
if (position == 4) plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料, 0);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (position == 1) plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 1);
|
|
|
|
|
@ -2149,7 +2135,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (item == 5 || item == 8)
|
|
|
|
|
if (item == 1 || item == 4)
|
|
|
|
|
{
|
|
|
|
|
shaftInfo.endFlag = 1;
|
|
|
|
|
LogHelper.Info("放卷结束,确定最后一卷收卷物料RFID条码为:" + shaftInfo.bindRfid);
|
|
|
|
|
@ -2189,7 +2175,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "3" || ConfigHelper.GetConfig("tagAmount") == "2")
|
|
|
|
|
{
|
|
|
|
|
if (position > 2)
|
|
|
|
|
if (position < 5)
|
|
|
|
|
{
|
|
|
|
|
shaftInfo.endFlag = 1;
|
|
|
|
|
LogHelper.Info("放卷结束,确定最后一卷收卷物料RFID条码为:" + shaftInfo.bindRfid);
|
|
|
|
|
@ -2207,7 +2193,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (item == 5 || item == 8)
|
|
|
|
|
if (item == 1 || item == 4)
|
|
|
|
|
{
|
|
|
|
|
shaftInfo.endFlag = 1;
|
|
|
|
|
LogHelper.Info("放卷结束,确定最后一卷收卷物料RFID条码为:" + shaftInfo.bindRfid);
|
|
|
|
|
@ -2227,7 +2213,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
}
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "4")
|
|
|
|
|
{
|
|
|
|
|
if (item == 5 || item == 8)
|
|
|
|
|
if (item == 1 || item == 4)
|
|
|
|
|
{
|
|
|
|
|
shaftInfo.endFlag = 1;
|
|
|
|
|
LogHelper.Info("放卷结束,确定最后一卷收卷物料RFID条码为:" + shaftInfo.bindRfid);
|
|
|
|
|
@ -2271,7 +2257,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
|
|
|
|
|
LogHelper.Info("1A轴异常下料信号触发,下发下料信号");
|
|
|
|
|
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress"))
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress") || appConfig.PLCType == ("HNLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1A控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -2291,7 +2277,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//LogRefreshEvent?.Invoke(LogType.PlcLog, "1B轴异常下料信号触发,下发下料信号");
|
|
|
|
|
LogHelper.Info("1B轴异常下料信号触发,下发下料信号");
|
|
|
|
|
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress"))
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress") || appConfig.PLCType == ("HNLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷1B控制下料, 1);
|
|
|
|
|
}
|
|
|
|
|
@ -2312,7 +2298,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//LogRefreshEvent?.Invoke(LogType.PlcLog, "2A轴异常下料信号触发,下发下料信号");
|
|
|
|
|
LogHelper.Info("2A轴异常下料信号触发,下发下料信号");
|
|
|
|
|
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress"))
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress") || appConfig.PLCType == ("HNLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2A控制下料,1);
|
|
|
|
|
}
|
|
|
|
|
@ -2333,7 +2319,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
//LogRefreshEvent?.Invoke(LogType.PlcLog, "2B轴异常下料信号触发,下发下料信号");
|
|
|
|
|
LogHelper.Info("2B轴异常下料信号触发,下发下料信号");
|
|
|
|
|
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress"))
|
|
|
|
|
if (appConfig.PLCType == ("LY4NKLYPLcAddress") || appConfig.PLCType == ("HNLYPLcAddress"))
|
|
|
|
|
{
|
|
|
|
|
plcBusiness.writePlc(appConfig.LyAddress.收卷2B控制下料,1);
|
|
|
|
|
}
|
|
|
|
|
@ -2386,12 +2372,12 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
|
|
|
|
|
if (position == 3)
|
|
|
|
|
{
|
|
|
|
|
exp = exp.And(x => x.bindRfid == epc && x.positionId != "5" && x.processId == appConfig.processId);
|
|
|
|
|
exp = exp.And(x => x.bindRfid == epc && x.positionId != "5" && x.positionId != "6" && x.processId == appConfig.processId);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (position == 4)
|
|
|
|
|
{
|
|
|
|
|
exp = exp.And(x => x.bindRfid == epc && x.positionId != "8" && x.processId == appConfig.processId);
|
|
|
|
|
exp = exp.And(x => x.bindRfid == epc && x.positionId != "8" && x.positionId != "7" && x.processId == appConfig.processId);
|
|
|
|
|
}
|
|
|
|
|
List<ProShaftInfo> shaftInfos = await shaftInfoServices.Query(exp);
|
|
|
|
|
if (shaftInfos.Count > 0)
|
|
|
|
|
@ -2417,15 +2403,22 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
logStr = "1A轴";
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "2"|| ConfigHelper.GetConfig("tagAmount") == "1")
|
|
|
|
|
{
|
|
|
|
|
positionList.Add(2);
|
|
|
|
|
positionList.Add(1);
|
|
|
|
|
//冷压1拆2用小天线
|
|
|
|
|
//positionList.Add(1);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "4")
|
|
|
|
|
{
|
|
|
|
|
positionList.Add(1);
|
|
|
|
|
//冷压1拆2用小天线
|
|
|
|
|
positionList.Add(2);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
positionList.Add(1);
|
|
|
|
|
positionList.Add(2);
|
|
|
|
|
//positionList.Add(4);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (position == 2)
|
|
|
|
|
@ -2433,16 +2426,21 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
positionList.Clear();
|
|
|
|
|
logStr = "1B轴";
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "2" || ConfigHelper.GetConfig("tagAmount") == "1")
|
|
|
|
|
{
|
|
|
|
|
//冷压1拆2用小天线
|
|
|
|
|
positionList.Add(4);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "4")
|
|
|
|
|
{
|
|
|
|
|
positionList.Add(3);
|
|
|
|
|
//冷压1拆2用小天线
|
|
|
|
|
//positionList.Add(4);
|
|
|
|
|
positionList.Add(4);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
positionList.Add(4);
|
|
|
|
|
positionList.Add(3);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (position == 3)
|
|
|
|
|
@ -2451,7 +2449,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
positionList.Clear();
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "3" || ConfigHelper.GetConfig("tagAmount") == "2" || ConfigHelper.GetConfig("tagAmount") == "1")
|
|
|
|
|
{
|
|
|
|
|
//positionList.Add(6);
|
|
|
|
|
positionList.Add(6);
|
|
|
|
|
positionList.Add(5);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -2466,7 +2464,7 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
positionList.Clear();
|
|
|
|
|
if (ConfigHelper.GetConfig("tagAmount") == "3" || ConfigHelper.GetConfig("tagAmount") == "2" || ConfigHelper.GetConfig("tagAmount") == "1")
|
|
|
|
|
{
|
|
|
|
|
//positionList.Add(7);
|
|
|
|
|
positionList.Add(7);
|
|
|
|
|
positionList.Add(8);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
@ -2505,12 +2503,12 @@ namespace MaterialTraceability.Business.Impl
|
|
|
|
|
int FJAstate = PlcBusiness.readPlc(appConfig.LyAddress.放卷A状态);
|
|
|
|
|
if (FJAstate == 1)
|
|
|
|
|
{
|
|
|
|
|
sfc = PlcBusiness.readStrPlc(appConfig.LyAddress.A放卷SFC, (ushort)18).Replace("\0", "").Trim().Substring(0, 18);
|
|
|
|
|
sfc = PlcBusiness.readStrPlc(appConfig.LyAddress.A放卷SFC, (ushort)20).Replace("\0", "").Trim().Substring(2, 20);
|
|
|
|
|
}
|
|
|
|
|
int FJBstate = PlcBusiness.readPlc(appConfig.LyAddress.放卷B状态);
|
|
|
|
|
if (FJBstate == 1)
|
|
|
|
|
{
|
|
|
|
|
sfc = PlcBusiness.readStrPlc(appConfig.LyAddress.B放卷SFC, (ushort)18).Replace("\0", "").Trim().Substring(0, 18);
|
|
|
|
|
sfc = PlcBusiness.readStrPlc(appConfig.LyAddress.B放卷SFC, (ushort)20).Replace("\0", "").Trim().Substring(2, 20);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//JudgementMaterial(放卷膜卷号),返回true合卷报警=>PLC 写报警值,返回false不处理
|
|
|
|
|
|