From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Woking with labview over multiple network interfaces

Hello

 

I have a SQL Server database located on a network with a subnet address in the range of 192.168.1.xxx and I want to access this database ,fetch some data and send it using UDP protocol to another network with address range of 10.181.37.xxx ,how can I direct my Database connection the the first network and at the same time direct my UDP connection to the second network ,provided that I have two network cards on the computer.

 

Also what other alternatives that I have ? I'm open to any suggestions.

0 Kudos
Message 1 of 16
(3,951 Views)

I think you are going to have to use the Route command via the Systemexec.vi to set the subnets to use certain interfaces

 

https://technet.microsoft.com/en-us/library/bb490991.aspx

 

Route

Displays and modifies the entries in the local IP routing table. Used without parameters, route displays help.
Syntax
route [-f] [-p] [Command [Destination] [mask Netmask] [Gateway] [metric Metric]] [if Interface]]

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 2 of 16
(3,910 Views)

Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each.  One was the company network and the other was a network that consisted of a UUT with its own private network.  I was able to use my browser to access either one without having to do anything special.  The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.

 

I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 3 of 16
(3,900 Views)

@billko wrote:

Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each.  One was the company network and the other was a network that consisted of a UUT with its own private network.  I was able to use my browser to access either one without having to do anything special.  The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.

 

I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.


Actually you are probably right about not having to really do anything. As reading the TecNet article on Route it does say: 

 

if   Interface   : Specifies the interface index for the interface over which the destination is reachable. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the if parameter is omitted, the interface is determined from the gateway address.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 4 of 16
(3,889 Views)

Interesting.  You are working with two "private" LANs, and presumably do not have Internet access.  If your two network cards are configured, one for the 192.168.x.x network, the other for the 10.x.x.x network, you should be good to go, as when you specify the IP address of your target, your PC will route it using the Network card that is configured for the address you specify.

 

Given that these are two separate networks that cannot talk to each other, two NICs seems to me the absolutely appropriate way to go (in my humble, possibly uninformed, opinion).

 

Bob Schor

0 Kudos
Message 5 of 16
(3,875 Views)

@RTSLVU wrote:

@billko wrote:

Hmmm, at one place where I worked, I was hooked up to a couple of different networks with a network port for each.  One was the company network and the other was a network that consisted of a UUT with its own private network.  I was able to use my browser to access either one without having to do anything special.  The UUT network did not support DHCP so that card was manually configured to a static IP address appropriate to the UUT network, but I don't think that had anthing to do with it.

 

I believe that as long as your NICs are properly configured - i.e., each of them has a valid IP address - the data "knows" where to go.


Actually you are probably right about not having to really do anything. As reading the TecNet article on Route it does say: 

 

if   Interface   : Specifies the interface index for the interface over which the destination is reachable. For a list of interfaces and their corresponding interface indexes, use the display of the route print command. You can use either decimal or hexadecimal values for the interface index. For hexadecimal values, precede the hexadecimal number with 0x. When the if parameter is omitted, the interface is determined from the gateway address.


I realized maybe my post seemed a bit snotty, but the "Hmmmm" was really me thinking to myself, not me putting you down.  🙂

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 6 of 16
(3,860 Views)

If I understand correctly, NI things blast to every available NIC.  With the correct one, it'll send and all will be well.  With the incorrect, it'll have no route and die.  Should appear to work without noticing the die.

0 Kudos
Message 7 of 16
(3,843 Views)

@natasftw wrote:

If I understand correctly, NI things blast to every available NIC.  With the correct one, it'll send and all will be well.  With the incorrect, it'll have no route and die.  Should appear to work without noticing the die.


Maybe that's the way it works in a PC, period?

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 8 of 16
(3,839 Views)

@billko wrote:

@natasftw wrote:

If I understand correctly, NI things blast to every available NIC.  With the correct one, it'll send and all will be well.  With the incorrect, it'll have no route and die.  Should appear to work without noticing the die.


Maybe that's the way it works in a PC, period?


That is not the way it works at all.

 

See the route command I posted the link to earlier. 

 

With two NIC configured the route (What NIC will be used) is figured out by the configuration of that NIC (IP Subnet, GATEWAY, etc). It's not just blasted out to every NIC.

 

To be sure you should set a persistent route.

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 9 of 16
(3,802 Views)

I found this KnowledgeBase Article that seems to indicate that you can manually distinguish the two NICs by using TCP Listen.vi with TCP Create Listener.vi or you can simply use TCP Open.vi and let Windows worry about which card to use.

 

I guess you can do it both ways.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 10 of 16
(3,790 Views)