LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to get the computer's IP address

Hi,

This should be easy but I cannot find a function to get my own IP address.

Thanks,

Marce
0 Kudos
Message 1 of 11
(4,786 Views)
Use "string to IP" without an input wired. Feed the "net address (U32)" output to "IP to string" with a "true" wired to "dot notation?". The resulting string is your IP address in dot notation. Voila!

Message Edited by altenbach on 06-20-2005 08:12 AM

Message 2 of 11
(4,779 Views)
You use the String to IP and IP to String functions on the Communication>TCP palette. When youdon't wire an input to the STring to IP function, it will default to the local pc. See attached picture.
Message 3 of 11
(4,775 Views)
If you have only one network adapter, you can simply use the String To IP VI from the TCP pallete.
Since the laptop I work on can have at least four different IP addresses (2 WiFis, a network card and a PCMCIA cellular connection), sometimes all at the same time, I modified an example I found to find all the addresses(7.0, windows only).

___________________
Try to take over the world!
0 Kudos
Message 4 of 11
(4,771 Views)
TST, here's a much simpler way to get all local IP addresses if you have mutiple adapters:

Right-click on "string to IP" and select "Multiple output". Now place the "IP to string" in a FOR loop and you'll get an array of strings containing all IPs. 🙂
Message 5 of 11
(4,767 Views)
Cool. I don't really use that VI much, but it's nice to know there's a better way.

Obviously, I can't find it now, but I've seen several functions (at least in 7.0), which have an option in the context menu called "in place something" or something similar. It looks like it's an option which can be checked, but clicking it does nothing.
Do you have any idea what those are? Past\future options?

___________________
Try to take over the world!
0 Kudos
Message 6 of 11
(4,738 Views)
I agree, most functions are overloaded with hidden gems that are sometimes hard to find. I used this particular option (Multiple output) to make a multiDNS lookup VI, that returns all associated IP addresses and their reverse translation of a given host name. (see attached image of a typical output and code).



(Be aware that it get's a bit sluggish if there is no reverse translation of an IP because it will wait for a DNS timeout).

Message Edited by altenbach on 06-20-2005 12:01 PM

Message 7 of 11
(4,724 Views)
Here is the option.

I couldn't find it in 6.1 or 7.1, but it pops up in many functions in 7.0. Since I don't remember seeing it in the past, it's possible that it started because of something I did (the only thing I did recently was installing some newer OpenG packages).
In this case it's grayed out, but I have also seen cases where it's not. Any idea?

___________________
Try to take over the world!
0 Kudos
Message 8 of 11
(4,698 Views)


@tst wrote:
Here is the option.

I couldn't find it in 6.1 or 7.1, but it pops up in many functions in 7.0. Since I don't remember seeing it in the past, it's possible that it started because of something I did (the only thing I did recently was installing some newer OpenG packages).
In this case it's grayed out, but I have also seen cases where it's not. Any idea?




Did you add

showInplaceMenuItem=True

to your labview.ini file lately?

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
Message 9 of 11
(4,692 Views)
Yes, this seems to be from an undocumented INI setting you must have added. A Google search will show you the details. 🙂
Message 10 of 11
(4,692 Views)