|
|
@@ -1,4 +1,5 @@ |
|
|
|
using BPASmartClient.CustomResource.Pages.Model; |
|
|
|
using BPA.Message; |
|
|
|
using BPASmartClient.CustomResource.Pages.Model; |
|
|
|
using BPASmartClient.Helper; |
|
|
|
using BPASmartClient.JXJFoodBigStation.Model.HK_PLC; |
|
|
|
using BPASmartClient.JXJFoodBigStation.Model.Siemens; |
|
|
@@ -1069,9 +1070,7 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
} |
|
|
|
//以下为新增,复位DB99托盘号,配方号,桶重量参数,以及配方下发确认和配料完成。 |
|
|
|
StockBinParReset(); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", false); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", false); |
|
|
|
GVL_BigStation.Recipe1DosingFinish = false; |
|
|
|
|
|
|
|
} |
|
|
|
break; |
|
|
|
case 10: |
|
|
@@ -1137,6 +1136,9 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBX230.0", true)}"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBW232", (short)TrayCode)}"); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX0.3", false); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", false); |
|
|
|
GVL_BigStation.Recipe1DosingFinish = false; |
|
|
|
GVL_BigStation.Recipe1DosingStatus = 0; |
|
|
|
GVL_BigStation.Order_CancelStep = 32; |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:{code}"); |
|
|
@@ -1171,6 +1173,9 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBX230.0", true)}"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBW232", (short)TrayCode)}"); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX0.4", false); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", false); |
|
|
|
GVL_BigStation.Recipe2DosingFinish = false; |
|
|
|
GVL_BigStation.Recipe2DosingStatus = 0; |
|
|
|
GVL_BigStation.Order_CancelStep = 42; |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:【{code}】"); |
|
|
@@ -1205,6 +1210,9 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBX230.0", true)}"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBW232", (short)TrayCode)}"); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX0.5", false); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.6", false); |
|
|
|
GVL_BigStation.Recipe3DosingFinish = false; |
|
|
|
GVL_BigStation.Recipe3DosingStatus = 0; |
|
|
|
GVL_BigStation.Order_CancelStep = 52; |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:【{code}】"); |
|
|
@@ -1239,6 +1247,9 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBX230.0", true)}"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"海科PLC写入{HKDevice.HK_PLC_S7.Write("DB99.DBW232", (short)TrayCode)}"); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX0.6", false); |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.7", false); |
|
|
|
GVL_BigStation.Recipe4DosingFinish = false; |
|
|
|
GVL_BigStation.Recipe4DosingStatus = 0; |
|
|
|
GVL_BigStation.Order_CancelStep = 62; |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"PLC正在执行配料流程,取消订单:【{code}】"); |
|
|
@@ -1376,35 +1387,39 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
double a = DateTime.Now.Subtract(GVL_BigStation.DosingRecipe1Time).TotalSeconds; |
|
|
|
FinishData.ProcessTime = Convert.ToInt16(a); |
|
|
|
//SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【1】,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子。"); |
|
|
|
|
|
|
|
SendDataOperation(() => |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
}, () => |
|
|
|
{ |
|
|
|
return SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0"); |
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
GVL_BigStation.Recipe1DosingStatus = 30; |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", true); |
|
|
|
} |
|
|
|
|
|
|
|
var result = SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
if (!string.IsNullOrEmpty(result) && result.Contains("成功")) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【1】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成信号写入复位。"); |
|
|
|
} |
|
|
|
else |
|
|
|
if (GVL_BigStation.Recipe1DosingStatus == 30) |
|
|
|
{ |
|
|
|
if (SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程) |
|
|
|
{ |
|
|
|
if (SiemensDevice.IsConnected) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【1】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成,已发送数据,但复位请求完成信号失败。"); |
|
|
|
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0")) |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【1】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,已将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe1DosingStatus = 40; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
Thread.Sleep(3000); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【1】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe1DosingStatus = 40; |
|
|
|
} |
|
|
|
|
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", true); |
|
|
|
GVL_BigStation.Recipe1DosingStatus = 3; |
|
|
|
} |
|
|
|
if (GVL_BigStation.Recipe1DosingStatus == 3 && HKDevice.PlcRead.Recipe1DosingFinish == false) |
|
|
|
if (GVL_BigStation.Recipe1DosingStatus == 40 && HKDevice.PlcRead.Recipe1DosingFinish == false) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.4", false); |
|
|
|
SiemensRecipeQueue1.TryDequeue(out code); |
|
|
@@ -1513,37 +1528,40 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
double a = DateTime.Now.Subtract(GVL_BigStation.DosingRecipe2Time).TotalSeconds; |
|
|
|
FinishData.ProcessTime = Convert.ToInt16(a); |
|
|
|
//SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子"); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SendDataOperation(() => |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
}, () => |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", true); |
|
|
|
GVL_BigStation.Recipe2DosingStatus = 30; |
|
|
|
} |
|
|
|
if (GVL_BigStation.Recipe2DosingStatus == 30) |
|
|
|
{ |
|
|
|
if (SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程) |
|
|
|
{ |
|
|
|
if (SiemensDevice.IsConnected) |
|
|
|
{ |
|
|
|
return SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0"); |
|
|
|
}); |
|
|
|
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0")) |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
|
|
|
|
var result = SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
if (!string.IsNullOrEmpty(result) && result.Contains("成功")) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成信号写入复位。"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成,已发送数据,但复位请求完成信号失败。"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,已将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe2DosingStatus = 40; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
Thread.Sleep(3000); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【2】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe2DosingStatus = 40; |
|
|
|
} |
|
|
|
|
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", true); |
|
|
|
GVL_BigStation.Recipe2DosingStatus = 3; |
|
|
|
} |
|
|
|
|
|
|
|
if (GVL_BigStation.Recipe2DosingStatus == 3 && HKDevice.PlcRead.Recipe2DosingFinish == false) |
|
|
|
|
|
|
|
if (GVL_BigStation.Recipe2DosingStatus == 40 && HKDevice.PlcRead.Recipe2DosingFinish == false) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.5", false); |
|
|
|
SiemensRecipeQueue2.TryDequeue(out code); |
|
|
@@ -1652,35 +1670,39 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
double a = DateTime.Now.Subtract(GVL_BigStation.DosingRecipe3Time).TotalSeconds; |
|
|
|
FinishData.ProcessTime = Convert.ToInt16(a); |
|
|
|
//SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子"); |
|
|
|
|
|
|
|
SendDataOperation(() => |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
}, () => |
|
|
|
{ |
|
|
|
return SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0"); |
|
|
|
}); |
|
|
|
} |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.6", true); |
|
|
|
GVL_BigStation.Recipe3DosingStatus = 30; |
|
|
|
} |
|
|
|
|
|
|
|
var result = SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
if (!string.IsNullOrEmpty(result) && result.Contains("成功")) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成信号写入复位。"); |
|
|
|
} |
|
|
|
else |
|
|
|
if (GVL_BigStation.Recipe3DosingStatus == 30) |
|
|
|
{ |
|
|
|
if (SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程) |
|
|
|
{ |
|
|
|
if (SiemensDevice.IsConnected) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成,已发送数据,但复位请求完成信号失败。"); |
|
|
|
} |
|
|
|
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0")) |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
|
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,已将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe3DosingStatus = 40; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
Thread.Sleep(3000); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【3】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe3DosingStatus = 40; |
|
|
|
} |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.6", true); |
|
|
|
GVL_BigStation.Recipe3DosingStatus = 3; |
|
|
|
} |
|
|
|
if (GVL_BigStation.Recipe3DosingStatus == 3 && HKDevice.PlcRead.Recipe3DosingFinish == false) |
|
|
|
|
|
|
|
if (GVL_BigStation.Recipe3DosingStatus == 40 && HKDevice.PlcRead.Recipe3DosingFinish == false) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.6", false); |
|
|
|
SiemensRecipeQueue3.TryDequeue(out code); |
|
|
@@ -1788,34 +1810,40 @@ namespace BPASmartClient.JXJFoodBigStation.Model |
|
|
|
double a = DateTime.Now.Subtract(GVL_BigStation.DosingRecipe4Time).TotalSeconds; |
|
|
|
FinishData.ProcessTime = Convert.ToInt16(a); |
|
|
|
//SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,配方编号:{code},托盘编号:{trayCode},配料完成,将信号反馈给西门子"); |
|
|
|
|
|
|
|
} |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.7", true); |
|
|
|
GVL_BigStation.Recipe4DosingStatus = 30; |
|
|
|
} |
|
|
|
|
|
|
|
SendDataOperation(() => |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
}, () => |
|
|
|
if (GVL_BigStation.Recipe4DosingStatus == 30) |
|
|
|
{ |
|
|
|
if (SiemensRecipes.ElementAt(index).RecipesSource == RecipeSource.远程) |
|
|
|
{ |
|
|
|
if (SiemensDevice.IsConnected) |
|
|
|
{ |
|
|
|
return SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0"); |
|
|
|
}); |
|
|
|
if (SiemensDevice.Siemens_PLC_S7.Read<bool>("DB2361.DBX0.0")) |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
|
|
|
|
var result = SiemensDevice.Siemens_PLC_S7.Write<bool>("DB2361.DBX330.0", false, 5); |
|
|
|
if (!string.IsNullOrEmpty(result) && result.Contains("成功")) |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成信号写入复位。"); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,托盘编号:【{trayCode}】,配方编号:【{code}】,配料完成,已发送数据,但复位请求完成信号失败。"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,已将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe4DosingStatus = 40; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
SiemensDevice.Siemens_PLC_S7.WriteClass<DL_Finish_DB>(FinishData, 2361); |
|
|
|
Thread.Sleep(3000); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,西门子未连接或配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
MessageNotify.GetInstance.ShowRunLog($"配方队列【4】,配方编号:【{code}】,托盘编号:【{trayCode}】,配料完成,配方为本地下发未将完成数据反馈至MES系统。"); |
|
|
|
GVL_BigStation.Recipe4DosingStatus = 40; |
|
|
|
} |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.7", true); |
|
|
|
GVL_BigStation.Recipe4DosingStatus = 3; |
|
|
|
} |
|
|
|
if (GVL_BigStation.Recipe4DosingStatus == 3 && HKDevice.PlcRead.Recipe4DosingFinish == false) |
|
|
|
|
|
|
|
if (GVL_BigStation.Recipe4DosingStatus == 40 && HKDevice.PlcRead.Recipe4DosingFinish == false) |
|
|
|
{ |
|
|
|
HKDevice.HK_PLC_S7.Write("DB99.DBX1.7", false); |
|
|
|
SiemensRecipeQueue4.TryDequeue(out code); |
|
|
|