Example Code

WiFi Library for LabVIEW

Code and Documents

Attachment

Overview

This library provides some often used funcionalities for WiFi.

 

Screenshot LibraryScreenshot Library

Description

The following functions of netsh (network shell) have been implemented:
1. Add Profile - Adds a WLAN profile to the specified interface on the computer.
2. Connect - Connects to a wireless network by using the specified parameter.
3. Custom XML Write - Writes XML files without the <LVData> header.
4. Delete Profile - Removes a WLAN profile from one or multiple interfaces.
5. Disconnect - Disconnects the specified interface from a wireless network.
6. Export Profile - Saves WLAN profiles as XML files to the specified location.
7. Get Authentication Encryption - Returns the authentication and encryption type.
8. Show Networks - Displays a list of wireless networks that are visible on the computer.
9. Show Profiles - Displays a list of wireless profiles that are configured on the computer.
10. Enjoy WiFi!

 

Screenshot ExampleScreenshot Example

The library has to be installed using JKI VI Package Manager. Its functions can be accessed in the Function Palettes window under "WiFi Library". The following files are located under the paths:
Toolkit VI's - user.lib\Eric Hayoz\WiFi Library.llb
Example - examples\Eric Hayoz\WiFi Library Example.vi

 

The separate VI's are included in the zip-file as well.

 

Hardware and Software Requirements

1. LabVIEW 2012 (or compatible)
2. Windows 7 (or compatible)
3. Computer with wireless adapter

 

Steps to Implement or Execute Code

1. Either install the package using JKI VI Package Manager and access the features in the Function Palettes window under "WiFi Library".

2. Or download the zip file containing the separate files.

 

This library has only been tested with WPA2-Personal authentification. Other types of authentifications/encryptions or complex company-networks may not work with this library as the XML profile of those are different, so little adjustments for the XML-handling may be required. Just give it a try;)

 

Additional Information or References

Netsh Commands for Wireless Local Area Network (WLAN) in Windows Server 2008

https://technet.microsoft.com/en-us/library/cc755301(v=ws.10).aspx#bkmk_wlanAddProfile

 

WiFi Network Scanning and Connecting with LabVIEW - Discussion Forums - National Instruments

https://forums.ni.com/t5/Example-Program-Drafts/WiFi-Network-Scanning-and-Connecting-with-LabVIEW/ta...

Eric H.
Applications Engineering
National Instruments

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

Contributors