LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Computer Name

I think there was a VI
'Get computer name'
somewhere in the GToolbox (or former LVutil).
I cannot find it - any hints?

I need the name of the computer the program works on because it
communicates with another application via TCP/IP and I would like to set
the standard application adress as the local PC.

Thanks
Urs Bögli
0 Kudos
Message 1 of 12
(20,380 Views)
Hello Urs,

An easy way is to use the "string to IP" wired to the "IP to string" VI (TCP palette). The IP to string function has a boolean input where you can define if you want to see the IP address or the machine name of the PC.

Regards,
Luca
Regards,
Luca
Message 2 of 12
(20,380 Views)
hello

See the attached vi
Hope it helps.
Alipio
---------------------------------------------------------
"Qod natura non dat, Salmantica non praestat"
---------------------------------------------------------
Message 3 of 12
(20,382 Views)
Luca,
that's fine, an easy solution but hard to find !

Attached is my VI now.

Thanks
Urs

Luca P. schrieb:

>Hello Urs,
>
>An easy way is to use the "string to IP" wired to the "IP to string"
>VI (TCP palette). The IP to string function has a boolean input where
>you can define if you want to see the IP address or the machine name
>of the PC.
>
>Regards,
>Luca
>
Message 4 of 12
(20,382 Views)
Alipio,
thanks for this solution. I think its disadvantge is the OS dependance.
Some target PCs are Win98, some Win2000.
The other solution mentioned seems to be independent of the platform and
is very easy to implement!
see other news
Urs

alipio schrieb:

>hello
>
>See the attached vi
>Hope it helps.
>Alipio
>
0 Kudos
Message 5 of 12
(20,382 Views)

This one worked nice!

 

0 Kudos
Message 6 of 12
(15,240 Views)

You could always use the system exec to run the command

 

IPCONFIG /ALL

 

Then parse the text for the Host Name

 

That would eliminate any Windows version poblems.

========================
=== Engineer Ambiguously ===
========================
Message 7 of 12
(15,220 Views)

More than ten years later, Luca's solution is still very easy and has no Windows version problems. It looks like this :

 

Computer name.png

Message 8 of 12
(15,200 Views)

If you want more than just the computer name, you can use something like this.

"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 12
(15,164 Views)

But not such a good solution on Windows Server OS:

 

https://lavag.org/topic/19322-get-host-name-performance-issue/

 

-John
------------------------
Certified LabVIEW Architect
0 Kudos
Message 10 of 12
(13,713 Views)