Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Example Program
NI Supported: Yes
Publish Date: Sep 6, 2006

Finding your Local Machine's IP Address with LabVIEW

2 ratings | 2.50 out of 5
Print

Downloads

Filename: localip2.vi
Requirements: View

Filename: localip.vi
Requirements: View

The following brief program determines the IP address of the machine on which it is run. Two methods are shown.

The first program (localIP.vi) works by using the System Exec.VI to make a command line call to the standard DOS program "ipconfig.exe". The output of this program is a string containing several pieces of information including the IP address. The remainder of the LabVIEW code simply parses this string to isolate the IP address. The IP address is output as a LabVIEW string in "dot" format (0.0.0.0, etc.)

The second program (localIP2.vi) is the prefered method. It uses the String to IP and IP to String VIs. When the input to String to IP is left blank it returns the IP address of the localhost as an integer. The integer can then be converted back to a string using the IP to String VI.

Requirements


Filename: localip2.vi

Software Requirements


Application Software: LabVIEW Full Development System 7.0
Language(s): LabVIEW

 
Filename: localip.vi

Software Requirements


Application Software: LabVIEW Full Development System 7.0
Language(s): LabVIEW

 
2 ratings | 2.50 out of 5
Print

Reader Comments | Submit a comment »

Can you spell local?
Also it would be nice to have this VI in LV 6.1 so that more people can use it. It hasn't been that long since 7.0 or 7.1 were released.
- Jun 14, 2004

 

Legal
This example program (this "program") was developed by a National Instruments ("NI") Applications Engineer. Although technical support of this program may be made available by National Instruments, this program may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this program with each new revision of related products and drivers. THIS EXAMPLE PROGRAM IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).