using labview templates and sample projects for desktop applications
DESCRIPTION
LabVIEW Desktop AppTRANSCRIPT
![Page 1: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/1.jpg)
ni.com
Using LabVIEW Templates and Sample Projects for Desktop
Applications
Brian Reiche
Account Manager, Eastern Virginia
Mark Lewis
Account Manager, Navy and NASA
![Page 2: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/2.jpg)
2 ni.com
Agenda
• Lunch and Networking
• Presentation on Design Templates in LabVIEW 2012
• LabVIEW Coding Challenge
![Page 3: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/3.jpg)
3 ni.com
What Are Templates and Sample Projects?
Template Boilerplate project, code, documentation, and folder structure
Sample Project A working application that is a starting point for customization
Typically based on a template
![Page 4: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/4.jpg)
4 ni.com
Why Use a Template or a Sample Project?
Increase efficiency
Reduce errors
Increase reuse
Shorten learning curves
When you develop applications with LabVIEW
![Page 5: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/5.jpg)
5 ni.com
LabVIEW 2012 Templates/Sample Projects
• Simple State Machine
• Queued Message Handler
• Finite Measurement
• Continuous Measurement and Logging
• Actor Framework
• Feedback Evaporative Cooler
• Continuous Measurement and Logging (NI-DAQmx)
• Finite Measurement (NI-DAQmx)
• LabVIEW Real-Time Control (NI-DAQmx)
• LabVIEW Real-Time Waveform Acquisition and Logging (NI-DAQmx)
• LabVIEW FPGA Control on CompactRIO
• LabVIEW FPGA Waveform Acquisition and Logging on CompactRIO
• LabVIEW Real-Time Control on CompactRIO (RIO Scan Interface)
• LabVIEW FPGA Project
• Instrument Driver Project
• Robotics Project
• Touch Panel Project
Covered in this presentation
![Page 6: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/6.jpg)
6 ni.com
Desktop Templates
Template Description
Blank Project
Blank VI
Simple State Machine Customizable execution sequence for sections of code
Queued Message Handler Sections of code running in parallel and sending data or messages between them
Actor Framework Multiple, independent tasks that communicate with each other (uses LV Classes extensively)
Instrument Driver Project Create new instrument driver project wizard present in previous versions of LabVIEW
![Page 7: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/7.jpg)
7 ni.com
Desktop Sample Projects
Template Root Template
Finite Measurement Simple State Machine
Continuous Measurement and Logging Queued Message Handler
Feedback Evaporative Cooler Actor Framework
DAQmx variants of sample projects are installed by NI-DAQmx installer
![Page 8: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/8.jpg)
9 ni.com
Create Project Dialog
Filter by type or target
Filter by keyword search
Open documentation in new window
![Page 9: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/9.jpg)
10 ni.com
More Information…
![Page 10: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/10.jpg)
11 ni.com
Configuring Your Project
Project name used in folder and file names
Root must be an empty folder
Optional prefix helps keep files distinctly named
Icon overlay visually associates created VIs with this project
![Page 11: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/11.jpg)
12 ni.com
Simple State Machine
Project organized using folders <Replace Me> text lets you
know which controls to replace
![Page 12: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/12.jpg)
13 ni.com
Simple State Machine Block Diagram Blue “Code Needed” comments tell you where to make changes
Comments give high level insight about the code
![Page 13: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/13.jpg)
14 ni.com
Simple State Machine Block Diagram
Event structure instead of polling in wait state
![Page 14: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/14.jpg)
15 ni.com
Finite Measurement Sample Project
![Page 15: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/15.jpg)
16 ni.com
Initialize
Wait for Event
Update UI
Configure Acquire Load Data Clear Data Analyze
Stop
Save Data
Export Data
Copy Graph
Finite Measurement
Wait for Event
Configure Acquire Analyze
Sample Project
![Page 16: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/16.jpg)
17 ni.com
Queued Message Handler Template
![Page 17: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/17.jpg)
18 ni.com
Queued Message Handler
UI event capture loop
Message handling loop
Queue setup
Template
![Page 18: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/18.jpg)
19 ni.com
Queued Message Handler
UI event capture loop
Message handling loop
Create queue for message communication and user event to stop event loop
Template
![Page 19: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/19.jpg)
20 ni.com
Queued Message Handler
Message handling loop
Queue setup
Event structure in it’s own loop
String messages added to a queue
Template
![Page 20: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/20.jpg)
21 ni.com
Queued Message Handler
Queue setup
Subsequent operations added to queue
Message strings dequeued and passed to case structure
UI event capture loop
Template
![Page 21: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/21.jpg)
22 ni.com
Continuous Measurement and Logging Sample Project
![Page 22: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/22.jpg)
23 ni.com
Continuous Measurement and Logging
UI event capture loop
UI message handling loop Queue, event, and notifier setup
Acquisition message loop
Logging message loop
Data display loop
Sample Project
![Page 23: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/23.jpg)
24 ni.com
Continuous Measurement and Logging
UI event capture loop
UI message handling loop Queue, event, and notifier setup
Acquisition message loop
Logging message loop
Data display loop
Command via queue
Data via queue
Data via notifier
Sample Project
![Page 24: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/24.jpg)
25 ni.com
Continuous Measurement and Logging
UI event capture loop
UI message handling loop Queue, event, and notifier setup
Data display loop Acquisition and logging loops encapsulated in subVIs
Sample Project
![Page 25: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/25.jpg)
26 ni.com
Continuous Measurement and Logging
UI event capture loop
UI message handling loop Queue, event, and notifier setup
Data display loop Acquisition and logging loops encapsulated in subVIs
Sample Project
![Page 26: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/26.jpg)
27 ni.com
Continuous Measurement and Logging
UI event capture loop
UI message handling loop
Acquisition message loop
Logging message loop
Data display loop uses notifier rather than a queue
Sample Project
![Page 27: Using LabVIEW Templates and Sample Projects for Desktop Applications](https://reader033.vdocument.in/reader033/viewer/2022050811/577c789d1a28abe054907909/html5/thumbnails/27.jpg)
28 ni.com
Templates and Sample Projects
Increase efficiency
Reduce errors
Increase reuse
Shorten learning curves
When you develop applications with
LabVIEW
What Are Templates and Sample Projects?
Template
Boilerplate project, code, documentation, and folder structure
Sample Project
A working application that is a starting point for customization
Typically based on a template
Why Use a Template or a Sample Project?
• Try them next time you start a new project
• Post in the forums (forums.ni.com) if you have questions