From 2f1fd1f77cb8ad46bcf0d18f19f7f0a7aeae57ec 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:46:03 +0800 Subject: [PATCH 1/3] =?UTF-8?q?172.18.4.100=20=E4=BF=AE=E5=A4=8DIp=20?= =?UTF-8?q?=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DataBlockHelper/DBHelpers/DB2105WriteHelper.cs | 1 - DataBlockHelper/PlcConnect.cs | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs index 57c765e..d529b86 100644 --- a/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs +++ b/DataBlockHelper/DBHelpers/DB2105WriteHelper.cs @@ -670,7 +670,6 @@ namespace DataBlockHelper.DBHelpers /// true 状态是停止 /// /// - public static List GetWaterStatus() { var siemensS7Net = PlcConnect.Instance; diff --git a/DataBlockHelper/PlcConnect.cs b/DataBlockHelper/PlcConnect.cs index b76a347..5565103 100644 --- a/DataBlockHelper/PlcConnect.cs +++ b/DataBlockHelper/PlcConnect.cs @@ -27,8 +27,8 @@ namespace DataBlockHelper SiemensPLCS siemensPLCS = SiemensPLCS.S1500; SiemensS7Net s7 = new SiemensS7Net(siemensPLCS); s7.SetPersistentConnection(); - //s7.IpAddress = "172.18.4.100"; - s7.IpAddress = "192.168.1.110"; + s7.IpAddress = "172.18.4.100"; + //s7.IpAddress = "192.168.1.110"; s7.Port = 102; var su = s7.ConnectServer(); From bf7bbbab3111b76687ed5149b9079e14884d0d00 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 13:04:05 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=AF=BB=E5=8F=96=E6=8A=A5=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainDetailControl/MainDetailControlAction.cs | 3 ++- .../Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs | 4 ++-- DataBlockHelper/Entity/DB2119Entity/SprialTempEntity.cs | 5 +++++ DataBlockHelper/Entity/DB2119Entity/WaterTempEntity.cs | 4 ++++ 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index 31681bd..9e30b81 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -283,10 +283,11 @@ namespace Mesnac.Action.ChemicalWeighing.MainDetailControl ControlsHelper.SetMCLabel(LabelE.LineKind8, dict[8]); } ReadFlag += 1; - if(ReadFlag >= 10) + if(ReadFlag >= 30) { ReadFlag = 0; ReportReadDb.ReadFeededDry(); + } var reachSingle = RgvPlcUtil.GetRGVAllError(); diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs index 2277add..206a36c 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/Report/ReportReadDb.cs @@ -35,7 +35,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report /// public static void ReadFeededDry() { - LoggingService.Debug("读取加料信息" + DateTime.Now.ToString()); + DB2105Helper dB2105Helper = new DB2105Helper(); List list = dB2105Helper.FeededDryList(); @@ -58,7 +58,7 @@ namespace Mesnac.Action.ChemicalWeighing.Report public static void ReadReport() { - LoggingService.InfoFormatted("开始读取报表"); + DB2107Helper dB2107Helper = new DB2107Helper(); NormalStatusEntity normal = dB2107Helper.NormalStatus; if (normal.RdyRpt_D1) diff --git a/DataBlockHelper/Entity/DB2119Entity/SprialTempEntity.cs b/DataBlockHelper/Entity/DB2119Entity/SprialTempEntity.cs index 8250f8c..6b13e02 100644 --- a/DataBlockHelper/Entity/DB2119Entity/SprialTempEntity.cs +++ b/DataBlockHelper/Entity/DB2119Entity/SprialTempEntity.cs @@ -12,6 +12,11 @@ namespace DataBlockHelper.Entity.DB2119Entity { // OperateResult read = PlcConnect.Instance.Read("DB2102." + startSet + ".0", 2); + if(null== bytes) + { + return; + } + byte[] content = bytes.Skip(startSet).Take(22).ToArray(); Value_Set = PlcConnect.Instance.ByteTransform.TransInt16(content, 0); diff --git a/DataBlockHelper/Entity/DB2119Entity/WaterTempEntity.cs b/DataBlockHelper/Entity/DB2119Entity/WaterTempEntity.cs index ca3ebcc..0f1e753 100644 --- a/DataBlockHelper/Entity/DB2119Entity/WaterTempEntity.cs +++ b/DataBlockHelper/Entity/DB2119Entity/WaterTempEntity.cs @@ -12,6 +12,10 @@ namespace DataBlockHelper.Entity.DB2119Entity { // OperateResult read = PlcConnect.Instance.Read("DB2102." + startSet + ".0", 2); + if(null == bytes) + { + return; + } byte[] content = bytes.Skip(startSet).Take(10).ToArray(); Value_Set = PlcConnect.Instance.ByteTransform.TransInt16(content, 0); From 7bf1e1256ea4f2af01dc9879d8e522e86a8305b6 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 13:16:06 +0800 Subject: [PATCH 3/3] 172.18.4.100 --- DataBlockHelper/PlcConnect.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/DataBlockHelper/PlcConnect.cs b/DataBlockHelper/PlcConnect.cs index 5565103..cef81aa 100644 --- a/DataBlockHelper/PlcConnect.cs +++ b/DataBlockHelper/PlcConnect.cs @@ -27,6 +27,7 @@ namespace DataBlockHelper SiemensPLCS siemensPLCS = SiemensPLCS.S1500; SiemensS7Net s7 = new SiemensS7Net(siemensPLCS); s7.SetPersistentConnection(); + s7.IpAddress = "172.18.4.100"; //s7.IpAddress = "192.168.1.110"; s7.Port = 102;