From a4eb575313804478fd34bc47ad8faa032eae63ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=94=84=E5=A4=B4?= Date: Thu, 18 Jul 2024 14:37:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=91=E6=B4=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../LjDeliverPressureSetting/InitAction.cs | 7 ++++--- .../PressureSettingButtonAction.cs | 3 ++- DataBlockHelper/DBHelpers/DB137WriterHelper.cs | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/InitAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/InitAction.cs index bdcd30c..c5a73b1 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/InitAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/InitAction.cs @@ -1,4 +1,5 @@ -using DataBlockHelper.DBHelpers; +using DataBlockHelper; +using DataBlockHelper.DBHelpers; @@ -147,8 +148,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverPressureSetting speed.TxtSpeedMB.MCValue = dB91.DM2DSM01.SetSpeed_M.ToString(); speed.TxtSpeedMC.MCValue = dB91.DM3DSM01.SetSpeed_M.ToString(); - speed.SetSpeedA.MCValue=dB91.DM1GDS12.SetSpeed_A.ToString(); - speed.SetSpeedM.MCValue = dB91.DM1GDS12.SetSpeed_M.ToString(); + speed.SetSpeedA.MCValue = PlcConnect.Instance.ReadFloat("DB2101.218").Content; + speed.SetSpeedM.MCValue = PlcConnect.Instance.ReadFloat("DB2101.222").Content; } } diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/PressureSettingButtonAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/PressureSettingButtonAction.cs index a36b079..dedede5 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/PressureSettingButtonAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/LjDeliverPressureSetting/PressureSettingButtonAction.cs @@ -80,7 +80,8 @@ namespace Mesnac.Action.ChemicalWeighing.LjDeliverPressureSetting Convert.ToSingle(speed.TxtSpeedMC.MCValue), }); - DB91WriterHelper.AddSpeed(Convert.ToSingle(speed.SetSpeedA.MCValue), Convert.ToSingle(speed.SetSpeedM.MCValue)); + DB91WriterHelper.AddSpeed(Convert.ToSingle(speed.SetSpeedA.MCValue), + Convert.ToSingle(speed.SetSpeedM.MCValue)); MessageBox.Show("下传成功"); diff --git a/DataBlockHelper/DBHelpers/DB137WriterHelper.cs b/DataBlockHelper/DBHelpers/DB137WriterHelper.cs index 56d16b2..d556455 100644 --- a/DataBlockHelper/DBHelpers/DB137WriterHelper.cs +++ b/DataBlockHelper/DBHelpers/DB137WriterHelper.cs @@ -41,8 +41,8 @@ namespace DataBlockHelper.DBHelpers public static void AddSpeed(float a,float m) { var siemensS7Net = PlcConnect.Instance; - siemensS7Net.Write("DB91.78.0", a); - siemensS7Net.Write("DB91.82.0", m); + siemensS7Net.Write("DB2101.218", a); + siemensS7Net.Write("DB2101.222", m); } } }