分档方案字段
This commit is contained in:
@@ -1989,7 +1989,7 @@ namespace JinYuan.ControlCenters
|
||||
////}
|
||||
#endregion
|
||||
//发送产品结果参数给MES
|
||||
bool Res1 = CommonMethods.hbgMes.ProducResultParam(ur2, siteCode1, lineCode1, equipNum1, materialCode1, userName1, m, unloadType, ref Mesage);
|
||||
//bool Res1 = CommonMethods.hbgMes.ProducResultParam(ur2, siteCode1, lineCode1, equipNum1, materialCode1, userName1, m, unloadType, ref Mesage);
|
||||
|
||||
|
||||
if (m.Flag == 1)
|
||||
@@ -2027,111 +2027,121 @@ namespace JinYuan.ControlCenters
|
||||
#region OK分档查询
|
||||
//if (CommonMethods.sysConfig.MesModeSwitching && CommonMethods.mesConfig.isConnected)
|
||||
{ //1 分选测厚度NG ,2 分选外观不良 21分选一档,22分选二档,23分选三档、24分选四档,25分档5 26 ==6
|
||||
|
||||
if (list[i].Result == 1)
|
||||
|
||||
if (list[i].Result == 1)
|
||||
{
|
||||
if (CommonMethods.mesConfig.isUpMes)
|
||||
{
|
||||
if (CommonMethods.mesConfig.isUpMes)
|
||||
//分档接口
|
||||
//21~26 OK挡位
|
||||
var (success, mesage, mesResType, mesResFangAnType) = CommonMethods.hbgMes.MesGrading(
|
||||
CommonMethods.mesConfig.GradingMesUrl,
|
||||
list[i].BarCode,
|
||||
CommonMethods.mesConfig.siteCode,
|
||||
CommonMethods.mesConfig.lineCode,
|
||||
CommonMethods.mesConfig.mesUserName,
|
||||
CommonMethods.mesConfig.equipNum,
|
||||
CommonMethods.mesConfig.MaterialCode);//分档查询
|
||||
|
||||
try
|
||||
{
|
||||
//分档接口
|
||||
//21~26 OK挡位
|
||||
var (success, mesage, mesResType) = CommonMethods.hbgMes.MesGrading(
|
||||
CommonMethods.mesConfig.GradingMesUrl,
|
||||
list[i].BarCode,
|
||||
CommonMethods.mesConfig.siteCode,
|
||||
CommonMethods.mesConfig.lineCode,
|
||||
CommonMethods.mesConfig.mesUserName,
|
||||
CommonMethods.mesConfig.equipNum,
|
||||
CommonMethods.mesConfig.MaterialCode);//分档查询
|
||||
|
||||
try
|
||||
//listGradeResult[i] = (short)26;//默认分档OK
|
||||
list[i].Remark = "外观检OK分档";
|
||||
list[i].Mes_battery_Grade = mesResType[0];
|
||||
list[i].Mes_sorting_scheme = mesResFangAnType[0];
|
||||
if (success && mesResType[0] != "NULL")
|
||||
{
|
||||
//listGradeResult[i] = (short)26;//默认分档OK
|
||||
list[i].Remark = "外观检OK分档";
|
||||
if (success && mesResType[0] != "NULL")
|
||||
|
||||
if (mesResType[0].Equals(CommonMethods.mesConfig.Grading1))
|
||||
{
|
||||
|
||||
if (mesResType[0].Equals(CommonMethods.mesConfig.Grading1))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[0] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading2))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[1] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading3))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[2] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading4))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[3] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading5))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[4] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading6))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("MES未反馈正确档位");
|
||||
}
|
||||
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[0] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading2))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[1] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading3))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[2] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading4))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[3] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading5))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[4] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else if (mesResType[0].Equals(CommonMethods.mesConfig.Grading6))
|
||||
{
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20);
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OKMES反馈档位:{mesResType[0]}";
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new Exception("MES未反馈正确档位");
|
||||
}
|
||||
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
listGradeResult[i] = (short)26;
|
||||
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档NG,MES未反馈正确档位";
|
||||
LoggerHelp.WriteLog("解析出站MES分档数据异常:{ex.Message}", "SysErrorLog");
|
||||
|
||||
}
|
||||
else
|
||||
throw new Exception("MES未反馈正确档位");
|
||||
|
||||
}
|
||||
else
|
||||
catch (Exception ex)
|
||||
{
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档,MES断连";
|
||||
listGradeResult[i] = (short)26;
|
||||
// list[i].Result = "MES NG";
|
||||
CommonMethods.PlcLink.WriteValue("D80", 1, Data_Type.Short);
|
||||
//反馈MES结果
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20); //(short)26;
|
||||
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档NG,MES未反馈正确档位";
|
||||
LoggerHelp.WriteLog("解析出站MES分档数据异常:{ex.Message}", "SysErrorLog");
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//厚度不良分档
|
||||
if (!(list[i].ThicknessPLCResult1 == 1 && list[i].ThicknessPLCResult2 == 1 && list[i].ThicknessPLCResult3 == 1))
|
||||
{
|
||||
listGradeResult[i] = 1;
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]测厚度NG";
|
||||
}
|
||||
else
|
||||
{
|
||||
//外观不良分档
|
||||
listGradeResult[i] = 2;
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检NG不分类";
|
||||
}
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检OK分档,MES断连";
|
||||
listGradeResult[i] = (short)(CommonMethods.MESGradingSet[5] + 20); //(short)26;
|
||||
// list[i].Result = "MES NG";
|
||||
CommonMethods.PlcLink.WriteValue("D80", 1, Data_Type.Short);
|
||||
//反馈MES结果
|
||||
|
||||
}
|
||||
listRes[i] = listGradeResult[i];
|
||||
list[i].Result = listGradeResult[i];
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
//厚度不良分档 1 测厚不良 2 外观不良
|
||||
if (list[i].CCD19 != 1)
|
||||
{
|
||||
listGradeResult[i] = 1;
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]测厚度NG";
|
||||
}
|
||||
else
|
||||
{
|
||||
//外观不良分档
|
||||
listGradeResult[i] = 2;
|
||||
list[i].Remark = $"出站条码[{list[i].BarCode}]外观检NG不分类";
|
||||
}
|
||||
}
|
||||
listRes[i] = listGradeResult[i];
|
||||
list[i].Result = listGradeResult[i];
|
||||
MyRes[i] = listGradeResult[i];
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
#region 结果参数
|
||||
//发送产品结果参数给MES
|
||||
if (CommonMethods.mesConfig.isUpMes)
|
||||
{
|
||||
bool Res1 = CommonMethods.hbgMes.ProducResultParam(ur2, siteCode1, lineCode1, equipNum1, materialCode1, userName1, m, unloadType, ref Mesage);
|
||||
}
|
||||
#endregion
|
||||
#region//极限件发3给PLC
|
||||
//if (ChallengeFlag == 1)
|
||||
|
||||
Reference in New Issue
Block a user