Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - RyanLeo

Pages: [1]
1
Tips & Tricks / Re: Tag Database
« on: May 02, 2016, 06:12:22 AM »
  '
I have worked out that if needed I can write the IP address at runtime with My.Settings.name as suggested above by commenting out the IP address in the MainForm.Designer.vb file as per the example below.

'ModbusTCPCom1
        '
        Me.ModbusTCPCom1.DisableSubscriptions = False
       ' Me.ModbusTCPCom1.IPAddress = "10.0.0.55"
        Me.ModbusTCPCom1.MaxReadGroupSize = 20
        Me.ModbusTCPCom1.SwapBytes = True
        Me.ModbusTCPCom1.SwapWords = False
        Me.ModbusTCPCom1.SynchronizingObject = Me
        Me.ModbusTCPCom1.TcpipPort = CType(20108US, UShort)
        Me.ModbusTCPCom1.TimeOut = 3000
        Me.ModbusTCPCom1.UnitId = CType(10, Byte)




I then add the following to the form loadevent   

Me.ModbusTCPCom1.IPAddress = My.Settings.Name    (with error checking)

 Please be aware the designer.vb file is auto generated so it is required to comment this piece of code out each time the project is rebuilt. It worked for me so I hope it may help others

Pages: [1]