LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I communicate alternately between two ethernet ports of computer?

Hello,

In my application I am reading data from 10 Ethernet I/O modules, out of which 5 forms the primary network and 5 forms the secondary network. And this primary and secondary networks are connected to two ethernet ports of computer. Is there a way in LabVIEW where at a time I can read data from only one ethernet port of computer and if communication fails between primary network it can switch to other ethernet port connected to secondary networks? Can anyone enlighten me?

Thanks in advance!

0 Kudos
Message 1 of 7
(927 Views)

It's not clear how the two networks are structured. Are they in different subnets, from an IP standpoint?

In any case, in principle it's very simple. You have 10 devices with 10 different IP addresses. If communication with one device fails, you can try with another. The OS will take care of the details, not your program.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 2 of 7
(916 Views)

As long as the two networks are defined as different subnets you can communicate with both of them at the same time if you want, or switch to the IPs on the secondary network when the primary fails. To LabVIEW it is then just a question of connecting to the different IP addresses - the operating system will take care of which physical network connection the communication will be routed to (based on which subnet the target address belongs to).

0 Kudos
Message 3 of 7
(910 Views)

Thank you for your quick response.


They have same subnets and different IP addresses.
I want to know is it possible in LabVIEW to switch between two ethernet ports of a PC if one is not responding?
Or enable/disable ethernet ports programmatically?

0 Kudos
Message 4 of 7
(905 Views)

As far as I know, having two network interfaces within the same subnet is not recommended, but probably it works anyway.

What Mads ad me already answered is that you don't need to do anything, just poll the desired device. I guess the OS will try on both interfaces, since both are compatible with the destination address.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 5 of 7
(898 Views)

The issue with having two NICs on the same subnet is not that LabVIEW has a problem with it, it is that the operating system needs more information to be able to route the data correctly. The easiest solution is to use two different subnets. You can read a general discussion about that here for example:

https://superuser.com/questions/839305/why-is-it-improper-network-design-to-have-two-physical-nics-o...

 

NI has described a best practise here:
https://www.ni.com/en-no/support/documentation/supplemental/11/best-practices-for-using-multiple-net....

 

But it is really a question about setting up the OS and network, if done correctly LabVIEW will work just like most other applications in this regard.

0 Kudos
Message 6 of 7
(892 Views)

Thank you for your replies.

That helped me clear my queries to some extent. 😀

0 Kudos
Message 7 of 7
(803 Views)