diff --git a/MaterialTraceability.Business/Impl/ABSignalReadBusiness.cs b/MaterialTraceability.Business/Impl/ABSignalReadBusiness.cs index c1eb99d..3a97e7d 100644 --- a/MaterialTraceability.Business/Impl/ABSignalReadBusiness.cs +++ b/MaterialTraceability.Business/Impl/ABSignalReadBusiness.cs @@ -418,7 +418,7 @@ namespace MaterialTraceability.Business.Impl return; } //下发禁止下料 - sendError(position); + //sendError(position); //调用MES获取数量接口 string upMaterialEaValue = GetUpMaterialQty(position, shaftInfo.bindSfc, logStr); @@ -427,7 +427,7 @@ namespace MaterialTraceability.Business.Impl LogRefreshEvent?.Invoke(LogType.MesLog, String.Format("通过MES获取收卷位{0}物料EA值为空", shaftInfo.bindSfc)); return; } - downRecord.eaValue = int.Parse(upMaterialEaValue); + downRecord.eaValue = (int)float.Parse(upMaterialEaValue); LogRefreshEvent?.Invoke(LogType.RfidLog, "收卷位物料EA:" + upMaterialEaValue); if (!SpiltAccount(position, shaftInfo, downRecord.eaValue, shaftInfo.bindSfc, new ProUpRecord(), downRecord).Result) { @@ -552,7 +552,7 @@ namespace MaterialTraceability.Business.Impl /// private string GetUpMaterialQty(int position,string bindSfc, string logStr) { - LogHelper.Info(logStr + "通过MES接口获取放卷物料的EA值"); + LogHelper.Info(logStr + "通过MES接口获取物料的EA值"); MiSFCQueryQtyServiceServiceParam sFCQueryQtyServiceServiceParam = new MiSFCQueryQtyServiceServiceParam() { url = inifile.IniReadValue("MiSFCQueryQtyServiceServiceParam", "url"), @@ -931,7 +931,7 @@ namespace MaterialTraceability.Business.Impl { url = inifile.IniReadValue("ResourceSlotConfigurationSetupForJITServiceParam", "url"), site = inifile.IniReadValue("ResourceSlotConfigurationSetupForJITServiceParam", "site"), - resource = inifile.IniReadValue("ResourceSlotConfigurationSetupForJITServiceParam", "resource"), + resource = appConfig.resource, operation = inifile.IniReadValue("ResourceSlotConfigurationSetupForJITServiceParam", "operation"), barcodeId = epc, barcodeType = inifile.IniReadValue("ResourceSlotConfigurationSetupForJITServiceParam", "barcodeType"), diff --git a/MaterialTraceability.Business/PlcBusiness.cs b/MaterialTraceability.Business/PlcBusiness.cs index f6d06a9..0c9ce68 100644 --- a/MaterialTraceability.Business/PlcBusiness.cs +++ b/MaterialTraceability.Business/PlcBusiness.cs @@ -30,6 +30,11 @@ namespace MaterialTraceability.Business private static DateTime lastReadTime_Force; private static DateTime lastReadTime_ForceSecond; //模切暂用 + + private static DateTime AB_lastReadTime_SJForceSinal; //凹版收卷结束信号 + + private static DateTime AB_lastReadTime_SJEndSinal; //凹版收卷结束信号 + #endregion @@ -78,6 +83,8 @@ namespace MaterialTraceability.Business lastReadTime_B_End = initTime; lastReadTime_Force = initTime; lastReadTime_ForceSecond = initTime; + AB_lastReadTime_SJForceSinal = initTime; + AB_lastReadTime_SJEndSinal = initTime; #endregion return plcInstance; @@ -210,8 +217,11 @@ namespace MaterialTraceability.Business { lock (string.Empty) { - plcInstance.writeInt32ByAddress(appConfig.AbAddress.收卷结束, 0); - SignalRefreshEvent?.Invoke(4, 1); + if (isReadFlag(ref AB_lastReadTime_SJEndSinal)) + { + plcInstance.writeInt32ByAddress(appConfig.AbAddress.收卷结束, 0); + SignalRefreshEvent?.Invoke(4, 1); + } } } @@ -220,14 +230,19 @@ namespace MaterialTraceability.Business if (plcInstance.readInt32ByAddress(appConfig.AbAddress.放卷异常下料) == 1) { plcInstance.writeInt32ByAddress(appConfig.AbAddress.放卷异常下料, 0); - SignalRefreshEvent?.Invoke(5, 1); + SignalRefreshEvent?.Invoke(5, 0); + } //异常下料-1B if (plcInstance.readInt32ByAddress(appConfig.AbAddress.收卷异常下料) == 1) { - plcInstance.writeInt32ByAddress(appConfig.AbAddress.收卷异常下料, 0); - SignalRefreshEvent?.Invoke(5, 2); + if (isReadFlag(ref AB_lastReadTime_SJForceSinal)) + { + plcInstance.writeInt32ByAddress(appConfig.AbAddress.收卷异常下料, 0); + SignalRefreshEvent?.Invoke(5, 1); + } } + } #endregion