Loop Structures and LabVIEW for WSN

Updated Feb 20, 2018

Reported In

Driver

  • NI-WSN

Issue Details

When using the LabVIEW Wireless Sensor Network Module (LabVIEW for WSN), I notice that the template VI (Figure 1) doesn't have a loop in it.  Why does the template VI not have a loop such that my code executes multiple times?


Figure 1: Default LabVIEW for WSN Template (with No Loops)

Solution

The LabVIEW for WSN template VI is essentially a subVI being called periodically by the WSN node.  The rate at which your code periodically executes is set by the Sample Interval (Figure 2) value you specify in the Start case of the template.


Figure 2: Configuration Node in Start Case of LabVIEW for WSN Default Template VI

There is one reason for using a loop structure in the default template VI.  Note that upon calling the default template VI (your code, Figure 1) multiple times, there's no built-in way to pass data from one case to another.  You can use a single-iteration loop (Figure 3) such that you can implement a shift register in order to pass data from one case to another.


Figure 3: Default LabVIEW for WSN Template (with Loop and Shift Register Added)

WAS THIS ARTICLE HELPFUL?

Not Helpful