Example Code

Temperature Measurements using Programmable WSN-3212 Node, NI-9795 C-series Gateway, and cRIO-9075 controller.

Code and Documents

Attachment

A wireless sensor network consists of three main components: nodes, gateways, and software. The spatially distributed measurement nodes interface with sensors to monitor assets or their environment. The acquired data wirelessly transmits to the gateway, which can operate independently or connect to a host system where you can collect, process, analyze, and present your measurement data using software. Routers (Mesh Nodes) are a special type of measurement node that you can use to extend WSN distance and reliability.

This example project demonstrates how to target a programmable WSN-3212 Node and relay temperature data back to the NI-9795 C-series Gateway on a cRIO-9075 by using shared variables:

1) "TC0" transmits thermocouple data.

2) "Battery Voltage" monitors the health of internal WSN-3212 node batteries.

3) "External Power" determines if WSN-3212 is powered using an external power supply.

4) "Link Quality" reports the signal strength of the first message hop in the network.

5) "Mesh Router" determines if the WSN-3212 is configured as a Mesh Router. (Configurable through Measurement & Automation Explorer)

Software Requirements:

LabVIEW 2011 SP1 or later

LabVIEW Real-time Module 2011 SP1 or later

NI LabVIEW Wireless Sensor Network (WSN) Module Pioneer

Thermocouple J type

To use this example:

First, connect the thermocouple to the TC0+ and TC0- connections on the WSN-3212 node.

Next, download and open WSNProject.lvproj. Specify the IP address of your cRIO-9075 or re-target for your specific cRIO controller making sure your NI-9795 C-series Gateway is in Slot 1 of the chassis. Navigate to the cRIO >> Wireless Sensor Network >> Node1 (ID 1, NI WSN-3212) > LabVIEW WSN Target @1 >> Build Specifications >> Right-click My Application >> Select Deploy Application to deploy "WSN Target.vi" WSN application to the WSN-3212 Node.

ProjectExplorer.png

After successful WSN node deployment, you can now run "Target.vi" user interface interactively which will update the status indicators on the front panel.

Target.png

Aldo A
Applications Engineer
National Instruments

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

Contributors