l2 - Labview - Introduction - v22
l2 - Labview - Introduction - v22
l2 - Labview - Introduction - v22
LabVIEW introduction
Spring 2022– Lecture #2
Bekkeng 30.12.2021
Software-Defined Instrumentation
vs.
http://www.ni.com/labview/whatis/
Install LabVIEW on own PC
Write Text
Express VI
Indicators
Control
LabVIEW - Indicators Front Panel
Right-click the
While Loop’s
“stop symbol”
LabVIEW Data Type examples
• Color coding of terminals and block Right-click
diagram wires
Floating-point numbers
Integer
String
Dynamic
Boolean
The dynamic data type is a special type for use with Express
VIs. Because dynamic data undergoes an automatic
conversion to match the indicator to which it is wired, Express
VIs can slow down the block diagram execution speed
LabVIEW Express VI – Simulate Signal
Double-click
for properties
LabVIEW Express VI – Amplitude and
Level Measurements
Double-click
for properties
LabVIEW Express VI – Write to File
LabVIEW – FFT Express VI
LabVIEW – Digital Filter Express VI
While Loop:
Loops
Functions – Programming
– Structures:
For Loop:
LabVIEW timing functions
Software Timing
• To make a while loop run at nice regular intervals add the Wait
Until Next ms Multiple
– always use the Wait Until Next ms Multiple (or another
timer) in a loop to avoid using unnecessary CPU power.
– without any “wait” a while loop will run as fast as possible ...
• Two loops can be software synchronized using the Wait Until
Next ms Multiple in both loops.
• Variables
• Occurrences
• Notifier
• Queues
• Semaphores
• Rendezvous
Dequeueing Elements
• Execution highlighting
• Single-stepping
• Probe
Right-click wire
• Breakpoints
Extra
Projects in LabVIEW
• Projects in LabVIEW consist of VIs, files necessary for those VIs to run
properly, and supplemental files such as documentation or related
links. Use the Project Explorer window to manage projects in
LabVIEW
https://blog.digilentinc.com/4-rookie-labview-mistakes-and-how-to-prevent-them/#comments
Sample projects
• File – Create project
• Checkbox
– Under System
Extra
• Edit-clear
• Draw a black frame around the icon
• Select suitable Glyphs and Icon text
LabVIEW – Help I
• Right-click an icon (VI), and select Help.
LabVIEW – Help II
• Select Help»Show Context Help from the front panel or the block
diagram
• Move the cursor over to the graphical symbol to see the help
information
• Very useful when looking at functions in the ‘Functions’ palette:
LabVIEW Help III
Event Structure
• To limit the CPU usage while waiting
for user interface events (mouse
clicks, key pressed etc.)
– Avoids polling!
• Detects all events!
• Do minimal processing inside event
structures!
• How it works:
– Operating system broadcasts
system events (mouse click,
keyboard, etc.) to applications
– Registered events are captured by
event structure and executes
appropriate case
– Event structure enqueues events
that occur while it’s busy
Extra
Static Sequence
Known order of execution
Dynamic Sequence
Distinct states can operate
in a programmatically
determined sequence
Extra
1 2
Extra
Visualization
• Displaying data can require
considerable computer
resources
• Improving display performance:
– using smaller graphs and
images
– display fewer data points
(down sampling)
– less frequent display updates