LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to select a Network interface card in LV ?

Hello customer support,
i have more then one NIC on my PC and want to open TCP ports on each one of them exclusively. For this case, i must exclusively select the NIC with configured IP address. How can i do it in LV ?
i will appreciate your response.
Thanks
-Ahmed
0 Kudos
Message 1 of 8
(2,774 Views)
The NIC is selected by wiring the "net address" to TCP listen.  You simply select the local net address that is assigned to the desired NIC.
 
Of course for all outgoing traffic, the correct NIC is automatically selected based on the destination address and the routing tables.
0 Kudos
Message 2 of 8
(2,772 Views)
i appreciate your quick response, but here is my scenario;
i am referring to NIC card at near side, not far side. Lets assume i have two NIC cards in my PC with IP1 and IP2, and i need to connect to destination IP3. i would like to establish TCP( in and out) connection with far side such as IP1 connects with IP3, or IP2 connects with IP3. So i need control on my PC NIC cards rather then destination side. Hope it describes..!
0 Kudos
Message 3 of 8
(2,768 Views)
As I said, in most scenarios each NIC is connected to a different network and in this case the routing tables will determine the correct local NIC to use, i.e. the one that can reach the desired target subnet.
 
If both of your NICs are connected to the same subnet, I don't see a way to force usage of a particular NIC from within LabVIEW for outgoing connection. Maybe there is some policy routing software that allows setting up what you want? What OS are you using?
 
What are you trying to achieve?
0 Kudos
Message 4 of 8
(2,765 Views)

Thanks again for your kind reply.

i am using windows XP. i am trying to connect to a machine with two LAN ports, so i need two NIC cards in my system. i need exclusive connections via LV to each LAN port. any ways, looks like there is not such way in LV, though there might be a windows utility that can be called, i will be obliged if you are already aware of it and forward me the details.

Thanks and Regards

 

0 Kudos
Message 5 of 8
(2,763 Views)

I think you may find this useful :

Can I use multiple network cards with LabVIEW?

Regards,

Ankita

0 Kudos
Message 6 of 8
(2,734 Views)

Anika, you reference  is for server applications, it does not apply for outgoing connections as desired by modestt.


@modestt wrote:
i am using windows XP. i am trying to connect to a machine with two LAN ports, so i need two NIC cards in my system. i need exclusive connections via LV to each LAN port.

I don't see why you would need a machine with two NICs to connect to a machine with two LAN ports. Could you explain your setup? Do you have two crossover cables connecting the two machines directly? In this case, you would put each NIC on a different subnet and LabVIEW will use the right NIC depending on the destination IP. 
 
What exactly are you trying to achieve? If this is a remote server, it is irrelevant which NIC is used for outgoing connection. TCP/IP is designed to be fault tolerant, packets can take various paths and there is no guarantee that all packets arrives in the sequence they were sent, or that all take the same route. Some may arrive late, some in duplicate, and some not at all. It is the responsibility of the stack to reassemble the data, request retransmissions, ACKnowledge packets, etc. before the clean and linear data is presented to the application.
0 Kudos
Message 7 of 8
(2,729 Views)
Thanks to all for responding to this problem. i found a fix and it is a windows utility that can be used to disable default NIC so traffic will automatically route to another one. If you need to know about it please let me know.
0 Kudos
Message 8 of 8
(2,718 Views)