General Category > Tips & Tricks

Modbus Addressing

<< < (2/4) > >>

Godra:
Setting the text size back to 100% should bring the output screen closer to what it should be (check the attached pictures).
I have not tried running it in compatible mode for Windows XP but you can definitely try that.

Solutions have been posted so download and modify whatever you need adjusted. You could possibly just comment out the MaximumSize in the Form1_Load sub in the "Private Methods" region: Me.MaximumSize = New Size(580, 650) to be able to manually re-size the form or just do so in DesignMode and adjust the values.
The same applies for Me.formEditValue.MaximumSize = New Size(160, 54) in the same sub.

Godra:
Doug,

Here is a version for 64-bit Windows that you can try.

Let me know if it works.

DougLyons:
Godra,

The new 64-bit version now shows all of the main window. The Set Cell popup is still very small like before.
I did not realize that your dropbox links included the solution files for this application until you mentioned it above.
Now I have downloaded them and I will open and experiment with them shortly.

Thanks very much for your suggestions and speedy reply. I always enjoy finding a new Modbus tool.

Doug Lyons

Godra:
Doug,

If you might be interested in getting the Set Value form like it is in attached picture, then just modify the part of the code inside the Form1_Load sub to this:


--- Code: ---        Me.formButtonOK.DialogResult = vbOKOnly
        Me.formButtonOK.Text = "OK"
        Me.formEditValue.Name = "Set Value"
        Me.formEditValue.Text = "Set Value"
        Me.formEditValue.BackgroundImage = My.Resources.DarkBlue
        Me.formEditValue.Icon = My.Resources.ModbusRTU
        Me.formEditValue.BackgroundImageLayout = ImageLayout.Stretch
        Me.formEditValue.AutoScaleMode = Windows.Forms.AutoScaleMode.None
        Me.formEditValue.MaximumSize = New Size(180, 100)
        Me.formEditValue.MinimumSize = New Size(180, 100)
        Me.formEditValue.StartPosition = Windows.Forms.FormStartPosition.CenterParent
        Me.formEditValue.MinimizeBox = False
        Me.formEditValue.MaximizeBox = False
        Me.formEditValue.SizeGripStyle = Windows.Forms.SizeGripStyle.Hide
        Me.formEditValue.Controls.Add(formTextbox)
        Me.formEditValue.Controls.Add(formButtonOK)
        Me.formTextbox.Size = New Size(60, 25)
        Me.formButtonOK.Size = New Size(52, 25)
        Me.formTextbox.Location = New Point(25, 25)
        Me.formButtonOK.Location = New Point(Me.formTextbox.Width + 45, 23)
        Me.formTextbox.MaxLength = 5
        Me.formButtonOK.UseVisualStyleBackColor = True
        Me.formButtonOK.BringToFront()

--- End code ---

You can always adjust the numbers to fit properly on your screen.

Also, once you are to have a working solution for your computer then see if you can post it for other people to be able to download.

DougLyons:
Godra,

I made very few changes to get it to display properly on my Windows 7 machine.
Here are the actual lines that I changed in the Form1_Load Subroutine:

Line 186:

--- Code: ---        Me.MaximumSize = New Size(800, 850)
--- End code ---

Lines 266 & 267:

--- Code: ---        Me.formEditValue.Size = New Size(200, 75)
        Me.formEditValue.MaximumSize = New Size(200, 80)

--- End code ---

Line 276:

--- Code: ---        Me.formButtonOK.Size = New Size(52, 25)

--- End code ---

It should be possible to check the Windows version and if 7 or greater then make the above changes.
If I get a chance I will try and look into this and post the revised code.

One other change I made was to the four DataGridView controls. I changed the Address column (1) to a Width of 125 on each one.
I used a right-click with "Sent to Back" to cycle through the controls, but there may have been a better way.
Otherwise the complete address range was not shown for me.
Also, I think that the column widths for the Input Registers and Holding Registers could be a bit wider as well but I did not change these.

Thanks for your help with this.

Doug Lyons

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version