From a9e14f2f7edc9da96536225060b7bb549cb7f855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Wed, 13 Dec 2023 10:47:27 +0800 Subject: [PATCH 1/3] =?UTF-8?q?GetWaterStatus=20=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=B0=B4=E7=9A=84=E7=8A=B6=E6=80=81=20=20=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E5=92=8C=E4=B8=8B=E5=8F=91=E6=B0=B4=E7=9A=84=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DBHelpers/DB2105WriteHelper.cs | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs index e38ad63..b87268f 100644 --- a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs +++ b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs @@ -644,5 +644,41 @@ namespace DataBlockHelper.DBHelpers } + + /// + /// 0 冷水A 1 热水A 2 冷水B 3 热水B + /// + /// + public static void StopWater(int no) + { + var siemensS7Net = PlcConnect.Instance; + siemensS7Net.Write($"{DbName}.{53}.{no}",false); + } + + /// + /// 0 冷水A 1 热水A 2 冷水B 3 热水B + /// + /// + + public static void StartWater(int no) + { + var siemensS7Net = PlcConnect.Instance; + siemensS7Net.Write($"{DbName}.{53}.{no}", true); + } + + + public List GetWaterStatus() + { + var siemensS7Net = PlcConnect.Instance; + List status = new List(); + for (int i = 0; i < 4; i++) + { + var b= siemensS7Net.ReadBool($"{DbName}.{53}.{i}"); + status.Add(b.Content); + } + return status; + } + + } } \ No newline at end of file From de01c734b93bed9fe891725cfd4d75acbc7eb3d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Wed, 13 Dec 2023 10:51:37 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=20true=20=E7=8A=B6=E6=80=81=E6=98=AF?= =?UTF-8?q?=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBlockHelper/DBHelpers/DB2105WriteHelper.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs index b87268f..b31ec8d 100644 --- a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs +++ b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs @@ -652,7 +652,7 @@ namespace DataBlockHelper.DBHelpers public static void StopWater(int no) { var siemensS7Net = PlcConnect.Instance; - siemensS7Net.Write($"{DbName}.{53}.{no}",false); + siemensS7Net.Write($"{DbName}.{53}.{no}",true); } /// @@ -663,9 +663,13 @@ namespace DataBlockHelper.DBHelpers public static void StartWater(int no) { var siemensS7Net = PlcConnect.Instance; - siemensS7Net.Write($"{DbName}.{53}.{no}", true); + siemensS7Net.Write($"{DbName}.{53}.{no}", false); } + /// + /// true 状态是停止 + /// + /// public List GetWaterStatus() { From ec346e4e9189311e7c1e8217cf7beb34e72f7943 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Wed, 13 Dec 2023 11:08:47 +0800 Subject: [PATCH 3/3] =?UTF-8?q?GetWaterStatus=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E6=88=90=E9=9D=99=E6=80=81=E7=B1=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Mesnac.Action.ChemicalWeighing/Test/TestAction.cs | 4 +++- DataBlockHelper/DBHelpers/DB2105WriteHelper.cs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index bf205f1..f2222b7 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -78,7 +78,9 @@ namespace Mesnac.Action.ChemicalWeighing.Test private void MCButton_Click(object sender, EventArgs e) { - ReportReadDb.ReadFeededDry(); + // ReportReadDb.ReadFeededDry(); + + var list= DB2105WriteHelper.GetWaterStatus(); } } } diff --git a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs index b31ec8d..57c765e 100644 --- a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs +++ b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs @@ -671,7 +671,7 @@ namespace DataBlockHelper.DBHelpers /// /// - public List GetWaterStatus() + public static List GetWaterStatus() { var siemensS7Net = PlcConnect.Instance; List status = new List();