LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IP Address with two NICs

LabVIEW 7.0
  I have Win2000, my client has XP Pro.

  My program, as a convenience, displays on the front panel the IP address of the machine it's running on. This is so he can enter this address in another machine and communicate with it.



  I'm using the STRING to IP function (input unwired), and the IP to STRING function to display the number.

  My client has TWO NICs installed - one for data acquisition (we are collecting data from Ethernet machines in a test cell), and another for general traffic (printing, inter-cell transfer, etc).




  We discovered recently that the program was displaying the local IP number (192.168.x.x), which is the DAQ net. This is not the one we want.



  So I found the MULTIPLE OUTPUT option on the STRING to IP function and turned it on. I used an INDEX ARRAY function to pick out address #1 (not #0) and display that. That works fine.


  My question is: how do I know that #1 is the right number to use? This app will be deployed on a bunch of machines, will the local be Net #0 on all machines? Is that a system config issue? Do I need to tell him to configure a control panel somewhere a certain way? Do I need to read both addresses and display the one that does NOT start with "192."? How do I make this bulletproof?

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 1 of 6
(3,016 Views)
Hi CMB,
 
There are several approaches to this.  Some less favorable to others... such as at one extreme:  to identify with a label which NIC goes to what network....
 
However,  to keep automation... "automated", how about the following: 
 
Since you can automatically detect each IP address, you can then implement a small test to "self-discover" which IP (NIC) talks tho which network.  For instance, you may want to ping a known static address, such as a mail-server to discover that it is part of the WAN and not the test network.  You may also prefer to ping by host name just in case the IP address of that machine changes.   In the event that you do not know any IP address or host names, you may try to ping something outside the LAN (over internet for instance), something that the test network could not reach (your own website for instance??).
 
Would you be autodetecting on an ongoing basis (ie. every day) or only during equipment setup and configuration?
 
Ray
 
 
Message 2 of 6
(3,012 Views)
Would you be autodetecting on an ongoing basis (ie. every day) or only during equipment setup and configuration?


Ideally, I'd detect every time the program starts, probably once a day.


What determines the position of the card in the order. The help file says they're in the order that the system resolver finds them, but what determines that?


Is it system config?


Is it slot number of the card?


Is it a flip of a coin?



Can I assume that 192.168.x.x is always the local net?

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 6
(2,992 Views)

The last I checked (WinME) this was OS dependant.

The NIC cards were listed in the order I added them to the system. If I deleted the first, the second becaome the first when I added the first one back in. Boy was that a nightmare.

Since new OS configure these on the fly it may be even harder to predict now.

 

Sorry Coastal, but that is all I can offer.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 6
(2,985 Views)
If I deleted the first, the second becaome the first when I added the first one back in.


So, If someone does some troubleshooting on the system, and if I depend on the order, then I might be up the creek.


I suspected that, which is why I asked the question.


I had better do some detecting then. I think I'll look for the 192.x.x.x, as I'm pretty sure they'll set it up that way.



Oddly enough, everything swems to works OK with the connections, it's just the display of the number that's questionable.

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 5 of 6
(2,981 Views)

Yes, selection of the proper NIC is transparent to the user.

There was an old version of FP that could not find a fresh FP unit if it was on the second NIC because it used the MAC address on the first NIC.

As long as you just ride on top of the OSI-7-Layer model you are OK. It is digging into it that gets complicated.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 6 of 6
(2,976 Views)