|
@@ -588,7 +588,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
bool writeResult = PLCCom.GetInstance().WritePlcObject(plcAddress, VarType.Bit, plcValue);
|
|
|
///实时值记录
|
|
|
-
|
|
|
+ item.RealValue = plcValue;
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (writeResult)
|
|
|
{
|
|
@@ -619,7 +619,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
bool writeResult = PLCCom.GetInstance().WritePlcObject(plcAddress, VarType.Word, plcValue);
|
|
|
///实时值记录
|
|
|
-
|
|
|
+ item.RealValue = plcValue;
|
|
|
item.TestTime = DateTime.Now;
|
|
|
if (writeResult)
|
|
|
{
|
|
@@ -670,7 +670,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
//更新测试记录
|
|
|
UpdateTesDtltRecord();
|
|
|
}
|
|
|
- private void TestJudgementMethod()
|
|
|
+ private async void TestJudgementMethod()
|
|
|
{
|
|
|
switch (SelectOutJudge)
|
|
|
{
|
|
@@ -703,7 +703,23 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
{
|
|
|
|
|
|
case "bool":
|
|
|
- string readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
+ DateTime entryTime = DateTime.Now;
|
|
|
+ string readResult = string.Empty;
|
|
|
+ //一直读
|
|
|
+ await Task.Run(async () =>
|
|
|
+ {
|
|
|
+ while (entryTime.AddMilliseconds(10 * 1000) > DateTime.Now)
|
|
|
+ {
|
|
|
+ readResult = PLCCom.GetInstance().ReadPlcObject(plcAddress, VarType.Bit);
|
|
|
+ if (readResult == item.PlcValue)
|
|
|
+ {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ await Task.Delay(1000);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+
|
|
|
///实时值记录
|
|
|
item.RealValue = readResult;
|
|
|
item.TestTime = DateTime.Now;
|
|
@@ -733,13 +749,13 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
|
|
|
if ((countCond == OutConList.Count)&&(countCond!=0))
|
|
|
{
|
|
|
bizTestRecordDtlDto.JudgementResult = "合格";
|
|
|
- StepIndex = 3;
|
|
|
+
|
|
|
}
|
|
|
else
|
|
|
{
|
|
|
bizTestRecordDtlDto.JudgementResult = "不合格";
|
|
|
}
|
|
|
-
|
|
|
+ StepIndex = 3;
|
|
|
break;
|
|
|
case "OR":
|
|
|
break;
|