two functions have not been “wired” together.
As your cursor comes near the “value” terminals
on the two Function icons, it should change
from a cross cursor to a “connect wire” cursor (which
looks like a roll of wire), so the two can be wired together.
Refer to Figure 19. This should fix the broken Run icon so
the VI can be run.
Click on the Run icon and when BUTTON0 on the
bottom of the MyRIO is pressed, the blue LED0 should
light up. You will see a couple of windows while the
program is compiling and deploying, and you will be
prompted to save the VI as well.
Clicking on the Stop button on the front panel will
stop the program. You may have also noticed a red “stop
sign” icon to the right of the Run icon; this will also
terminate a program — especially if it is caught in an
endless loop somewhere — but it is not the recommended
way to terminate or stop a normally functioning VI (Figure
20). Using the stop sign or Abort Execution icon to stop a
VI can cause problems if your VI needs to complete tasks
as it closes, such as logging data or turning certain I/Os
off or on at the conclusion of the VI’s operation; this will
be demonstrated later on.
Hopefully, your first VI was successful. The front
panel or user
interface for this
demo VI is very
bare and not
to look at. Let’s
add a virtual
a virtual LED to
the front panel
so that either
they “or” the
and LED0 will
operate the VI.
On the front
panel from the Controls Palette > Boolean > pushbutton,
place a pushbutton and LED on the front panel: Controls
Palette > Boolean > round LED; see Figure 21. Wire these
two items together on the block diagram along with an
“Or gate” as shown in Figure 22. The Or function can be
found on the block diagram from Functions Palette >
Boolean > Or.
The previous connection between the BUTTON0 and
LED0 will need to be deleted before the new connections
can be made. As your cursor hovers over the connection,
right-click and then from the pull-down menu select
“Delete Wire Branch” (see Figure 23). Now, when the VI
is run, clicking on either the virtual button on the front
panel or the physical BUTTON0 on the MyRIO unit will
turn on the physical LED0 and the virtual LED on the front
panel. You might also note that if the front panel
pushbutton is in the “on” position when the VI is stopped,
LED0 will remain on.
It is usually a good idea to design your VIs so that
46 December 2016