dep_yangw
我叫锄头 11 months ago
parent fa30a7bec2
commit 31029e7022

@ -36,6 +36,7 @@ using ProductionSystem_Model.DbModel;
using NewLife.Reflection;
using System.Collections;
using System.Globalization;
using NewLife.Caching;
namespace ProductionSystem.Forms
{
@ -736,15 +737,22 @@ namespace ProductionSystem.Forms
middleIsCanRound = false;
Thread.Sleep(Program.ReadPlcRate);
var d1004 = D1004();
if (d1004 == 0) return;
var d1004 = D1004;
if (d1004==false) return;
var d1300Value = GetPlcValue("D1300");
// d1300Value = "1";
//步骤1水泵1空载
if (d1300Value.ToDouble().ToInt()==1)
if (d1300Value.ToDouble().ToInt()==1 && D1004 )
{
Step1();
string name = GetCode() + ":Step1";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step1();
}
}
@ -753,11 +761,19 @@ namespace ProductionSystem.Forms
//步骤2水泵2空载
var d1302Value = GetPlcValue("D1302");
// d1302Value = "1";
if (d1302Value.ToDouble().ToInt() == 1)
if (d1302Value.ToDouble().ToInt() == 1 && D1004 )
{
// 上位机将四通阀运行到模式1停止水泵1启动水泵2运行致设定转速反馈PLC=1或2可以/不可以测试)
string name = GetCode() + ":Step2";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step2();
}
Step2();
}
@ -768,9 +784,15 @@ namespace ProductionSystem.Forms
//步骤3水泵3空载去停止
if (d1304Value.ToDouble().ToInt() == 1)
if (d1304Value.ToDouble().ToInt() == 1 && D1004 )
{
Step3();
string name =GetCode() + ":Step3";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step3();
}
}
@ -780,19 +802,31 @@ namespace ProductionSystem.Forms
var d1312 = GetPlcValue("D1312");
if (d1312.ToDouble().ToInt() == 1)
if (d1312.ToDouble().ToInt() == 1 && D1004 )
{
StepGaoYa();
string name = GetCode() + ":Step4";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step4();
}
}
//步骤5模式1内漏
var d1308 = GetPlcValue("D1308");
if (d1308.ToDouble().ToInt() == 1)
if (d1308.ToDouble().ToInt() == 1 && D1004 )
{
Step5();
string name = GetCode() + ":Step5";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step5();
}
}
@ -800,19 +834,30 @@ namespace ProductionSystem.Forms
var d1310 = GetPlcValue("D1310");
// d1310 = "1";
if (d1310.ToDouble().ToInt() == 1)
if (d1310.ToDouble().ToInt() == 1 && D1004 )
{
Step6();
string name = GetCode() + ":Step6";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step6();
}
}
//步骤7外露模式
var d1306Value = GetPlcValue("D1306");
// d1306Value = "1";
if(d1306Value.ToDouble().ToInt() ==1)
if(d1306Value.ToDouble().ToInt() ==1 && D1004 )
{
Step7();
string name = GetCode() + ":Step7";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step7();
}
}
@ -821,9 +866,15 @@ namespace ProductionSystem.Forms
var d1314 = GetPlcValue("D1314");
// d1314 = "1";
if (d1314.ToDouble().ToInt() ==1)
if (d1314.ToDouble().ToInt() ==1 && D1004 )
{
Step8();
string name = GetCode() + ":Step8";
if (!_cache.ContainsKey(name))
{
_cache.Set(name, DateTime.Now, TimeSpan.FromMinutes(1));
Step8();
}
}
@ -862,7 +913,7 @@ namespace ProductionSystem.Forms
private void StepGaoYa()
private void Step4()
{
//上位机检测电子膨胀阀1电子膨胀阀2在常开状态不在最大值状态时膨胀阀运行致常开状态并反馈PLC=1或2可以/不可以测试)
@ -981,6 +1032,7 @@ namespace ProductionSystem.Forms
var writeResult = OmronHelper.WriteToPlc(point.DataType, point.Address, $"{1}");
}
ICache _cache=Cache.Default;
private int count = 0;
private void ShowMiddleData2()
@ -1165,11 +1217,14 @@ namespace ProductionSystem.Forms
}
public int D1004()
{
//1 0
var entity= Program.CommandPointKeyValues.FirstOrDefault(m => m.Key =="D1004");
return OmronHelper.GetPlcVal(entity.DataType, entity.Address).val.ToDouble().ToInt();
public bool D1004
{
get
{
var entity= Program.CommandPointKeyValues.FirstOrDefault(m => m.Key =="D1004");
return OmronHelper.GetPlcVal(entity.DataType, entity.Address).val.ToDouble().ToInt() == 1;
}
}
///// <summary>

@ -37,7 +37,7 @@ namespace ProductionSystem.Untils.Tool
/// <summary>
/// 四通阀
/// </summary>
/// </summary>r
/// <param name="modeTypeEnum"></param>
/// <param name="no"></param>
/// <param name="reset">回复出厂</param>

Loading…
Cancel
Save