Date post: | 08-Jul-2016 |
Category: |
Documents |
Upload: | vvipmembers |
View: | 226 times |
Download: | 0 times |
ni.com
Using LabVIEW Templates and Sample Projects for Desktop
Applications
Brian Reiche
Account Manager, Eastern Virginia
Mark Lewis
Account Manager, Navy and NASA
2 ni.com
Agenda
• Lunch and Networking
• Presentation on Design Templates in LabVIEW 2012
• LabVIEW Coding Challenge
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
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
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
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
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
9 ni.com
Create Project Dialog
Filter by type or target
Filter by keyword search
Open documentation in new window
10 ni.com
More Information…
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
12 ni.com
Simple State Machine
Project organized using folders <Replace Me> text lets you
know which controls to replace
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
14 ni.com
Simple State Machine Block Diagram
Event structure instead of polling in wait state
15 ni.com
Finite Measurement Sample Project
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
17 ni.com
Queued Message Handler Template
18 ni.com
Queued Message Handler
UI event capture loop
Message handling loop
Queue setup
Template
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
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
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
22 ni.com
Continuous Measurement and Logging Sample Project
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
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
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
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
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
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