|
|
@@ -29,6 +29,13 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
public static DosingLogicControl _instance; |
|
|
|
public static DosingLogicControl GetInstance => _instance ??= new DosingLogicControl(); |
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 桶净重 |
|
|
|
/// </summary> |
|
|
|
public ushort RollerNetweight =20; |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 滚筒线PLC数据 |
|
|
|
/// </summary> |
|
|
@@ -1128,6 +1135,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
#region 清洗台到线体4 |
|
|
|
if (objData.state == "ROLLER_LOAD_FINISH" && LTenrobotJobId.FirstOrDefault(p => p == objData.robotJobId) != null && objData.jobData.startPointCode == "" && objData.jobData.targetPointCode == "")//指定上料位置上料完成,指清戏台空桶到上料 |
|
|
|
{ |
|
|
|
globalVar.AllowNextEmptyRollerToClean = true; |
|
|
|
MessageLog.GetInstance.ShowRunLog("清洗台空桶装载完成"); |
|
|
|
AgvViewModel.GetInstance().Set小车是否承载物品(agvCode[objData.jobData.agvCode], IsBool.OnllYes); |
|
|
|
AgvViewModel.GetInstance().Set小车运动(agvCode[objData.jobData.agvCode], CartMotionTrajectory.hs_4);//去四号空桶线 |
|
|
@@ -2045,6 +2053,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
//{ |
|
|
|
// globalVar.LOneTaskLock = true; |
|
|
|
LOneRecipeDataToPlc(); |
|
|
|
LineOneRecipeExecuteConfirm(); |
|
|
|
LOneLoadRoller(); |
|
|
|
LOneFryPotInputMaterial(); |
|
|
|
LOneFallMaterial(); |
|
|
@@ -2063,6 +2072,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
//{ |
|
|
|
// globalVar.LTwoTaskLock = true; |
|
|
|
LTwoRecipeDataToPlc(); |
|
|
|
LineOneRecipeExecuteConfirm(); |
|
|
|
LTwoAgvLoadRoller(); |
|
|
|
LTwoFryPotInputMaterial(); |
|
|
|
LTwoFallMaterial(); |
|
|
@@ -2081,6 +2091,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
//{ |
|
|
|
// globalVar.LThreeTaskLock = true; |
|
|
|
LThreeRecipeDataToPlc(); |
|
|
|
LineOneRecipeExecuteConfirm(); |
|
|
|
LThreeAgvLoadRoller(); |
|
|
|
LThreeFryPotInputMaterial(); |
|
|
|
LThreeFallMaterial(); |
|
|
@@ -2151,7 +2162,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (AlarmHelper<AlarmInfo>.Alarm.LOneRollerTrouble == 0)//输送线无故障 |
|
|
|
{ |
|
|
|
//线体1到清洗台 |
|
|
|
if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun) |
|
|
|
if (!globalVar.rollerLineOne.IsEpmtyBefore && globalVar.rollerLineOne.CanRun&& globalVar.AllowNextEmptyRollerToClean) |
|
|
|
{ |
|
|
|
var res = InputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineOne.StationEight); |
|
|
|
if ((globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0) && InputMaterialQuene.Count > 0 && globalVar.rollerLineOne.StationEight != InputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineOne.StationEight != 0 && globalVar.rollerLineOne.EmptyRollerNums.Count > 0 && globalVar.rollerLineOne.StationEight == globalVar.rollerLineOne.EmptyRollerNums.ElementAt(0)))//一种情况工位8上面有桶且不是配方上的原料桶且工位8的桶号和plc上报的桶号一致,即空桶,另一种在没有下单的情况下,线体上的桶都认为是空桶 |
|
|
@@ -2165,10 +2176,11 @@ namespace FryPot_DosingSystem.Control |
|
|
|
string info = AGVHelper.GetInstance.AgvLeaveLOneToClean(id);//1号线到洗桶处 |
|
|
|
LSevenrobotJobId.Add(id); |
|
|
|
// Thread.Sleep(500); |
|
|
|
if (LineToCleanCarryTaskErrorCodeAnalysis(info, 1)) |
|
|
|
if (LineToCleanCarryTaskErrorCodeAnalysis(info, 1))//AGV呼叫成功 |
|
|
|
{ |
|
|
|
|
|
|
|
globalVar.rollerLineOne.IsEpmtyBefore = true; |
|
|
|
globalVar.AllowNextEmptyRollerToClean = false; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -2194,7 +2206,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
// 线体2到清洗台 |
|
|
|
if (AlarmHelper<AlarmInfo>.Alarm.LTwoRollerTrouble == 0)//输送线无故障 |
|
|
|
{ |
|
|
|
if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun) |
|
|
|
if (!globalVar.rollerLineTwo.IsEpmtyBefore && globalVar.rollerLineTwo.CanRun&& globalVar.AllowNextEmptyRollerToClean) |
|
|
|
{ |
|
|
|
var res = LTwoInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineTwo.StationEight); |
|
|
|
if ((globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0) && LTwoInputMaterialQuene.Count > 0 && globalVar.rollerLineTwo.StationEight != LTwoInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineTwo.StationEight != 0 && globalVar.rollerLineTwo.EmptyRollerNums.Count > 0 && globalVar.rollerLineTwo.StationEight == globalVar.rollerLineTwo.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 |
|
|
@@ -2211,6 +2223,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
|
|
|
|
globalVar.rollerLineTwo.IsEpmtyBefore = true; |
|
|
|
globalVar.AllowNextEmptyRollerToClean = false; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -2236,7 +2249,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
//线体3到清洗台 |
|
|
|
if (AlarmHelper<AlarmInfo>.Alarm.LThreeRollerTrouble == 0)//输送线无故障 |
|
|
|
{ |
|
|
|
if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun) |
|
|
|
if (!globalVar.rollerLineThree.IsEpmtyBefore && globalVar.rollerLineThree.CanRun && globalVar.AllowNextEmptyRollerToClean) |
|
|
|
{ |
|
|
|
var res = LThreeInputMaterialQuene.FirstOrDefault(p => p.materialType.MaterialLoc == globalVar.rollerLineThree.StationEight); |
|
|
|
if ((globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0) && LThreeInputMaterialQuene.Count > 0 && globalVar.rollerLineThree.StationEight != LThreeInputMaterialQuene.ElementAt(0).materialType.MaterialLoc) || (res == null && globalVar.rollerLineThree.StationEight != 0 && globalVar.rollerLineThree.EmptyRollerNums.Count > 0 && globalVar.rollerLineThree.StationEight == globalVar.rollerLineThree.EmptyRollerNums.ElementAt(0)))//工位8上面有桶且不是配方上的原料桶,即空桶 |
|
|
@@ -2253,6 +2266,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
{ |
|
|
|
|
|
|
|
globalVar.rollerLineThree.IsEpmtyBefore = true; |
|
|
|
globalVar.AllowNextEmptyRollerToClean = false; |
|
|
|
} |
|
|
|
else//呼叫失败 |
|
|
|
{ |
|
|
@@ -2405,6 +2419,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LThreeCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【3】号滚筒线【{globalVar.LThreeCurrentRecipeName}】 配方制作完成"); |
|
|
|
PlcLineThreeRecipeDataReset(); |
|
|
|
if (globalVar.LThreeFryPotSerial == 3) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryThree.TotalProduct++; |
|
|
@@ -2449,7 +2464,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
materialType = result.materialCollection[i], |
|
|
|
materialId = result.RecipeId |
|
|
|
}); |
|
|
|
RollerThreeDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight);//3号滚筒线桶号以及重量数据下发 |
|
|
|
RollerThreeDataWrite(i, result.materialCollection[i].MaterialLoc,(ushort) (result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//3号滚筒线桶号以及重量数据、偏差量下发 |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -2461,7 +2476,8 @@ namespace FryPot_DosingSystem.Control |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count);//发送3号滚筒线工序数据 |
|
|
|
globalVar.rollerLineThree.RecipeComMidSingle = 0; |
|
|
|
// globalVar.rollerLineThree.RecipeComMidSingle = 0; |
|
|
|
WritePlcData("", 1);//配方开始执行命令 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -2480,6 +2496,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LTwoCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【2】号滚筒线【{globalVar.LTwoCurrentRecipeName}】 配方制作完成"); |
|
|
|
PlcLineTwoRecipeDataReset(); |
|
|
|
if (globalVar.LTwoFryPotSerial == 2) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryTwo.TotalProduct++; |
|
|
@@ -2552,7 +2569,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
materialType = result.materialCollection[i], |
|
|
|
materialId = result.RecipeId |
|
|
|
}); |
|
|
|
RollerTwoDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight);//2号滚筒线桶号以及重量数据下发 |
|
|
|
RollerTwoDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//2号滚筒线桶号以及重量、偏差量数据下发 |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -2564,7 +2581,8 @@ namespace FryPot_DosingSystem.Control |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count);//发送2号滚筒线工序数据 |
|
|
|
globalVar.rollerLineTwo.RecipeComMidSingle = 0; |
|
|
|
//globalVar.rollerLineTwo.RecipeComMidSingle = 0; |
|
|
|
WritePlcData("", 1);//配方开始执行命令 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@@ -2580,6 +2598,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
if (globalVar.LOneCurrentRecipeName != string.Empty) |
|
|
|
{ |
|
|
|
MessageLog.GetInstance.ShowUserLog($"【1】号滚筒线【{globalVar.LOneCurrentRecipeName}】 配方制作完成"); |
|
|
|
PlcLineOneRecipeDataReset(); |
|
|
|
if (globalVar.LOneFryPotSerial == 1) |
|
|
|
{ |
|
|
|
FryPotMonitorManage.GetInstance.fryOne.TotalProduct++; |
|
|
@@ -2649,7 +2668,8 @@ namespace FryPot_DosingSystem.Control |
|
|
|
materialType = result.materialCollection[i], |
|
|
|
materialId = result.RecipeId |
|
|
|
}); |
|
|
|
RollerOneDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight);//1号滚筒线桶号以及重量数据下发 |
|
|
|
RollerOneDataWrite(i, result.materialCollection[i].MaterialLoc, (ushort)(result.materialCollection[i].MaterialWeight+RollerNetweight), result.materialCollection[i].MaterialOffset);//1号滚筒线桶号以及重量、偏差量数据下发 |
|
|
|
|
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
@@ -2661,7 +2681,8 @@ namespace FryPot_DosingSystem.Control |
|
|
|
} |
|
|
|
} |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1009", (ushort)result.materialCollection.Count);//发送1号滚筒线工序数据 |
|
|
|
globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 |
|
|
|
// globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 |
|
|
|
WritePlcData("", 1);//配方开始执行命令 |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@@ -2669,89 +2690,100 @@ namespace FryPot_DosingSystem.Control |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 数据下发PLC |
|
|
|
/// 线体1配方执行等待下位确认 |
|
|
|
/// </summary> |
|
|
|
//public void RecipeDataToPlc() |
|
|
|
//{ |
|
|
|
// if (RecipeQuene.Count > 0 && OutputMaterialQuene.Count == 0 && InputMaterialQuene.Count == 0)//后续添加其它限制条件 |
|
|
|
// { |
|
|
|
// //NewRecipeModel newRecipe = new NewRecipeModel(); |
|
|
|
// //MaterialType material = new MaterialType(); |
|
|
|
// if (RecipeQuene.TryDequeue(out NewRecipeModel result)) |
|
|
|
// { |
|
|
|
// //newRecipe = result; |
|
|
|
// MessageLog.GetInstance.ShowRunLog($"开始制作【{result.RecipeName}】 配方"); |
|
|
|
// //for (int k = 0; k < newRecipe.materialCollection.Count - 1; k++) |
|
|
|
// //{ |
|
|
|
// // for (int j = 0; j < newRecipe.materialCollection.Count - 1 - k; j++) |
|
|
|
// // { |
|
|
|
// // if (newRecipe.materialCollection[j].MaterialLoc > newRecipe.materialCollection[j + 1].MaterialLoc) |
|
|
|
// // { |
|
|
|
// // material = newRecipe.materialCollection[j]; |
|
|
|
// // // newRecipe.materialCollection[j] = null; |
|
|
|
// // newRecipe.materialCollection[j] = newRecipe.materialCollection[j + 1]; |
|
|
|
// // // newRecipe.materialCollection[j + 1] = null; |
|
|
|
// // newRecipe.materialCollection[j + 1] = material; |
|
|
|
// // } |
|
|
|
// // } |
|
|
|
// //} |
|
|
|
// for (int i = 0; i < result.materialCollection.Count; i++) //遍历单个配方中所有物料 |
|
|
|
// { |
|
|
|
// //将配方中原料加入新的队列 |
|
|
|
// InputMaterialQuene.Enqueue(new MaterialInfo() |
|
|
|
// { |
|
|
|
// materialType = result.materialCollection[i], |
|
|
|
// materialId = result.RecipeId |
|
|
|
// }); |
|
|
|
// ushort n = result.materialCollection[i].MaterialLoc; |
|
|
|
// switch (n / 100) |
|
|
|
// { |
|
|
|
// case 1: |
|
|
|
// case 4: RollerOneDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight); break;//1号滚筒线桶号以及重量数据下发 |
|
|
|
// case 2: |
|
|
|
// case 5: RollerTwoDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight); break;//2号滚筒线桶号以及重量数据下发 |
|
|
|
// case 3: RollerThreeDataWrite(i, result.materialCollection[i].MaterialLoc, result.materialCollection[i].MaterialWeight); break;//3号滚筒线桶号以及重量数据下发 |
|
|
|
// } |
|
|
|
// } |
|
|
|
// switch (result.materialCollection[0].MaterialLoc / 100) |
|
|
|
// { |
|
|
|
// case 1: |
|
|
|
// DeviceOperate.GetInstance.WritePlcData("D1009", (ushort)result.materialCollection.Count); break;//发送1号滚筒线工序数据 |
|
|
|
// case 2: |
|
|
|
// DeviceOperate.GetInstance.WritePlcData("D1026", (ushort)result.materialCollection.Count); break;//发送2号滚筒线工序数据 |
|
|
|
// case 3: |
|
|
|
// DeviceOperate.GetInstance.WritePlcData("D1043", (ushort)result.materialCollection.Count); break;//发送3号滚筒线工序数据 |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
public void LineOneRecipeExecuteConfirm() |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineOne.RecipeComMidSingle == 1) |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineOne.ExcuteIsConfirm == 1) //收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineOne.NextStart = true; |
|
|
|
globalVar.rollerLineOne.RecipeComMidSingle = 0;//配方完成的中转信号置0 |
|
|
|
} |
|
|
|
else if (globalVar.rollerLineOne.ExcuteIsConfirm == 2) //收到下位取消执行命令 |
|
|
|
{ |
|
|
|
globalVar.rollerLineOne.NextStart = false; |
|
|
|
//清空配方数据队列 |
|
|
|
PlcLineOneRecipeDataReset();//PLC复位 |
|
|
|
InputMaterialQuene.Clear(); |
|
|
|
MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); |
|
|
|
MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【1】号线体【{globalVar.LOneCurrentRecipeName}】配方的制作"); |
|
|
|
globalVar.LOneCurrentRecipeName = string.Empty; |
|
|
|
} |
|
|
|
else //未收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineOne.NextStart = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//} |
|
|
|
/// <summary> |
|
|
|
/// AGV到配方线体1装桶以及出料到炒锅 |
|
|
|
/// 线体2配方执行等待下位确认 |
|
|
|
/// </summary> |
|
|
|
//public void AgvLoadRoller() |
|
|
|
//{ |
|
|
|
// //lineAlarm = 0; |
|
|
|
// if (InputMaterialQuene.Count > 0) |
|
|
|
// { |
|
|
|
// switch (InputMaterialQuene.ElementAt(0).materialType.MaterialLoc / 100) |
|
|
|
// { |
|
|
|
// case 1: |
|
|
|
// case 4: AgvToLineOneLoadRoller(); AgvFromLineOneToFryPot(); break;//AGV到1号线体装桶 |
|
|
|
// case 2: |
|
|
|
// case 5: AgvToLineTwoLoadRoller(); AgvFromLineTwoToFryPot(); break;//AGV到2号线体装桶 |
|
|
|
// case 3: AgvToLineThreeLoadRoller(); AgvFromLineThreeToFryPot(); break;//AGV到3号线体装桶 |
|
|
|
// } |
|
|
|
// } |
|
|
|
public void LineTwoRecipeExecuteConfirm() |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineTwo.RecipeComMidSingle == 1) |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineTwo.ExcuteIsConfirm == 1) //收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineTwo.NextStart = true; |
|
|
|
globalVar.rollerLineTwo.RecipeComMidSingle = 0;//配方完成的中转信号置0 |
|
|
|
} |
|
|
|
else if (globalVar.rollerLineTwo.ExcuteIsConfirm == 2) //收到下位取消执行命令 |
|
|
|
{ |
|
|
|
globalVar.rollerLineTwo.NextStart = false; |
|
|
|
//清空配方数据队列 |
|
|
|
PlcLineTwoRecipeDataReset();//PLC复位 |
|
|
|
LTwoInputMaterialQuene.Clear(); |
|
|
|
MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); |
|
|
|
MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【2】号线体【{globalVar.LTwoCurrentRecipeName}】配方的制作"); |
|
|
|
globalVar.LTwoCurrentRecipeName = string.Empty; |
|
|
|
} |
|
|
|
else //未收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineTwo.NextStart = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// 线体3配方执行等待下位确认 |
|
|
|
/// </summary> |
|
|
|
public void LineThreeRecipeExecuteConfirm() |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineThree.RecipeComMidSingle == 1) |
|
|
|
{ |
|
|
|
if (globalVar.rollerLineThree.ExcuteIsConfirm == 1) //收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineThree.NextStart = true; |
|
|
|
globalVar.rollerLineThree.RecipeComMidSingle = 0;//配方完成的中转信号置0 |
|
|
|
} |
|
|
|
else if (globalVar.rollerLineThree.ExcuteIsConfirm == 2) //收到下位取消执行命令 |
|
|
|
{ |
|
|
|
globalVar.rollerLineThree.NextStart = false; |
|
|
|
//清空配方数据队列 |
|
|
|
PlcLineThreeRecipeDataReset();//PLC复位 |
|
|
|
LThreeInputMaterialQuene.Clear(); |
|
|
|
MessageLog.GetInstance.ShowRunLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); |
|
|
|
MessageLog.GetInstance.ShowUserLog($"下位机操作员取消【3】号线体【{globalVar.LThreeCurrentRecipeName}】配方的制作"); |
|
|
|
globalVar.LThreeCurrentRecipeName = string.Empty; |
|
|
|
} |
|
|
|
else //未收到下位执行信号 |
|
|
|
{ |
|
|
|
globalVar.rollerLineThree.NextStart = false; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//} |
|
|
|
/// <summary> |
|
|
|
/// AGV到配方线体1装桶以及出料到炒锅 |
|
|
|
/// </summary> |
|
|
|
public void LOneLoadRoller() |
|
|
|
{ |
|
|
|
if (InputMaterialQuene.Count > 0) |
|
|
|
if (InputMaterialQuene.Count > 0&& globalVar.rollerLineOne.NextStart) |
|
|
|
{ |
|
|
|
AgvToLineOneLoadRoller(); |
|
|
|
AgvFromLineOneToFryPot();//AGV到1号线体装桶 |
|
|
@@ -2777,7 +2809,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
/// </summary> |
|
|
|
public void LTwoAgvLoadRoller() |
|
|
|
{ |
|
|
|
if (LTwoInputMaterialQuene.Count > 0) |
|
|
|
if (LTwoInputMaterialQuene.Count > 0&& globalVar.rollerLineTwo.NextStart) |
|
|
|
{ |
|
|
|
AgvToLineTwoLoadRoller(); |
|
|
|
AgvFromLineTwoToFryPot();//AGV到2号线体装桶 |
|
|
@@ -2803,7 +2835,7 @@ namespace FryPot_DosingSystem.Control |
|
|
|
/// </summary> |
|
|
|
public void LThreeAgvLoadRoller() |
|
|
|
{ |
|
|
|
if (LThreeInputMaterialQuene.Count > 0) |
|
|
|
if (LThreeInputMaterialQuene.Count > 0&& globalVar.rollerLineThree.NextStart) |
|
|
|
{ |
|
|
|
|
|
|
|
AgvToLineThreeLoadRoller(); |
|
|
@@ -4241,41 +4273,49 @@ namespace FryPot_DosingSystem.Control |
|
|
|
/// <param name="count"></param> |
|
|
|
/// <param name="materialLoc"></param> |
|
|
|
/// <param name="materialWeight"></param> |
|
|
|
public void RollerOneDataWrite(int count, ushort materialLoc, ushort materialWeight) |
|
|
|
public void RollerOneDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) |
|
|
|
{ |
|
|
|
switch (count) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1001", materialLoc);//桶1位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1010", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1010", materialWeight);//桶1重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重1量偏差 |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1002", materialLoc);//桶2位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1011", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶2重量偏差 |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1003", materialLoc);//桶3位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1012", materialWeight);//桶3重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶3重量偏差 |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1004", materialLoc);//桶4位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1013", materialWeight);//桶4重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶4重量偏差 |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1005", materialLoc);//桶5位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1014", materialWeight);//桶5重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶5重量偏差 |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1006", materialLoc);//桶6位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1015", materialWeight);//桶6重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶6重量偏差 |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1007", materialLoc);//桶7位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1016", materialWeight);//桶7重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶7重量偏差 |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1008", materialLoc);//桶8位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1017", materialWeight);//桶8重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶8重量偏差 |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
@@ -4286,41 +4326,49 @@ namespace FryPot_DosingSystem.Control |
|
|
|
/// <param name="count"></param> |
|
|
|
/// <param name="materialLoc"></param> |
|
|
|
/// <param name="materialWeight"></param> |
|
|
|
public void RollerTwoDataWrite(int count, ushort materialLoc, ushort materialWeight) |
|
|
|
public void RollerTwoDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) |
|
|
|
{ |
|
|
|
switch (count) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1018", materialLoc);//桶1位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1027", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重1量偏差 |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1019", materialLoc);//桶2位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1028", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重2量偏差 |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1020", materialLoc);//桶3位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1029", materialWeight);//桶3重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重3量偏差 |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1021", materialLoc);//桶4位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1030", materialWeight);//桶4重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重4量偏差 |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1022", materialLoc);//桶5位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1031", materialWeight);//桶5重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重5量偏差 |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1023", materialLoc);//桶6位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1032", materialWeight);//桶6重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重6量偏差 |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1024", materialLoc);//桶7位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1033", materialWeight);//桶7重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重7量偏差 |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1025", materialLoc);//桶8位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1034", materialWeight);//桶8重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重8量偏差 |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
@@ -4331,41 +4379,49 @@ namespace FryPot_DosingSystem.Control |
|
|
|
/// <param name="count"></param> |
|
|
|
/// <param name="materialLoc"></param> |
|
|
|
/// <param name="materialWeight"></param> |
|
|
|
public void RollerThreeDataWrite(int count, ushort materialLoc, ushort materialWeight) |
|
|
|
public void RollerThreeDataWrite(int count, ushort materialLoc, ushort materialWeight,float materialOffset) |
|
|
|
{ |
|
|
|
switch (count) |
|
|
|
{ |
|
|
|
case 0: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1035", materialLoc);//桶1位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1044", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1044", materialWeight);//桶1重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重1量偏差 |
|
|
|
break; |
|
|
|
case 1: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1036", materialLoc);//桶2位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1045", materialWeight);//桶2重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重2量偏差 |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1037", materialLoc);//桶3位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1046", materialWeight);//桶3重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重3量偏差 |
|
|
|
break; |
|
|
|
case 3: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1038", materialLoc);//桶4位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1047", materialWeight);//桶4重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重4量偏差 |
|
|
|
break; |
|
|
|
case 4: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1039", materialLoc);//桶5位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1048", materialWeight);//桶5重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重5量偏差 |
|
|
|
break; |
|
|
|
case 5: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1040", materialLoc);//桶6位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1049", materialWeight);//桶6重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重6量偏差 |
|
|
|
break; |
|
|
|
case 6: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1041", materialLoc);//桶7位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1050", materialWeight);//桶7重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重7量偏差 |
|
|
|
break; |
|
|
|
case 7: |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1042", materialLoc);//桶8位置 |
|
|
|
DeviceOperate.GetInstance.WritePlcData("D1051", materialWeight);//桶8重量 |
|
|
|
DeviceOperate.GetInstance.WriteRealPlcData("", materialOffset);//桶重8量偏差 |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
@@ -4521,5 +4577,74 @@ namespace FryPot_DosingSystem.Control |
|
|
|
FryPotThreeAlarm = 1; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// PLC线体1配方数据复位功能 |
|
|
|
/// </summary> |
|
|
|
public void PlcLineOneRecipeDataReset() |
|
|
|
{ |
|
|
|
WritePlcData("D1001",0); |
|
|
|
WritePlcData("D1002", 0); |
|
|
|
WritePlcData("D1003", 0); |
|
|
|
WritePlcData("D1004", 0); |
|
|
|
WritePlcData("D1005", 0); |
|
|
|
WritePlcData("D1006", 0); |
|
|
|
WritePlcData("D1007", 0); |
|
|
|
WritePlcData("D1008", 0); |
|
|
|
WritePlcData("D1009", 0); |
|
|
|
WritePlcData("D1010", 0); |
|
|
|
WritePlcData("D1011", 0); |
|
|
|
WritePlcData("D1012", 0); |
|
|
|
WritePlcData("D1013", 0); |
|
|
|
WritePlcData("D1014", 0); |
|
|
|
WritePlcData("D1015", 0); |
|
|
|
WritePlcData("D1016", 0); |
|
|
|
WritePlcData("D1017", 0); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// PLC线体2配方数据复位功能 |
|
|
|
/// </summary> |
|
|
|
public void PlcLineTwoRecipeDataReset() |
|
|
|
{ |
|
|
|
WritePlcData("D1018", 0); |
|
|
|
WritePlcData("D1019", 0); |
|
|
|
WritePlcData("D1020", 0); |
|
|
|
WritePlcData("D1021", 0); |
|
|
|
WritePlcData("D1022", 0); |
|
|
|
WritePlcData("D1023", 0); |
|
|
|
WritePlcData("D1024", 0); |
|
|
|
WritePlcData("D1025", 0); |
|
|
|
WritePlcData("D1026", 0); |
|
|
|
WritePlcData("D1027", 0); |
|
|
|
WritePlcData("D1028", 0); |
|
|
|
WritePlcData("D1029", 0); |
|
|
|
WritePlcData("D1030", 0); |
|
|
|
WritePlcData("D1031", 0); |
|
|
|
WritePlcData("D1032", 0); |
|
|
|
WritePlcData("D1033", 0); |
|
|
|
WritePlcData("D1034", 0); |
|
|
|
} |
|
|
|
/// <summary> |
|
|
|
/// PLC线体3配方数据复位功能 |
|
|
|
/// </summary> |
|
|
|
public void PlcLineThreeRecipeDataReset() |
|
|
|
{ |
|
|
|
WritePlcData("D1035", 0); |
|
|
|
WritePlcData("D1036", 0); |
|
|
|
WritePlcData("D1037", 0); |
|
|
|
WritePlcData("D1038", 0); |
|
|
|
WritePlcData("D1039", 0); |
|
|
|
WritePlcData("D1040", 0); |
|
|
|
WritePlcData("D1041", 0); |
|
|
|
WritePlcData("D1042", 0); |
|
|
|
WritePlcData("D1043", 0); |
|
|
|
WritePlcData("D1044", 0); |
|
|
|
WritePlcData("D1045", 0); |
|
|
|
WritePlcData("D1046", 0); |
|
|
|
WritePlcData("D1047", 0); |
|
|
|
WritePlcData("D1048", 0); |
|
|
|
WritePlcData("D1049", 0); |
|
|
|
WritePlcData("D1050", 0); |
|
|
|
WritePlcData("D1051", 0); |
|
|
|
} |
|
|
|
} |
|
|
|
} |