LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I get the local computer's ID and IP address in Labview?

I want to get the local computer's ID and IP address, but i found i can't do it in labview.
Could anybody do me a favor to give me some guidance?
Thank very much!
Message 1 of 18
(18,294 Views)

Under the Communication palette, under TCP, there are two functions you need to get this info':  'String to IP' and 'IP to String.'

1.  Drop the String to IP function on the diagram. 

2.  Do not wire any input to it. 

3.  Take its Output and wire it to the 'net address' input of the 'IP to String' 

5.  Display the Output of the 'IP to String' 

Depenging on the True/False input to the 'IP to String' function, you get the machine name versus IP address. 

See attachemnt... guess it's easier than explaining  🙂

Hope this helps.

-Khalid

Message 2 of 18
(18,292 Views)

Dear Khalid

Thank you Very much!

That's works so perfect and convenient method, before that, I get computer name and IP through call Win API.

Thanks!

0 Kudos
Message 3 of 18
(18,286 Views)

Dear sir,

 

If my PC having more than one IP address, how to get all IP addresses.

Please let me know.

 

Regards,

S Nagaraju

0 Kudos
Message 4 of 18
(16,120 Views)

Right-click the "String to IP" function and select "Multiple Output". Then use the "IP to String" in a for loop.

 

Message 5 of 18
(16,097 Views)

Thank you very much.

0 Kudos
Message 6 of 18
(16,057 Views)

Hi, how can i get, with certainly, only the Ethernet ip?...i wont to exlude the possibility to have the problem of getting the wlan ip.

0 Kudos
Message 7 of 18
(14,849 Views)

IP.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 8 of 18
(14,836 Views)

I've tryed this, the first time i was connected to the wlan, the second time i've moved to the ethernet and this solution didn't refreshed the ip returned.I had to wait for about 5 minuts to see the correct ip.

0 Kudos
Message 9 of 18
(14,831 Views)

Well you could always run ipconfig using the systemexec.vi and parse the output for your IP address.

 

ipc.png

========================
=== Engineer Ambiguously ===
========================
0 Kudos
Message 10 of 18
(14,825 Views)