LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

TCP/IP between 2 network interface cards on 1 machine

Hi,

 

I have 3 NIC's on one PC. The primary NIC connects to the company network.

 

 

I have 2 other cards that are setup with IP's: 10.0.0.1 and 10.0.0.2.

 

What I would like to do is test communication between the two cards either using a ping or server/client setup.

 

I have used the Simple TCP IP example program, setting the server's TCP listen 'net address' to 10.0.0.1 and the client's address to 10.0.0.2.

 

Initially I did not get a connection between the server and the client as the server refused the connection.

 

I then added the local port value of 6340 to the client VI. With this setup, the connection seems to be made (as the client VI flow gets passed the open connection VI), but I get error 56: The network operation exceeded the user specified or system time limit. (This error also occurs when I run the setup on 2 different machines and remove the cable).

 

I think that this is probably a setting oversight, but I cannot get this working on 1 machine.

 

Please Help.

 

Thanks,

Adrian

0 Kudos
Message 1 of 5
(3,623 Views)

Are your NICs connected to each other?  Are you using a Cross-Over cable (or going through a switch that figures this out for you)?  It would be helpful also to see your code -- maybe (though I hate to suggest this) you are doing something wrong ...

 

Bob Schor

0 Kudos
Message 2 of 5
(3,603 Views)

Don't you have to designate one card to be on subnet 1, and another card to be on subnet 2 ?

 

Without that, you have nothing to tell the system which card to use.

 

The addresses you gave are on the same subnet, therefore they will appear on the same card.  Somewhere in your OS's networking control panel, you have to designate card 1 is one range of addresses, and card 2 is some OTHER range.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


LinkedIn

Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 3 of 5
(3,581 Views)

@CoastalMaineBird wrote:

Don't you have to designate one card to be on subnet 1, and another card to be on subnet 2 ?


No. You can put multiple cards on the same subnet. You might even do this regularly without realizing it (do you have both a wireless and wired connection at the office, where they're both within your corporate network)? The operating system will determine which interface to use, based on the network configuration (including the priority of various interfaces). You can tell TCP Open Listener to listen only on a particular interface, but you cannot tell TCP Open which interface to use to establish a connection (that's the job of the operating system).

 

I have no idea why setting the local port on the client would make a difference. As a first try, I would let the TCP listen function listen on all interfaces (don't specify the local IP) and see if it can connect.

Message 4 of 5
(3,567 Views)

Hi Guys,

 

@Bob - I'm using a straight cable to connect the two NIC's together. I could post the code, but really all it is, is the Simple TCP/IP example that ships with LabVIEW, with the Server.VI net listener sub-VI net address set to 10.0.0.1 and the Client.VI Open TCP Connection sub-VI address set to 10.0.0.2.

 

If I run the example without any changes the connection is made, but that is the localhost address and works regardless of what state the cable is in.

 

 

 

@Nathan - Once I changed the local port on the client side and got the program flow a bit further I also thought something weird and wonderful was happening. I honestly don't know enough about networks to say anything more.

I did as you suggested, leaving the Server listener address undefined, but forced the client to a specific address. The results are odd. It seems as if a connection is made (no errors occur on the client side), and while the server begins streaming data (which only happens when a connection is established in the version that I have working between two different machines), the client receives VERY little of the data (maybe 1 or 2 packets in the 30 seconds) and eventually the server times out. I'm not really sure what this means.

 

What I have done in the meanwhile, is to run a command line using 'TRACERT'. This has given some good results and I can actually see when the cable is unplugged.

 

Thanks for the help!

Adrian

0 Kudos
Message 5 of 5
(3,538 Views)