LabVIEW Course
LabVIEW Course
• After you build the front panel, you add code using graphical
representations of functions to control the front panel objects.
• The code on the block diagram is graphical code, also known as G code or
block diagram code.
Launching the LabVIEW Environment: When you launch LabVIEW, the Getting
Started window appears as shown in Figure1-1.
• You create the front panel with controls and indicators, which are the interactive
input and output terminals of the VI, respectively.
• Controls are knobs, push buttons, dials, and other input devices.
• Controls simulate instrument input devices and supply data to the block diagram
of the VI.
• Indicators simulate instrument output devices and display data the block
diagram acquires or generates.
Numeric Controls and Indicators:
While the VI runs, the Abort Execution button appears. Click this
button to stop the VI immediately if there is no other way to stop
the VI.
Click the Pause button to pause a running VI.
Block Diagram
Controls, indicators, and constants behave as inputs and outputs of the block
diagram algorithm.
Consider the implementation of the algorithm for the area of a triangle:
Area = 1/2 * Base * Height In this algorithm, Base (cm) and Height (cm) are
inputs and Area (cm^2) is an output, as shown in Figure1-13.
Block Diagram
Block Diagram Nodes
• Nodes are objects on the block diagram that have inputs and/or
outputs and perform operations when a VI runs.
SubVIs are VIs that you create to use inside of another VI or that you
access on the Functions palette.
Omega Temp sub vi in Temperature history vi
Wires:
A broken wire appears as a dashed black line with a red X in the middle,
as shown below. Broken wires occur for a variety of reasons, such as
when you try to wire two objects with incompatible data types.
Functions Palette
The Functions palette contains the VIs, functions and constants we use to
create the block diagram.
We access the Functions palette from the block diagram by selecting View »
Functions Palette.
Block Diagram Toolbar
When you run a VI, buttons appear on the block diagram toolbar that you
can use to debug the VI.
Highlight Execution
Clean Up Diagram
Run
LabVIEW Help Utilities
Use the Context Help window, the LabVIEW Help, and the NI
Example Finder to help you create and edit VIs.
Dataflow
Figure1-31. In this case, the block diagram executes from left to right
A B C
A
You cannot know because inputs to the Add and Divide functions are available
at the same time, and the Random Number function has no inputs.
In a situation where one code segment must execute before another, and no
data dependency exists between the functions, use other programming
methods, such as error clusters, to force the order of execution.
Building a Simple VI
Most LabVIEW VIs have three main tasks—acquiring some sort of data,
analyzing the acquired data, and presenting the result.
1. Which function executes first: Add or Subtract?
a. Add b. Subtract c. Unknown
Question # 1
Test your code to compute the area “A” with following input parameters.
a= 3, b=5 and c=7.
Front Panel
Question # 2 Assignment 1: Question 2
Block Diagram