LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCPIP Connection from a specific Ethernet device

Solved!
Go to solution

Hello.
I want to get a socket connection to a device, but I have several Ethernet interfaces on my computer so I want to open a TCP connection by using an specific IP from my PC. Is there any way to do this?

Regards!

0 Kudos
Message 1 of 5
(2,802 Views)

In order for multiple network interfaces to work properly in a single system, each network interface must belong to a specific/distinct subnet. If that is the case, the OS will already take care of selecting the correct interface.

 

Example:

One interface runs 192.168.1.100 as IP address, the other runs 10.0.1.100. These are two different, private IP addresses belonging to two different subnets (192.168.0 and 10.0.1). If your code tries to connect to e.g. 10.0.1.111, the OS will automatically pick the second device.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 5
(2,755 Views)

Hi Norbert.

Thanks for your response.

In my case, I have 7 network interfaces but they are in the same subnet range, since I am testing several ports of the same device.

0 Kudos
Message 3 of 5
(2,734 Views)
Solution
Accepted by topic author ramosd

Do these ports have to be tested in parallel? If not, i would go for a single network device and test the UUT ports one after another.

Besides: How does your device support 7 ports in parallel all connect to the same subnet (if you have to test parallel)?

 

EDIT: Please review this KB from Microsoft. I think it fits well in this topic and shows you the source of the issue.

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 5
(2,731 Views)

My product has a kind of an Ethernet switch, I test its ports one by one with a ping, and use one of them as my principal communication link, but since it is a continuous test, I have dedicated ports.

 

Based on the information you provided me, I found a way to get connected to the device by re-trying the TCP connection, so at each attempt the SO uses a different network device, and it continues once the link is established.

 

Thanks for your support.

David

0 Kudos
Message 5 of 5
(2,717 Views)