LabVIEW Basics I: Introduction
11500 North Mopac Expressway
Austin, Texas 78759
ni.com/training
What You Need To Get Started
• LabVIEW Basics I Course Manual
• LabVIEW Basics I Course CD
• Multifunction DAQ device
• GPIB interface
• DAQ Signal Accessory, wires, and cable
• NI Instrument Simulator and power supply
• Serial and GPIB cables
Computer running
LabVIEW 8.6 or later
and Windows 2000 or later
ni.com/training
File Locations
The course installer places the course files in the following
location: Exer Lab
Root cises VIE
Dire <or> W
ctory Solut Basi
ions cs I
ni.com/training
Topic
Instructional Methods Developmen
t Exercise
• Lecture gives a foundation
in the topic Concept
Exercise
Lecture
• Instructor reinforces
foundation through Demonstr
ations
Quizzes
demonstrations and quizzes
• Use concept exercises to further explore a topic
− Watch a simulation, experiment with example VIs
• Use development exercises to gain hands-on experience
− Demonstration of a finished development exercise further
reinforces the learning process
ni.com/training
Getting The Most Out Of This Course
• Experiment with hands-on exercises to understand the
methods used
• Implementations explore a possible solution—you may find
a better one
• Do not come to class prepared to develop an outside
application; concentrate on the exercises given to build a
good foundation
ni.com/training
Courses
New User Experienced User Advanced User
LabVIEW Basics I LabVIEW Intermediate I LabVIEW Advanced I
LabVIEW Basics II LabVIEW Intermediate II
Skills learned: Skills learned: Skills learned:
• LabVIEW environment • Modular application • Large application design
navigation development • Advanced development
• Basics application creation • Structured design and techniques
using LabVIEW development practices • Implementing multideveloper
• Basics of data acquisition and • Inter-application projects
instrument control communication and
connectivity techniques
Certifications
Certified LV Associate Certified LabVIEW Certified LabVIEW
Developer Exam Developer Exam Architect Exam
Skills tested: Skills tested: Skills tested:
• LabVIEW environment • LabVIEW application • LabVIEW application
knowledge development expertise development mastery
ni.com/training
6
Course Learning Map
ni.com/training
Course Goals
This course prepares you for the following:
• Solve problems using LabVIEW
• Use data acquisition and instrument control in LabVIEW
applications
• Use modular programming practices
• Develop, debug, and test LabVIEW VIs
• Effectively use a state machine architecture
ni.com/training
8
Lesson 1
Problem Solving
TOPICS
A. Software Development E. Testing
Method F. Maintenance
B. Scenario G. Project
C. Design
D. Implementation
ni.com/training
A. Software Development Method
• Problem solving skills are essential to creating software
solutions
• Computer programmers use a software development
method
• Using the software development method, code is more
likely to be successful, readable, scalable, and
maintainable
ni.com/training
10
Software Development Method
1. Define the problem (Scenario)
2. Design an algorithm or flowchart
3. Implement the design
4. Test and verify the implementation
5. Maintain and update the implementation
ni.com/training
11
Software Development Method
• Used in all hands-on development exercises in this course
• Scenario and Design are usually given; you implement the
design and test the implementation
ni.com/training
12
B. Scenario
Define the problem
Furnace Example:
Cure a material at a certain temperature for a set amount of
time in a furnace. You must know:
• Cure time
• Cure temperature
• Method for adjusting the temperature
ni.com/training
13
C. Design
Design a solution by analyzing the problem:
• Identify the software inputs
• Identify the software outputs
• Identify additional requirements
• Design an algorithm or flowchart
ni.com/training
14
Design—Software Inputs
Raw data you want to process, such as information received
from the user, data acquisition, instrument control and so on
Furnace Example:
Cure Time (seconds)
Desired Cure Temperature (degrees Kelvin)
Current Furnace Temperature (degrees Kelvin)
ni.com/training
15
Design—Software Outputs
Results of calculations, processing, or other implemented
conditions such as information displayed to the user, data
written to file, signal generation, and so on
Furnace Example:
On/Off switch to control coil voltage
ni.com/training
16
Design – Additional Requirements
Factors that influence solving the problem
Furnace Example:
Assume the furnace cannot start until the interior
temperature is the same as the exterior temperature. This
requirement adds an additional input: Exterior Temperature
(degrees Kelvin).
ni.com/training
17
Design – Algorithm
Steps that process your inputs and create outputs
Furnace Example:
1. Read exterior temp 5. If current temp ≥ desired temp,
2. Read interior temp turn off voltage to coil
3. If interior temp ≠ 6. If current temp < desired temp,
exterior temp, go to turn on voltage to coil
step 1 7. If time < cure time, go to step 4
4. Read interior temp 8. Turn off voltage to coil
ni.com/training
18
Design –
Flowchart
Visual design
of an algorithm
Furnace Example:
ni.com/training
19
Design – State Transition Diagram
Type of flowchart that indicates the states of a program and
transitions between states
• State—part of a program that satisfies a condition,
performs an action or waits for an event
• Transition—condition, action, or event that causes the
program to move to the next state
ni.com/training
20
Design – State Transition Diagram
Furnace
Example:
ni.com/training
21
D. Implementation
• Create code for the algorithm or flowchart
• Course goal— to successfully create implementations in
LabVIEW
ni.com/training
22
E. Testing
Test implementation with logical and illogical data
• Does logical data produce expected result?
• Does illogical data produce expected error?
• How does illogical data affect the results?
• Is error handling strategy sufficient?
ni.com/training
23
F. Maintenance
• Ongoing process of resolving programming errors
• Implement changes to the original solution
ni.com/training
24
Exercise 1-1: Software Development Method
Solve a non-programming problem using the software
development method described in this course.
GOAL
ni.com/training
G. Project – Temperature Weather Station
1. Acquires a temperature every half second
2. Analyzes each temperature to determine if the
temperature is too high or too low
3. Alerts the user if there is a danger of a heat stroke or a
freeze
4. Displays the data to the user
5. Logs the data if a warning occurs
6. If the user does not stop the program, the entire process
repeats
ni.com/training
26
G. Project
ni.com/training
27
G. Project
Many possible solutions
Example of
an alternate solution:
ni.com/training
28
Summary—Matching Quiz
1. Scenario A. Apply an algorithm or
2. Design flowchart
3. Implementation B. Verify the code
4. Testing C. Define the problem
5. Maintenance D. Update the code
E. Identify the inputs and
outputs
ni.com/training
29
Summary—Matching Quiz Answers
1. Scenario C. Define the problem
2. Design E. Identify the inputs and
3. Implementation outputs
4. Testing A. Apply an algorithm or
5. Maintenance flowchart
B. Verify the code
D. Update the code
ni.com/training
30