From ee39ababc9ac03ad67ca27549f6b876e744c1cb9 Mon Sep 17 00:00:00 2001 From: RarceD Date: Sun, 5 May 2024 11:25:22 +0200 Subject: [PATCH 01/11] Upgrade projects from net452 to net48 --- CommonControls/Modbus.Common.csproj | 2 +- CommonControls/app.config | 2 +- ModbusLib/ModbusLib.csproj | 2 +- ModbusMaster/ModbusMaster.csproj | 2 +- ModbusMaster/app.config | 2 +- ModbusSlave/ModbusSlave.csproj | 2 +- ModbusSlave/app.config | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/CommonControls/Modbus.Common.csproj b/CommonControls/Modbus.Common.csproj index a34c6be..5336f76 100644 --- a/CommonControls/Modbus.Common.csproj +++ b/CommonControls/Modbus.Common.csproj @@ -10,7 +10,7 @@ Properties Modbus.Common Modbus.Common - v4.5.2 + v4.8 512 diff --git a/CommonControls/app.config b/CommonControls/app.config index 6964f9d..178bf47 100644 --- a/CommonControls/app.config +++ b/CommonControls/app.config @@ -51,4 +51,4 @@ - + diff --git a/ModbusLib/ModbusLib.csproj b/ModbusLib/ModbusLib.csproj index b148ce1..a65ced9 100644 --- a/ModbusLib/ModbusLib.csproj +++ b/ModbusLib/ModbusLib.csproj @@ -10,7 +10,7 @@ Properties ModbusLib ModbusLib - v4.5.2 + v4.8 512 diff --git a/ModbusMaster/ModbusMaster.csproj b/ModbusMaster/ModbusMaster.csproj index f8ff13c..3ee2845 100644 --- a/ModbusMaster/ModbusMaster.csproj +++ b/ModbusMaster/ModbusMaster.csproj @@ -10,7 +10,7 @@ Properties ModbusMaster ModbusMaster - v4.5.2 + v4.8 512 diff --git a/ModbusMaster/app.config b/ModbusMaster/app.config index 8f346d7..a77c5e4 100644 --- a/ModbusMaster/app.config +++ b/ModbusMaster/app.config @@ -1,6 +1,6 @@ - + diff --git a/ModbusSlave/ModbusSlave.csproj b/ModbusSlave/ModbusSlave.csproj index 1c0a2c5..89a9551 100644 --- a/ModbusSlave/ModbusSlave.csproj +++ b/ModbusSlave/ModbusSlave.csproj @@ -10,7 +10,7 @@ Properties ModbusSlave ModbusSlave - v4.5.2 + v4.8 512 diff --git a/ModbusSlave/app.config b/ModbusSlave/app.config index de82893..786a845 100644 --- a/ModbusSlave/app.config +++ b/ModbusSlave/app.config @@ -1,3 +1,3 @@ - + From 5183977f9bd79cdb76f7e4d86a7c6381d28ef888 Mon Sep 17 00:00:00 2001 From: Long Zheng Date: Sun, 11 Aug 2024 20:22:50 +1000 Subject: [PATCH 02/11] Fix window size --- ModbusMaster/MasterForm.Designer.cs | 3 +++ ModbusSlave/SlaveForm.Designer.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ModbusMaster/MasterForm.Designer.cs b/ModbusMaster/MasterForm.Designer.cs index cfa0871..c3e9b6f 100644 --- a/ModbusMaster/MasterForm.Designer.cs +++ b/ModbusMaster/MasterForm.Designer.cs @@ -218,7 +218,10 @@ private void InitializeComponent() this.Controls.Add(this.buttonDisconnect); this.Controls.Add(this.btnConnect); this.Controls.Add(this.groupBoxFunctions); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "MasterForm"; this.ShowDataLength = true; this.Text = "Modbus Master"; diff --git a/ModbusSlave/SlaveForm.Designer.cs b/ModbusSlave/SlaveForm.Designer.cs index a8a173c..d03d3d6 100644 --- a/ModbusSlave/SlaveForm.Designer.cs +++ b/ModbusSlave/SlaveForm.Designer.cs @@ -68,7 +68,10 @@ private void InitializeComponent() this.ClientSize = new System.Drawing.Size(869, 887); this.Controls.Add(this.buttonDisconnect); this.Controls.Add(this.btnConnect); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.MinimizeBox = false; this.Name = "SlaveForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SlaveFormClosing); this.Load += new System.EventHandler(this.SlaveFormLoading); From 880264d20bc0611a221110b8211101362c8cdddd Mon Sep 17 00:00:00 2001 From: Long Zheng Date: Sun, 11 Aug 2024 20:36:55 +1000 Subject: [PATCH 03/11] Skip polling if disconnected --- ModbusMaster/MasterForm.cs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ModbusMaster/MasterForm.cs b/ModbusMaster/MasterForm.cs index 40489f8..3e8ba39 100644 --- a/ModbusMaster/MasterForm.cs +++ b/ModbusMaster/MasterForm.cs @@ -272,6 +272,10 @@ private void cbPoll_CheckStateChanged(object sender, EventArgs e) private void pollTimer_Tick(object sender, EventArgs e) { + // disconnected state, skip + if (groupBoxFunctions.Enabled == false) + return; + if (_lastReadCommand != 0) ExecuteReadCommand(_lastReadCommand); } From c25bf4a6b9117f42f48349e0e610007a48800e3e Mon Sep 17 00:00:00 2001 From: Graham Ross Date: Wed, 14 Aug 2024 07:32:42 -0400 Subject: [PATCH 04/11] Update version, Merged PR #43, 45 --- CommonControls/Properties/AssemblyInfo.cs | 4 ++-- ModbusLib/Properties/AssemblyInfo.cs | 4 ++-- ModbusMaster/Properties/AssemblyInfo.cs | 4 ++-- ModbusSlave/Properties/AssemblyInfo.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CommonControls/Properties/AssemblyInfo.cs b/CommonControls/Properties/AssemblyInfo.cs index 3da88bb..249affe 100644 --- a/CommonControls/Properties/AssemblyInfo.cs +++ b/CommonControls/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/ModbusLib/Properties/AssemblyInfo.cs b/ModbusLib/Properties/AssemblyInfo.cs index 3a8e3c8..501f9cd 100644 --- a/ModbusLib/Properties/AssemblyInfo.cs +++ b/ModbusLib/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/ModbusMaster/Properties/AssemblyInfo.cs b/ModbusMaster/Properties/AssemblyInfo.cs index 4b27d03..b29eb23 100644 --- a/ModbusMaster/Properties/AssemblyInfo.cs +++ b/ModbusMaster/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] diff --git a/ModbusSlave/Properties/AssemblyInfo.cs b/ModbusSlave/Properties/AssemblyInfo.cs index 88259f5..8493e0e 100644 --- a/ModbusSlave/Properties/AssemblyInfo.cs +++ b/ModbusSlave/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.0.0")] -[assembly: AssemblyFileVersion("2.1.0.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.1.1.0")] +[assembly: AssemblyFileVersion("2.1.1.0")] \ No newline at end of file From 7a44cfa139501f8f2c5423003558e49ee0a18b2e Mon Sep 17 00:00:00 2001 From: Long Zheng Date: Thu, 15 Aug 2024 21:07:24 +1000 Subject: [PATCH 05/11] Re-enable resizeable window, fix clipping --- ModbusMaster/MasterForm.Designer.cs | 8 +++++--- ModbusSlave/SlaveForm.Designer.cs | 10 ++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ModbusMaster/MasterForm.Designer.cs b/ModbusMaster/MasterForm.Designer.cs index c3e9b6f..6c6f6c7 100644 --- a/ModbusMaster/MasterForm.Designer.cs +++ b/ModbusMaster/MasterForm.Designer.cs @@ -63,6 +63,10 @@ private void InitializeComponent() this.radioButtonInteger.Location = new System.Drawing.Point(86, 20); this.radioButtonInteger.Size = new System.Drawing.Size(64, 21); // + // grpStart + // + this.grpStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); + // // label1 // this.label1.Visible = false; @@ -214,14 +218,12 @@ private void InitializeComponent() // MasterForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScroll = true; this.ClientSize = new System.Drawing.Size(869, 917); this.Controls.Add(this.buttonDisconnect); this.Controls.Add(this.btnConnect); this.Controls.Add(this.groupBoxFunctions); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; this.Name = "MasterForm"; this.ShowDataLength = true; this.Text = "Modbus Master"; diff --git a/ModbusSlave/SlaveForm.Designer.cs b/ModbusSlave/SlaveForm.Designer.cs index d03d3d6..c669006 100644 --- a/ModbusSlave/SlaveForm.Designer.cs +++ b/ModbusSlave/SlaveForm.Designer.cs @@ -36,6 +36,10 @@ private void InitializeComponent() this.grpExchange.SuspendLayout(); this.SuspendLayout(); // + // grpStart + // + this.grpStart.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left))); + // // label8 // this.label8.Visible = false; @@ -65,13 +69,11 @@ private void InitializeComponent() // SlaveForm // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); - this.ClientSize = new System.Drawing.Size(869, 887); + this.AutoScroll = true; + this.ClientSize = new System.Drawing.Size(869, 896); this.Controls.Add(this.buttonDisconnect); this.Controls.Add(this.btnConnect); - this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); - this.MaximizeBox = false; - this.MinimizeBox = false; this.Name = "SlaveForm"; this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.SlaveFormClosing); this.Load += new System.EventHandler(this.SlaveFormLoading); From 727518e6795bbc7f624e37df304aad7ddcb2d3e6 Mon Sep 17 00:00:00 2001 From: Graham Ross Date: Sun, 18 Aug 2024 09:50:16 -0400 Subject: [PATCH 06/11] Merged PR #47 --- CommonControls/Properties/AssemblyInfo.cs | 4 ++-- ModbusLib/Properties/AssemblyInfo.cs | 4 ++-- ModbusMaster/Properties/AssemblyInfo.cs | 4 ++-- ModbusSlave/Properties/AssemblyInfo.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CommonControls/Properties/AssemblyInfo.cs b/CommonControls/Properties/AssemblyInfo.cs index 249affe..d6ecb81 100644 --- a/CommonControls/Properties/AssemblyInfo.cs +++ b/CommonControls/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.1.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyVersion("2.1.2.0")] +[assembly: AssemblyFileVersion("2.1.2.0")] diff --git a/ModbusLib/Properties/AssemblyInfo.cs b/ModbusLib/Properties/AssemblyInfo.cs index 501f9cd..38cb7a2 100644 --- a/ModbusLib/Properties/AssemblyInfo.cs +++ b/ModbusLib/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.1.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyVersion("2.1.2.0")] +[assembly: AssemblyFileVersion("2.1.2.0")] diff --git a/ModbusMaster/Properties/AssemblyInfo.cs b/ModbusMaster/Properties/AssemblyInfo.cs index b29eb23..0a17362 100644 --- a/ModbusMaster/Properties/AssemblyInfo.cs +++ b/ModbusMaster/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.1.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] +[assembly: AssemblyVersion("2.1.2.0")] +[assembly: AssemblyFileVersion("2.1.2.0")] diff --git a/ModbusSlave/Properties/AssemblyInfo.cs b/ModbusSlave/Properties/AssemblyInfo.cs index 8493e0e..e34b92c 100644 --- a/ModbusSlave/Properties/AssemblyInfo.cs +++ b/ModbusSlave/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.1.0")] -[assembly: AssemblyFileVersion("2.1.1.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.1.2.0")] +[assembly: AssemblyFileVersion("2.1.2.0")] \ No newline at end of file From ed9c4825932254bf8338a8fa64a10b215267edac Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Fri, 27 Sep 2024 13:48:10 +0800 Subject: [PATCH 07/11] Fixed the bug that the existing task cannot be stopped after clicking the modbus slave disconnect button --- ModbusSlave/ModbusSlave.csproj | 1 + ModbusSlave/SlaveForm.cs | 12 +++++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ModbusSlave/ModbusSlave.csproj b/ModbusSlave/ModbusSlave.csproj index 89a9551..c659cd2 100644 --- a/ModbusSlave/ModbusSlave.csproj +++ b/ModbusSlave/ModbusSlave.csproj @@ -134,6 +134,7 @@ SlaveForm.cs + Designer diff --git a/ModbusSlave/SlaveForm.cs b/ModbusSlave/SlaveForm.cs index 7542ff2..4873e66 100644 --- a/ModbusSlave/SlaveForm.cs +++ b/ModbusSlave/SlaveForm.cs @@ -154,6 +154,13 @@ private void DoDisconnect() _uart.Dispose(); _uart = null; } + + if (_socket != null) + { + _socket.Dispose(); + _socket = null; + } + if (_thread != null && _thread.IsAlive) { if (_thread.Join(2000) == false) @@ -162,11 +169,6 @@ private void DoDisconnect() _thread = null; } } - if (_socket != null) - { - _socket.Dispose(); - _socket = null; - } } #endregion From 9b39ea62059c7df1770bb4383025fe00797a227e Mon Sep 17 00:00:00 2001 From: Victor_ouyang Date: Fri, 27 Sep 2024 14:09:13 +0800 Subject: [PATCH 08/11] Update ModbusSlave.csproj do not change ModbusSlave.csproj --- ModbusSlave/ModbusSlave.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ModbusSlave/ModbusSlave.csproj b/ModbusSlave/ModbusSlave.csproj index c659cd2..822fd31 100644 --- a/ModbusSlave/ModbusSlave.csproj +++ b/ModbusSlave/ModbusSlave.csproj @@ -134,7 +134,6 @@ SlaveForm.cs - Designer @@ -181,4 +180,4 @@ --> - \ No newline at end of file + From 16a02ca7f27050af97f582d0a67f882ea92ef477 Mon Sep 17 00:00:00 2001 From: Victor_ouyang Date: Fri, 27 Sep 2024 14:09:43 +0800 Subject: [PATCH 09/11] Update ModbusSlave.csproj --- ModbusSlave/ModbusSlave.csproj | 1 - 1 file changed, 1 deletion(-) diff --git a/ModbusSlave/ModbusSlave.csproj b/ModbusSlave/ModbusSlave.csproj index 822fd31..3d795b6 100644 --- a/ModbusSlave/ModbusSlave.csproj +++ b/ModbusSlave/ModbusSlave.csproj @@ -180,4 +180,3 @@ --> - From 4b3f368c2791b766253b441e2b4717854df1f831 Mon Sep 17 00:00:00 2001 From: Victor_ouyang Date: Fri, 27 Sep 2024 14:10:08 +0800 Subject: [PATCH 10/11] Update ModbusSlave.csproj --- ModbusSlave/ModbusSlave.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/ModbusSlave/ModbusSlave.csproj b/ModbusSlave/ModbusSlave.csproj index 3d795b6..822fd31 100644 --- a/ModbusSlave/ModbusSlave.csproj +++ b/ModbusSlave/ModbusSlave.csproj @@ -180,3 +180,4 @@ --> + From eede3f3a26d781395ab1857a988fabb54ef572ac Mon Sep 17 00:00:00 2001 From: Graham Ross Date: Wed, 2 Oct 2024 10:30:30 -0400 Subject: [PATCH 11/11] Update version for PR#50 --- CommonControls/Properties/AssemblyInfo.cs | 4 ++-- ModbusLib/Properties/AssemblyInfo.cs | 4 ++-- ModbusMaster/Properties/AssemblyInfo.cs | 4 ++-- ModbusSlave/Properties/AssemblyInfo.cs | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CommonControls/Properties/AssemblyInfo.cs b/CommonControls/Properties/AssemblyInfo.cs index d6ecb81..5eb70da 100644 --- a/CommonControls/Properties/AssemblyInfo.cs +++ b/CommonControls/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.2.0")] -[assembly: AssemblyFileVersion("2.1.2.0")] +[assembly: AssemblyVersion("2.1.3.0")] +[assembly: AssemblyFileVersion("2.1.3.0")] diff --git a/ModbusLib/Properties/AssemblyInfo.cs b/ModbusLib/Properties/AssemblyInfo.cs index 38cb7a2..00794fb 100644 --- a/ModbusLib/Properties/AssemblyInfo.cs +++ b/ModbusLib/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.2.0")] -[assembly: AssemblyFileVersion("2.1.2.0")] +[assembly: AssemblyVersion("2.1.3.0")] +[assembly: AssemblyFileVersion("2.1.3.0")] diff --git a/ModbusMaster/Properties/AssemblyInfo.cs b/ModbusMaster/Properties/AssemblyInfo.cs index 0a17362..a9cfb85 100644 --- a/ModbusMaster/Properties/AssemblyInfo.cs +++ b/ModbusMaster/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.2.0")] -[assembly: AssemblyFileVersion("2.1.2.0")] +[assembly: AssemblyVersion("2.1.3.0")] +[assembly: AssemblyFileVersion("2.1.3.0")] diff --git a/ModbusSlave/Properties/AssemblyInfo.cs b/ModbusSlave/Properties/AssemblyInfo.cs index e34b92c..5b0e8db 100644 --- a/ModbusSlave/Properties/AssemblyInfo.cs +++ b/ModbusSlave/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.1.2.0")] -[assembly: AssemblyFileVersion("2.1.2.0")] \ No newline at end of file +[assembly: AssemblyVersion("2.1.3.0")] +[assembly: AssemblyFileVersion("2.1.3.0")] \ No newline at end of file