|
|
@ -65,7 +65,10 @@ namespace ProductionSystem.Forms
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
#region 各工序的采集点位
|
|
|
|
#region 各工序的采集点位
|
|
|
|
Program.electricTestPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "ElectricTest").ToList();
|
|
|
|
Program.electricTestPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "BZ1").ToList();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Program.idlingPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "Idling").ToList();
|
|
|
|
Program.idlingPoints = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "Idling").ToList();
|
|
|
|
Program.speedUp1Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp1").ToList();
|
|
|
|
Program.speedUp1Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp1").ToList();
|
|
|
|
Program.speedUp2Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp2").ToList();
|
|
|
|
Program.speedUp2Points = Program.MiddlePointKeyValues.Where(m => m.ParaCategory == "SpeedUp2").ToList();
|
|
|
@ -101,22 +104,22 @@ namespace ProductionSystem.Forms
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region 页面第一次加载的时候,读取一遍PLC数据
|
|
|
|
#region 页面第一次加载的时候,读取一遍PLC数据
|
|
|
|
//空载
|
|
|
|
////空载
|
|
|
|
GetIdlingPointsVal();
|
|
|
|
//GetIdlingPointsVal();
|
|
|
|
//一段速
|
|
|
|
////一段速
|
|
|
|
GetSpeedUp1PointsVal();
|
|
|
|
//GetSpeedUp1PointsVal();
|
|
|
|
//二段升速
|
|
|
|
////二段升速
|
|
|
|
GetSpeedUp2Points();
|
|
|
|
//GetSpeedUp2Points();
|
|
|
|
//二段速稳定
|
|
|
|
////二段速稳定
|
|
|
|
GetSteady2Points();
|
|
|
|
//GetSteady2Points();
|
|
|
|
//三段升速
|
|
|
|
////三段升速
|
|
|
|
GetSpeedUp3Points();
|
|
|
|
//GetSpeedUp3Points();
|
|
|
|
//三段速稳定
|
|
|
|
////三段速稳定
|
|
|
|
GetSteady3Points();
|
|
|
|
//GetSteady3Points();
|
|
|
|
//内漏
|
|
|
|
////内漏
|
|
|
|
GetEndoleadPoints();
|
|
|
|
//GetEndoleadPoints();
|
|
|
|
//单驱
|
|
|
|
////单驱
|
|
|
|
GetSingleModelPoints();
|
|
|
|
//GetSingleModelPoints();
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
//PLC心跳监测
|
|
|
|
//PLC心跳监测
|
|
|
@ -492,8 +495,8 @@ namespace ProductionSystem.Forms
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//条码值
|
|
|
|
//条码值
|
|
|
|
var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
|
|
|
|
//var readM248 = OmronHelper.GetPlcVal(M248.DataType, M248.Address);
|
|
|
|
UpdateControlContent(txtProductCode, readM248.val);
|
|
|
|
//UpdateControlContent(txtProductCode, readM248.val);
|
|
|
|
|
|
|
|
|
|
|
|
#region 顶部采集项目赋值
|
|
|
|
#region 顶部采集项目赋值
|
|
|
|
if (Program.TopPointKeyValues.Count > 0)
|
|
|
|
if (Program.TopPointKeyValues.Count > 0)
|
|
|
@ -642,20 +645,23 @@ namespace ProductionSystem.Forms
|
|
|
|
var M249 = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M249");
|
|
|
|
var M249 = Program.CommandPointKeyValues.FirstOrDefault(m => m.Key == "M249");
|
|
|
|
M249.Val = OmronHelper.GetPlcVal(M249.DataType, M249.Address).val;
|
|
|
|
M249.Val = OmronHelper.GetPlcVal(M249.DataType, M249.Address).val;
|
|
|
|
|
|
|
|
|
|
|
|
#region 电检一直采集
|
|
|
|
#region 模拟一个值
|
|
|
|
for (int i = 0; i < Program.electricTestPoints.Count; i++)
|
|
|
|
for (int i = 0; i < Program.electricTestPoints.Count; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
var electricReadResult = OmronHelper.GetPlcVal(Program.electricTestPoints[i].DataType, Program.electricTestPoints[i].Address);
|
|
|
|
var electricReadResult = OmronHelper.GetPlcVal(Program.electricTestPoints[i].DataType, Program.electricTestPoints[i].Address);
|
|
|
|
Program.electricTestPoints[i].Val = electricReadResult.val;
|
|
|
|
Program.electricTestPoints[i].Val = electricReadResult.val;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var electricPoint = Program.electricTestPoints.FirstOrDefault(m => m.Key == "M44");
|
|
|
|
|
|
|
|
var electricStatus = OmronHelper.GetPlcVal(electricPoint.DataType, electricPoint.Address).val;
|
|
|
|
SetMiddleData(Program.electricTestPoints, "BZ1");
|
|
|
|
if (electricStatus == "1.000" || electricStatus == "2.000")
|
|
|
|
//var electricPoint = Program.electricTestPoints.FirstOrDefault(m => m.Key == "M44");
|
|
|
|
{
|
|
|
|
//var electricStatus = OmronHelper.GetPlcVal(electricPoint.DataType, electricPoint.Address).val;
|
|
|
|
SetMiddleData(Program.electricTestPoints, "ElectricTest");
|
|
|
|
//if (electricStatus == "1.000" || electricStatus == "2.000")
|
|
|
|
}
|
|
|
|
//{
|
|
|
|
|
|
|
|
// SetMiddleData(Program.electricTestPoints, "ElectricTest");
|
|
|
|
|
|
|
|
//}
|
|
|
|
#endregion
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
M249.Val = "23234234234234";
|
|
|
|
switch (M249.Val)
|
|
|
|
switch (M249.Val)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//空载
|
|
|
|
//空载
|
|
|
@ -924,6 +930,9 @@ namespace ProductionSystem.Forms
|
|
|
|
//}
|
|
|
|
//}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// <summary>
|
|
|
|
/// 一段速
|
|
|
|
/// 一段速
|
|
|
|
/// </summary>
|
|
|
|
/// </summary>
|
|
|
|