Thank you for your quick response Archie,
Thats what I gessed also but in fact Windows does poor management with two Adapters, when The Office network adapter has Internet on it then windows throws everything at it and discards the Industrial network adapter.
The Office Adapter is set to DHCP example: 10.10.14.18 with subnet Mask: 255.255.0.0
the Industrial Network adapter: 192.168.100.200 and PLC: 192.168.100.15, subnet Mask: 255.255.255.0
I tried to change the Matrix in bolth adapters with no luck.
When i disconnect the office adapter then communication to the Industrial Adapter works, Then i can reconnect to the office network adapter and it still works.
I also asked to chatGPT to see if there was a way to do this but i think the binding code has to execute before the driver connection.
Here is a sample of Network Ip binding code:
Imports System.Net
Imports System.Net.Sockets
Public Class ModbusTCPCom
' Existing properties and methods...
Private Sub Connect()
' Specify the IP address of the network card you want to bind to
Dim localIPAddress As String = "192.168.1.10" ' Replace with your network card IP
Dim localEndPoint As New IPEndPoint(IPAddress.Parse(localIPAddress), 0) ' Port 0 means any available port
' Create a new TcpClient instance
Dim tcpClient As New TcpClient()
' Bind the TcpClient to the local endpoint
tcpClient.Client.Bind(localEndPoint)
' Now connect to the Modbus server
tcpClient.Connect(Me.IPAddress, Me.TcpPort)
' Further setup and communication handling...
End Sub
' Existing properties and methods...
End Class
Thanks