Electronics and Communication Department
CCE402: Modeling and Simulation
Lecture 1:
Introduction to LabVIEW
By:
Dr. Aya Hossam
LabView Source
1. Download the source of LabVIEW from National Instrument site link”:
https://www.ni.com/en-lb/support/downloads/software-
products/download.labview.html#411240
2. The link of NI_License Activator:
http://www.mediafire.com/file/7ak5oajp56ccsy8/NI_License_Activator_v1
.1.rar/file
Course Goals
➢This course prepares you for the following:
• What is Data Acquisition and Why use it?
• Develop an idea of what LabVIEW really is.
• Solve problems using LabVIEW.
• Familiarization with graphical programming.
• Use this knowledge to create programs in LabVIEW:
- Heating and cooling system
- Lighting system
What is Data Acquisition and Why use it?
• Traditional Experiments – signals from sensors are sent to analog or digital meters,
read by the experimenter, and recorded by hand.
• In automated data acquisition systems the sensors transmit a voltage or current signal
directly to a computer via a data acquisition system.
• Software such as LabVIEW controls the acquisition and processing of such data.
• The benefits of automated systems are many:
• Improved accuracy of recording.
• Potential to automate pre and post processing and build in quality control.
• Reduce transmission time.
Overview of LabVIEW
• LabVIEW is the abbreviation of –
“Laboratory Virtual Instrument
Engineering Workbench”
• Graphical programming language that
allows for instrument control, data
acquisition, and pre/post processing
of acquired data.
• LabVIEW depends on graphical
symbols rather than textual language
to describe programming actions, so
it’s called “High level graphical
language”.
LabVIEW = Fun!
Graphical Programming:
• Very different from traditional programming like C#, Maple, MATLAB, MathScript, etc.
• It is more like a “drawing program” than a Programming Language.
• This makes it easy to use for those who are not programmers (or dont like programming )
• Excellent tool when using Hardware, when you need to take Measurements (DAQ), etc.
• It is fun and makes you very creative!
Virtual Instruments (VIs)
➢How does LabVIEW work?
• LabVIEW programs are called virtual instruments, or VIs
• Appearance and operation imitate physical instruments, such as
oscilloscopes and digital multimeters.
Application of LabVIEW
➢ Machine monitoring and control :LabVIEW Real-Time module helps in preparing
powerful machine monitoring and control applications
➢ Research and Analysis : Scientist and Researchers use it biomedical ,and energy
industries etc .
➢ Control Design : Real world data can be compared with theoretical data .
Parts of a VI
• In order to create a new VI, select “Blank VI” or in order to create a new
LabVIEW project, select “Empty project”.
• LabVIEW VIs contain three main components:
1. Front Panel 2. Block Diagram 3. Icon/Connector Pane
Parts of a VI :– 1. Front Panel
• User interface for the VI.
• You build the front panel with :
➢ controls (inputs).
➢ indicators (outputs).
Parts of a VI :– 1. Front Panel
• Simply, the front panel is the window through
which the user interacts with the program.
• When you run a VI, you must have the front
panel open so that you can input data to the
executing program.
• The front panel is where you see your
program’s output.
Controls & indicators – Front Panel
controls indicators
simulate instrument input simulate instrument output
devices devices
supply data to the block display data the block
diagram of the VI. diagram acquires or
generates.
Like: knobs, push buttons, Like: graphs, LEDs, and other
dials, and other input devices displays.
Controls? or indicators?
Controls = Inputs from the user = Source Terminals
Indicators = Outputs to the user = Destinations
Note that :
Controls can be identified by a triangle on the right of the
block shown on the back panel
Manipulating Controls and Indicators
➢ Right click on an indicator to
• Change to control
• Change format or precision
➢ Right click on a control to
• Change to indicator
• Change mechanical action (whether to latch
open or closed, and what to use as default…)
Parts of a VI :– 2. Block Diagram
• Contains the graphical source
code “Actual program”.
• Front panel objects appear as
terminals on the block diagram.
• Invisible to user.
• Read left to right, like a book.
Terminals
When you place a control
(or indicator) on the
FRONT PANEL
LabVIEW automatically
creates a corresponding
control (or indicator)
terminal on the BLOCK
DIAGRAM
Parts of a VI :– 3. Icon/Connector Pane
• Icon: graphical representation of a VI
• Connector Pane: map of the inputs and outputs of a VI
• Icons and connector panes are necessary to use a VI as a subVI
− A subVI is a VI that is inside of another VI
− Similar to a function in a text-based programming language.
Icon Connector Pane
Finding Front Panel Objects
Front Panel :- Controls Palette
• Contains the controls and indicators you use to
create the front panel
• Access from the front panel by selecting:
View» Controls Palette or by right clicking on the
front pane.
• The controls are grouped into categories in a tree.
• The sub palettes have a lock in the top left corner
to keep the window visible while you are working
with the controls.
Front Panel :– Front Panel Toolbar
Run Button
Continuous Run Button
Abort Execution
Pause/Continue Button
Text Settings
Align Objects
Distribute Objects
Reorder
Resize front panel objects
Front Panel:– Numeric Controls/Indicators
The numeric data type can represent numbers of various types, such as
integer or real.
Numeric Control
Increment/Decrement Buttons
Numeric Indicator
Front Panel :– Boolean Controls/Indicators
• The Boolean data type represents data that only has two parts, such as
True and False or On and Off.
• Use Boolean controls and indicators to enter and display Boolean (True or
False) values.
• Boolean objects simulate switches, push buttons, and LEDs.
Boolean Boolean
Control Indicator
Front Panel :– Strings
• The string data type is a sequence of ASCII characters
• Use string controls to receive text from the user such as a password or
username.
• Use string indicators to display text to the user.
Front Panel :– Shortcut Menus
• All LabVIEW objects have associated
shortcut menus.
• As you create a VI, use the shortcut
menu items to change the look or
behavior of front panel and block
diagram objects.
• To access the shortcut menu, right-click
the object
28
Front Panel :– Property Dialog Box
• Right-click a front panel object and
select Properties to display
• The options available on the
property dialog box are similar to
the options available on the
shortcut menu for that object.
29
Block Diagram
Block diagram objects include the following:
• Terminals
• SubVIs
• Functions
• Constants
• Structures
• Wires
Block Diagram :– Functions Palette
• Contains the VIs, functions, and constants
you use to create the block diagram.
• Invoke the function palette by VIEW>>
Function Palette or by right clicking on the
block diagram.
• The functions are grouped into
categories.
Block Diagram:– Block Diagram Toolbar
Block Diagram :– Terminals
• Terminals are:
− Block diagram appearance of front panel objects
− Entry and exit ports that exchange information between the front
panel and block diagram
− Analogous to parameters and constants in text-based programming
languages
• Change the view type of a terminal by toggling the View as Icon
selection from the right click menu
Block Diagram Terminals
Block Diagram :– Nodes
• Objects on the block diagram that have inputs and/or outputs and perform
operations when a VI runs.
• Analogous to statements, operators, functions, and subroutines in text-
based programming languages.
• Nodes can be functions, subVIs, or structures.
Nodes
Block Diagram :– Function Nodes
• Fundamental operating elements of LabVIEW.
• Do not have front panels or block diagrams but do have connector panes.
• Double-clicking a function only selects the function – does not open it like
a VI.
• Has a pale-yellow background on its icon.
Block Diagram :– Wires
• Transfer data between block diagram objects through wires.
• Wires are different colors, styles, and thicknesses, depending on their
data types.
• A broken wire appears as a dashed black line with a red X in the middle.
DBL Numeric Integer Numeric String
Scalar
1D Array
2D Array
Block Diagram:– Wiring Tips
• Press <Ctrl>-B to delete all broken wires.
• Right-click and select Clean Up Wire to reroute the wire.
Searching for Controls, VIs & Functions
Find controls, function, and VIs using the Search button on the Controls
and Functions palette
39
Selecting A Tool
• Create, modify, and debug VIs using the tools
provided by LabVIEW.
• A tool is a special operating mode of the
mouse cursor.
• The operating mode of the cursor corresponds to
the icon of the tool selected.
• When using the Automatic Tool Selection,
LabVIEW chooses which tool to select based on
the current location of the mouse.
40
Tools Palette
Automatic Selection Tool
Scrolling Tool
Operating Tool Breakpoint Tool
Positioning/Resizing Tool Probe Tool
Labeling Tool Color Copy Tool
Wiring Tool Coloring Tool
Shortcut Menu Tool
Dataflow
LabVIEW follows a dataflow model for running VIs:
• A node executes only when data are available at all of its input terminals
• A node supplies data to the output terminals only when the node finishes
execution
42
Exercises
Exercise no.1
➢Create a simple LabVIEW application (VI) with a Front Panel with some
Controls and Indicators. Create the logic by connecting the Terminals on
the Block Diagram.
Answer
The Front Panel could look as: The Block Diagram could look as:
44
Exercise no.2
➢Create a simple calculator that Add and Subtract numbers like this: The
Front Panel could look as:
45
Exercise no.3
➢ Create a VI program that converts from Convert °C to °F :
46
Exercise no.4
➢ Create a voltage divider using LabVIEW:
47
Exercise no.5
➢ Create a Thermal Control system using the following requirements:
❑ Program requirements – Automatic Mode
− Regulate house air temperature
− AC is ON when temperature is greater than 80oF
− Heater is ON when temperature is less than 60oF
− Both OFF when the temperature is between 60oF & 80oF
❑ Program requirements – Manual Mode
− Heater and AC power are controlled directly by user (overrides automatic mode)
48
Procedure of Solving Exercise 5
Front panel must have:
• 3 LEDs: AC, Heater, and Manual operation
• 3 switches for AC, heater, and system operation
(automatic/manual)
• A temperature control represented by a thermometer
Back panel should have:
• A Boolean case statement to control manual and automatic
operations