1. 2 labview intro, basics, tips, tricks doug norman & stephanie brierty national instruments...

16
1

Upload: berniece-gray

Post on 01-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

1

Page 2: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

2

LabVIEW Intro, Basics, Tips, Tricks

Doug Norman & Stephanie BriertyNational Instruments

January 8, 2010

Page 3: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

3

What is LabVIEW?

• Speak G Graphical programming

language• Go with the flow

Dataflow programming• Easy writing

Easy to learn Powerful debugging tools

Page 4: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

4

The LabVIEW Language

• A LV program consists of one or more Virtual Instruments (VIs)

• A VI is like a function or a procedure or a subroutine – except that it has a richer interface

Page 5: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

5

Each VI has 2 Windows

Front Panel• User Interface (UI)

– Controls = Inputs– Indicators = Outputs

Block Diagram• Graphical Code

– Data travels on wires from controls through functions to indicators

– Blocks execute by Dataflow

LabVIEW Programs Are Called Virtual Instruments (VIs)

5

Page 6: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

6

• Block diagram execution– Dependent on the flow of data– Block diagram does NOT execute

left to right• Node executes when data is

available to ALL input terminals• Nodes supply data to all output

terminals when done

Dataflow Programming

6

Page 7: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

7

Controls Palette (Controls & Indicators)

7

Indicator:Numeric Slide

Control:Numeric

Customize Palette View

Page 8: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

8

Functions (and Structures) Palette

8

(Place items on the Block Diagram Window)

Structure:While Loop

Page 9: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

9

LabVIEW Nodes• While loop• For loop• Boolean logic• PID Control• Arrays• Signal processing• Mathematics• Timing

Page 10: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

10

LabVIEW Types

• Floating point

• Integer

• Boolean

• String

• Array – note wire thickness

• Cluster

Page 11: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

11

LabVIEW Tasks

• Multiple tasks in parallel• Data flow still applies• Loops 1, 2, and 3 will run• Loop 4 runs after 3 stops

Page 12: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

12

Debugging Techniques• Finding Errors

• Execution Highlighting

• Probes

Click on broken Run button.Window showing error appears.

Click on Execution Highlighting button; data flow is animated using bubbles. Values are displayed on wires.

Right-click on wire to display probe and it shows data as it flows through wire segment.

You can also select Probe tool from Tools palette and click on wire.

12

Page 13: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

13

Context Help Window• Help»Show Context Help or press <Ctrl+H>• Hover cursor over object to update window

13

Additional Help– Right-Click on the VI icon and

choose Help, or– Choose “Detailed Help.” on the

context help window

Page 14: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

14

LabVIEW Tips and Tricks

• Icon editing• LabVIEW is Polymorphic• Race conditions• Shift when copying or moving• Ctrl drag mouse to make space• Edit>>Create SubVI• Right-click terminal>>Create• Edit>>Make Current Values Default

Page 15: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

15

LabVIEW Shortcuts and Tools• Ctrl-R: Run the VI• Ctrl-E: Swap between front panel and block diagram• Ctrl-H: Turn on context help• Ctrl-B: Remove broken wires• Ctrl-Z: Undo

• View>>Navigation Window or Ctrl-Shift-N• Tools>>CompactRIO Imaging Tool…• Tools>>Setup Axis Camera• Tools>>Options

Page 16: 1. 2 LabVIEW Intro, Basics, Tips, Tricks Doug Norman & Stephanie Brierty National Instruments January 8, 2010

16

Conclusion

• LabVIEW is easy to learn yet incredibly powerful• Shortcuts can speed up development time• To learn more, visit ni.com/first

Questions?