LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain all the IP addresses of the computers on a LAN

Using LabView, How can I to obtain all the IP addresses or DNS names of all the computers on my Local Area Network?
0 Kudos
Message 1 of 9
(6,041 Views)

You mean like running an nbtstat command?

If you open up a command prompt in Windows, and type: nbtstat -c

that lists what's in your netbios remote cache name table. Does that give you the information you're looking for? If so, you could run that command from LV. I can't think of another way right now... anyone else?

Message Edited by Sima on 07-31-2007 08:48 PM

0 Kudos
Message 2 of 9
(6,019 Views)

Another command to try is: net view

There's just going to be some parsing needed when you do it through a DOS command.

Message Edited by Sima on 07-31-2007 09:24 PM

0 Kudos
Message 3 of 9
(6,009 Views)

Here is a program which uses the System Exec to call command prompt and send the nbstat -c command.  It will also output the information to the front panel.  Hope this is what you are looking for.

Adam

0 Kudos
Message 4 of 9
(6,007 Views)
Hello,

Nmap will easily produce all kinds of data regarding your network or remote network. It has a command line interface so you can interface it vi the command line function of LabVIEW.

E.g.  "nmap -sP 192.168.4.0/24" will output all active IP addresses in the 192.168.4.x network.

All you have to do is parse the output.

http://insecure.org/nmap/download.html

Kind regards,

André
Regards,
André (CLA, CLED)
0 Kudos
Message 5 of 9
(5,984 Views)

Here's another link to check out Listing Computer Names in a Windows Network

It uses the net view command. You'll get the computers that are in your workgroup/domain - different than the info from an nbtstat -c command. So the question is, what works for you?

0 Kudos
Message 6 of 9
(5,960 Views)

Adam,

Can you please repost the VI saved for 7.1?

- Partha ( CLD until Oct 2027 🙂 )
0 Kudos
Message 7 of 9
(5,821 Views)
This VI will not save on my PC from 8.0 to 7.1 without modification as the System Exec.vi cannot save from VI.LIB to a previous version.  Included are screenshots of the VI.  Cheers!
Download All
0 Kudos
Message 8 of 9
(5,791 Views)
In general, this is not as easy as it sounds unless you make some assumptions on the OS, DNS registration, and the absense of personal firewall software.
  • There could be firewalled nodes that don't even respond to pings due to personal firewall settings.
  • There could be non-windows PCs that won't show up in the browse list.
  • Nodes might not have a DNS entry (especially if this is a private network).
  • Most windows PCs will have a netbios name that will be substituted if the DNS lookup fails.
  • Nodes might be busy and not reply for a few seconds
  • etc....

So, the question that needs to be asked is about the purpose of your code.

  1. Do you simply want to generate a list of PCs that have NBT running?
  2. Do you want a list of PCs that have a custom server running? (e.g. a LabVIEW program listening on a specific port)
  3. Do you want an exhastive list of all IPs in use locally to prevent assigning duplicate IPs?

For point (3) you could send an ARP request to all local IPs and look who replies. (This will show even heavily firewalled PCs, but will of course ONLY work for nodes on the same subnet!).

Message 9 of 9
(5,777 Views)