Example Code

Get IP Address / LAN Settings

Code and Documents

Attachment

Overview
This Example give you the LAN Settings like IP Address, Subnet Mask and Default Gateway.

 


Description
This example can be used in some project as an subVI to get the IP address, Subnet Mask and the Default Gateway.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Download the attachment to your computer
  2. Open the VI "Get IP Address 2012 NIVerified.vi"
  3. Run the VI

 

Additional Information or References
VI Snippet

 Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Regards
Prabhakant Patil

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Prabhakant_Patil
Member
Member
on

Please click on like if you like it.

Your valuable suggestions are always welcome for the improvement.

Regards

Prabhakant

Regards
Prabhakant Patil
andrew_2
Member
Member
on

In my Vista system it needs "IPv4 Address" instead "IP Address" in the first string; otherwise it doesn't pick up the main IP address of my computer connected to a mobile internet modem. IPv4 works ok.

Himanshu_Goyal
Active Participant
Active Participant
on

Hello Prabhakant,

I try to run the attached code but i am not getting Indicator output in IP Address. I try with both wire LAN and WIFI connection.

Thanks and Regards
Himanshu Goyal | LabVIEW Engineer- Power System Automation
Values that steer us ahead: Passion | Innovation | Ambition | Diligence | Teamwork
It Only gets BETTER!!!
Biggeveen
Member
Member
on

This doesn't work if you have a non-English windows installation. You can get a more robust implementation if you use the Windows IP Helper API. Is harder to implement, I know...

Example output on German Windows 2008 R2

Windows-IP-Konfiguration

Ethernet-Adapter LAN-Verbindung 4:

   Verbindungsspezifisches DNS-Suffix:

   Verbindungslokale IPv6-Adresse  . : fe80::6cc9:c754:b1d3:4a57%16

   IPv4-Adresse  . . . . . . . . . . : 192.168.1.24

   Subnetzmaske  . . . . . . . . . . : 255.255.255.0

   Standardgateway . . . . . . . . . :

Ethernet-Adapter LAN-Verbindung 3:

   Verbindungsspezifisches DNS-Suffix:

   Verbindungslokale IPv6-Adresse  . : fe80::5c7d:72e2:5cf9:25f0%14

   IPv4-Adresse  . . . . . . . . . . : 10.10.0.24

   Subnetzmaske  . . . . . . . . . . : 255.255.0.0

   Standardgateway . . . . . . . . . : 10.10.0.1

Ethernet-Adapter LAN-Verbindung 2:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Ethernet-Adapter LAN-Verbindung:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Tunneladapter <removed>:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Tunneladapter <removed>:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Tunneladapter <removed>:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Tunneladapter <removed>:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

Tunneladapter LAN-Verbindung* 9:

   Medienstatus. . . . . . . . . . . : Medium getrennt

   Verbindungsspezifisches DNS-Suffix:

NickNZ
Member
Member
on
zaighum
Member
Member
on

I want to access data from Wifi Arduino Server to Labview ..... However, I can access data from arduino server by typing adress 192.168.100.5 in any browser over wifi.  What should I do ?

willian.anderson
Member
Member
on

eu usei muito bom , porem como é em portugues tive que alterar cluster

I used very good, but as it is in Portuguese I had to change the cluster

 

brazilian portuguese.png