they turn the I/Os off when exiting a Run condition.
Without this “shutting down” of the VI, you will
have to run it again and click the front panel
pushbutton to the off position before stopping the
VI.
To make your VI shut off LED0 when stopping
the program, place a flat sequence around the
While Loop on the block diagram as shown in
Figure 24: Functions Palette > Programming >
Structures > Flat Sequence. Click on the flat
sequence frame, right-click, and then from the pull-down menu, select “Add Frame After” as shown in
Figure 25. In the blank frame to the right of the
While Loop frame, copy and paste the LED icon as
shown in Figure 26 (ctrl C > ctrl V will work for
copying and pasting).
On the value terminal, click and add a constant
which should be an “F” for false or to turn the LED
off after the While Loop is terminated. If you click
on the F, it will change to a “T” for true (but we
need it to be F for now). Now when the VI is run —
even if the virtual pushbutton on the front panel has
turned LED0 on — it will turn off if the stop button
on the VI’s front panel is pressed.
However, if you click on the Abort Execution
stop sign to halt the VI’s execution, it will stop while
it is in the While Loop and never complete the final
frame of the VI (which turns LED0 off). This is a
good demonstration of why it is best to stop VIs
with an internal control rather than use the Abort
Execution icon. This should only be used to stop a
VI which cannot be stopped in any other way.
Being able to use many of the NI MyRIO’s
abilities is going to take more than one article to
complete. Therefore, this will be a series of five
articles covering different features of the NI MyRIO
and LabVIEW software, building up to a
final temperature control system with data
logging capabilities. Part 2 will cover
building and deploying an embedded VI
and controlling the MyRIO wirelessly with
an Apple iPad, so stay tuned!
These five articles cannot cover all of
the MyRIO’s features, but will give the
reader a solid starting place to build upon.
Hopefully, you have been able to duplicate
all of the demonstrations shown in this
article.
The NI website at www.ni.com
contains many tutorials and other helpful
items for all of their hardware and software
products. You may want to spend some
time looking over their many available
online resources. NV FIGURE 26.
FIGURE 25.
FIGURE 24.
December 2016 47