From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Programmatically deploy WSN Application image to multiple WSN Nodes in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview
This VI shows how to programmatically deploy WSN Application image to multiple WSN Nodes


Description
National Instruments wireless sensor network (WSN) measurement nodes offer low-power, reliable operation for long-term, distributed deployments. With the LabVIEW Wireless Sensor Network (WSN) Module Pioneer, you can use graphical programming to customize the node’s behavior, adding intelligence to extend battery life; increase analog and digital input performance; perform local control, analysis, and data reduction; and interface with custom sensors. You can download LabVIEW WSN applications wirelessly to NI WSN measurement nodes, allowing seamless updates to deployed nodes.

When working with a large Wireless Sensor Network, one can reduce deployment time by programmatically uploading a WSN application image to multiple WSN nodes using the powerful WSN Host API. In specific, the implementation of WSN Deploy Firmware.vi helps deploy a WSN application image to all programmable WSN nodes registered to a programmable WSN Gateway cutting down the deployment time of large WSN test beds.

*Multiple WSN image deployment can only work if all programmable WSN nodes are the same model.

Attached is a project containing a sample VI which uses the WSN Deploy Firmware.vi to update all registered programmable WSN nodes.

 

Requirements

Software

  • LabVIEW 2012 (or compatible)
  • LabVIEW Real-Time Module 2012 (or compatible)
  • LabVIEW Wireless Sensor Network Module (or compatible)
  • NI-WSN 1.3.0 (or compatible)

Hardware

  • Programmable WSN Gateway (NI 9792)
  • Programmable WSN Nodes (NI WSN-3202) x3

 

Steps to Implement or Execute Code

  1. Register all programmable WSN nodes on your WSN Gateway using Measurement & Automation Explorer.
  2. In the Project Explorer of LabVIEW, build the application on the first WSN node which will generate a <Your Application Name>.pkg file in your project directory .../<Your Project Name Folder>/<WSN Gateway>/<Node>/<WSN Application Name>/<Your Application Name>.pkg
  3. Upload via FTP the *.pkg file to the programmable WSN Gateway.
  4. Open, configure, and run WSN9792Main.vi. Make sure to specify the correct location of the *.pkg file in relation to the programmable WSN Gateway.
  5. The VI will scan for all registered programmable WSN nodes on the gateway and it will upload the *.pkg firmware image to all. The VI will stop execution until the very last programmable WSN node has been uploaded with the firmware.

 

Additional Information or References
VI Block Diagram

SnapCrab_WSN9792 Main 2012 NIVerifiedvi Block Diagram_2017-10-16_0-15-43_No-00.png

WSN node on Measurement & Automation Explorer

Step1 Image.png

 

 

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

Aldo A
Applications Engineer
National Instruments

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