From 23248a4ca04c3d4cb69ecb727c676a3ef3c1229d Mon Sep 17 00:00:00 2001 From: yangw Date: Mon, 15 Apr 2024 08:44:40 +0800 Subject: [PATCH] 123 --- ProductionSystem/Forms/HomeFormInfo.cs | 37 ++++++++++++++------------ ProductionSystem/Untils/Tool/TmTool.cs | 1 + ProductionSystem/Untils/Tool/UxTool.cs | 4 +-- 3 files changed, 23 insertions(+), 19 deletions(-) diff --git a/ProductionSystem/Forms/HomeFormInfo.cs b/ProductionSystem/Forms/HomeFormInfo.cs index a973566..76e22d5 100644 --- a/ProductionSystem/Forms/HomeFormInfo.cs +++ b/ProductionSystem/Forms/HomeFormInfo.cs @@ -737,14 +737,14 @@ namespace ProductionSystem.Forms middleIsCanRound = false; Thread.Sleep(Program.ReadPlcRate); + var aaa = TmTool.SbUy(ModeTypeEnum.BZ1_DB); - - var d1004 = D1004; - if (d1004 == false) - { - middleIsCanRound = true; - return; - }; + // var d1004 = D1004; + // if (d1004 == false) + // { + // middleIsCanRound = true; + // + // }; var d1300Value = GetPlcValue("D1300"); @@ -921,11 +921,14 @@ namespace ProductionSystem.Forms { XTrace.WriteLine("开始水泵2"); - TmTool.SbUy(ModeTypeEnum.BZ1_DB,true); - - TmTool.WritePlc(TmTool.ShuiBeng1, 1); + TmTool.SbUy(ModeTypeEnum.BZ2_DB,true); + TmTool.WritePlc(TmTool.ShuiBeng1, 0); - TmTool.CleanStatus(); + Thread.Sleep(1000); + TmTool.SbUx(ModeTypeEnum.BZ2_DB); + TmTool.WritePlc(TmTool.ShuiBeng2, 1); + + //TmTool.CleanStatus(); // 上位机将四通阀运行到模式1,停止水泵1;启动水泵2运行致设定转速,反馈PLC=1或2(可以/不可以测试) // TmTool.SiTong(ModeTypeEnum.BZ2_DB, 1); // TmTool.SiTong(ModeTypeEnum.BZ2_DB, 2); @@ -934,17 +937,17 @@ namespace ProductionSystem.Forms // // TmTool.Dzpy(ModeTypeEnum.BZ2_DB, 1); // TmTool.SbUx(ModeTypeEnum.BZ2_DB,true); - - - // var point =Program.CommandPointKeyValues.FirstOrDefault(m=>m.Key=="D1352"); - // var writeResult = OmronHelper.WriteToPlc(point.DataType, point.Address, $"{1}"); - + + + // var point =Program.CommandPointKeyValues.FirstOrDefault(m=>m.Key=="D1352"); + // var writeResult = OmronHelper.WriteToPlc(point.DataType, point.Address, $"{1}"); + } - private void Step3() + private void Step3() { // 上位机将四通阀运行到模式1,停止水泵2;启动水泵3运行致设定转速,反馈PLC=1或2(可以/不可以测试) TmTool.SiTong(ModeTypeEnum.BZ3_DB, 1); diff --git a/ProductionSystem/Untils/Tool/TmTool.cs b/ProductionSystem/Untils/Tool/TmTool.cs index a546523..b0908c5 100644 --- a/ProductionSystem/Untils/Tool/TmTool.cs +++ b/ProductionSystem/Untils/Tool/TmTool.cs @@ -269,6 +269,7 @@ namespace ProductionSystem.Untils.Tool var val = pzf1.TargetVal.ToDouble().ToInt(); + if (reset) { val = 0; diff --git a/ProductionSystem/Untils/Tool/UxTool.cs b/ProductionSystem/Untils/Tool/UxTool.cs index 49eb0b7..00459af 100644 --- a/ProductionSystem/Untils/Tool/UxTool.cs +++ b/ProductionSystem/Untils/Tool/UxTool.cs @@ -54,7 +54,7 @@ namespace ProductionSystem.Untils.Tool - mfSerialInfo = new MfSerialInfo(0x21, 0x29, com, "19200"); + mfSerialInfo = new MfSerialInfo(0x21, 0x29, com, "15200"); mfSerialInfo.MsgFunc += (x) => @@ -93,7 +93,7 @@ namespace ProductionSystem.Untils.Tool }; - mfSerialInfo.SendMsg(sendMes,50); + mfSerialInfo.SendMsg(sendMes,170,300); return b;