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!
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.
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).
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?
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.
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:
NI has described a best practise here:
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.
Thank you for your replies.
That helped me clear my queries to some extent. 😀