From 593bc21c0a9a81dcf87ae1571439fe9668c151d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=88=91=E5=8F=AB=E9=94=84=E5=A4=B4?= Date: Mon, 18 Dec 2023 11:34:21 +0800 Subject: [PATCH] =?UTF-8?q?test=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Test/TestAction.cs | 49 +++++++++++++++++-- DataBlockHelper/DBHelpers/DB120Help.cs | 4 +- DataBlockHelper/DBHelpers/DB120WriteHelp.cs | 2 +- DataBlockHelper/DBHelpers/DB92Help.cs | 3 ++ DataBlockHelper/DBHelpers/DB92WriterHelp.cs | 3 +- 5 files changed, 54 insertions(+), 7 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs index 00b4ee8..e12339a 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Test/TestAction.cs @@ -79,9 +79,52 @@ namespace Mesnac.Action.ChemicalWeighing.Test private void MCButton_Click(object sender, EventArgs e) { - ReportReadDb.ReadFeededDry(); - - var list= DB2105WriteHelper.GetWaterStatus(); + DB120WriteHelp.AddABCDEF(new Uhd() + { + A = 60, + B = 60, + C = 60, + D = 60, + E = 60, + F = 60, + G = 60, + H = 60, + I = 60, + J = 60, + K = 60, + L = 60, + M = 60, + N = 60, + O = 60, + Delay1 = 3, + Delay2 = 2, + Delay3 = 1 + + }); + + DB120Help help1 = new DB120Help(); + var user = help1.GetUhd; + + + + + DB92WriterHelp.Add(new Pipe() + { + MainPipieA = 0.4f, + AuxPipieA = 0.4f, + + MainPipieB = 0.4f, + AuxPipieB = 0.4f, + + MainPipieC = 0.4f, + AuxPipieC = 0.4f, + + UpperPressure = 0.6f, + LowerPressure = 0.3f, + }); + + DB92Help help = new DB92Help(); + var pipe= help.GetPipe; } } } diff --git a/DataBlockHelper/DBHelpers/DB120Help.cs b/DataBlockHelper/DBHelpers/DB120Help.cs index 0398fee..e3f4c49 100644 --- a/DataBlockHelper/DBHelpers/DB120Help.cs +++ b/DataBlockHelper/DBHelpers/DB120Help.cs @@ -13,12 +13,12 @@ namespace DataBlockHelper.DBHelpers public DB120Help() { - OperateResult db120 = PlcConnect.Instance.Read("DB120.0.0", 64); + OperateResult db120 = PlcConnect.Instance.Read("DB120.0.0", 66); bytes = db120.Content; } - public Uhd GetUhd => new Uhd(); + public Uhd GetUhd => new Uhd(bytes); } diff --git a/DataBlockHelper/DBHelpers/DB120WriteHelp.cs b/DataBlockHelper/DBHelpers/DB120WriteHelp.cs index 279b9c7..48faae1 100644 --- a/DataBlockHelper/DBHelpers/DB120WriteHelp.cs +++ b/DataBlockHelper/DBHelpers/DB120WriteHelp.cs @@ -15,7 +15,7 @@ namespace DataBlockHelper.DBHelpers { int start = 0; var siemensS7Net = PlcConnect.Instance; - siemensS7Net.Write($"{DbName}.{start}.0", uhd.A); + var sss=siemensS7Net.Write($"{DbName}.{start}.0", uhd.A); siemensS7Net.Write($"{DbName}.{start + 4}.0", uhd.B); siemensS7Net.Write($"{DbName}.{start + 8}.0", uhd.C); siemensS7Net.Write($"{DbName}.{start + 12}.0", uhd.D); diff --git a/DataBlockHelper/DBHelpers/DB92Help.cs b/DataBlockHelper/DBHelpers/DB92Help.cs index 30b463b..afe7c85 100644 --- a/DataBlockHelper/DBHelpers/DB92Help.cs +++ b/DataBlockHelper/DBHelpers/DB92Help.cs @@ -15,6 +15,9 @@ namespace DataBlockHelper.DBHelpers OperateResult db = PlcConnect.Instance.Read("DB92.0.0", 34); bytes = db.Content; } + + + public Pipe GetPipe => new Pipe(2, bytes); } diff --git a/DataBlockHelper/DBHelpers/DB92WriterHelp.cs b/DataBlockHelper/DBHelpers/DB92WriterHelp.cs index 30c7469..7a61b42 100644 --- a/DataBlockHelper/DBHelpers/DB92WriterHelp.cs +++ b/DataBlockHelper/DBHelpers/DB92WriterHelp.cs @@ -13,7 +13,7 @@ namespace DataBlockHelper.DBHelpers public static void Add(Pipe pipe) { - + var siemensS7Net = PlcConnect.Instance; siemensS7Net.Write($"{DbName}.2.0", pipe.MainPipieA); siemensS7Net.Write($"{DbName}.6.0", pipe.AuxPipieA); @@ -28,4 +28,5 @@ namespace DataBlockHelper.DBHelpers siemensS7Net.Write($"{DbName}.26.0", pipe.UpperPressure); siemensS7Net.Write($"{DbName}.30.0", pipe.LowerPressure); } + } }