diff --git a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs index b4b4ce5..9af1c6f 100644 --- a/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs +++ b/Actions/ChemicalWeighing/Mesnac.Action.ChemicalWeighing/MainDetailControl/MainDetailControlAction.cs @@ -296,10 +296,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/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/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); diff --git a/DataBlockHelper/PlcConnect.cs b/DataBlockHelper/PlcConnect.cs index c3c3fa3..cef81aa 100644 --- a/DataBlockHelper/PlcConnect.cs +++ b/DataBlockHelper/PlcConnect.cs @@ -27,8 +27,9 @@ namespace DataBlockHelper SiemensPLCS siemensPLCS = SiemensPLCS.S1500; SiemensS7Net s7 = new SiemensS7Net(siemensPLCS); s7.SetPersistentConnection(); - //s7.IpAddress = "172.18.4.100"; - s7.IpAddress = "192.168.4.100"; + + s7.IpAddress = "172.18.4.100"; + //s7.IpAddress = "192.168.1.110"; s7.Port = 102; var su = s7.ConnectServer();