59
LabVIEW in 3 Hours

LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Embed Size (px)

Citation preview

Page 1: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

LabVIEW in 3 Hours

Page 2: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

What is Test & Measurement?

KeypadFunctionality

KeypadFunctionality

LCDTesting

LCDTesting

SoundQuality

SoundQuality

AcousticQuality

AcousticQuality

RF SignalAnalysis

RF SignalAnalysis

Battery Test Battery Test

Page 3: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Engineering – IndustriesTelecom

Chemical Processing

Electronics

Military

Aerospace

Biomedical

Transportation

Semiconductor

Automotive

Manufacturing

TestIndustries

Page 4: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Instrumentation

Page 5: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Instrumentation

Page 6: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Data Acquisition

Page 7: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Hardware and Driver Software

Virtual Instrumentation

Application Software

Network

Page 8: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Virtual Instrumentation Architecture

LabVIEW

Data Acquisition and Signal Conditioning VisionPXI/CompactPCI Distributed I/O PLCsGPIB/Serial

and VXIModular

Instrumentation

Instrument / Data Acquisition Drivers

Page 9: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Section I – The LabVIEW Environment

• LabVIEW terms• Components of a LabVIEW application• LabVIEW programming tools• Creating an application in LabVIEW

Page 10: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

LabVIEW Programs Are Called Virtual Instruments (VIs)

Page 11: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

LabVIEW Programs Are Called Virtual Instruments (VIs)2 Work areas:

1. Front PanelControls = Inputs to

the computer

Page 12: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

2 Work areas:

LabVIEW Programs Are Called Virtual Instruments (VIs)

1. Front PanelControls = Inputs to

the computerIndicators = Outputs

from the computer

Page 13: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

LabVIEW Programs Are Called Virtual Instruments (VIs)

2. Block DiagramInstruction set for

controls, indicators“Source Code”

2 Work areas:

1. Front PanelControls = Inputs to

the computerIndicators = Outputs

from the computer

Page 14: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

BooleanControl

DoubleIndicator

Waveform Graph

Panel ToolbarVI Front Panel

Pull-downmenu

Page 15: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

VI Block Diagram

Thermometer Terminal

DataAcquisitionFunction

While Loop

Stop ButtonTerminal

Stop LoopTerminal

TemperatureIndicator

Delay

Pull-downmenu

Page 16: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Controls and Functions Palettes

Graphical, floating palettes

Used to place controls & indicators on the front panel, or to build the block

diagram

Functions Palette(Block Diagram Window)

Controls Palette(Front Panel Window)

Page 17: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Operating Tool

Positioning/Resizing Tool

Labeling Tool

Coloring Tool

Tools Palette (Front Panel)

Page 18: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Operating Tool

Positioning/Resizing Tool

Labeling Tool

Coloring Tool

Wiring Tool

Breakpoint Tool

Probe Tool

Tools Palette (Block Diagram)

Automatic Selection

Page 19: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Run Button

Continuous Run Button

Abort Execution

Pause/Continue Button

Text Settings

Align Objects

Distribute Objects

Reorder

Execution Highlighting Button Step Into Button

Step Over Button

Step Out Button

Additional Buttons on the Diagram Toolbar

Status Toolbar

Page 20: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Run Button

Continuous Run Button

Abort Execution

Pause/Continue Button

Text Settings

Align Objects

Distribute Objects

Reorder

Execution Highlighting Button Step Into Button

Step Over Button

Step Out Button

Additional Buttons on the Diagram Toolbar

Status Toolbar

Page 21: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Basic Spectral Measurement.viOpen a Virtual Instrument

Page 22: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Template Browser

Page 23: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Create a New VI

Page 24: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Front Panel Window

Creating a VI – Front Panel

Page 25: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Front Panel Window

Creating a VI – Front Panel

Page 26: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Front Panel Window

Creating a VI – Block DiagramBlock Diagram

Page 27: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

LabVIEW’s Context Help

Page 28: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Creating a VI – Adding Functions

Page 29: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Creating a VI – Adding Functions

Page 30: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

wiring toolWire attachment points (nodes) flash when the wiring tool is passed over

Creating a VI – Wiring

Right Click Node Terminals (communication ports)

Page 31: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Creating a VI – Adding Functions

Page 32: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Creating a VI – Adding Functions

Page 33: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Express Functions

Same overall functionality

Page 34: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Section II

• What is a subVI?• Creating a subVI• Using a VI as a subVI

Page 35: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

SubVIs

LabVIEW is modular• Any VI can be used as a subroutine (or subVI) to other programs

• Advantages– Modular– Easier to debug– Don’t have to recreate code

Page 36: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Creating a SubVI

1. Create code2. Select code for use in

subVI3. Click Edit-Create subVI

Page 37: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Editing a SubVI

Page 38: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Insert the SubVI into a Top Level VI

Accessing user-made subVIs Functions >> Select a VI

Or Drag icon onto target diagram

Page 39: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Create SubVI from your code

Page 40: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

View your subVI

Page 41: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Section III – Data Acquisition

• Data acquisition (DAQ) basics• Connecting Signals• Simple DAQ application

Page 42: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

DAQ – Data Acquisition

• Plug-in board for a computer with:– Analog input channels– Analog output channels– Counters– Digital I/O

• Controlled by a suite of LabVIEW VIsFunctions>>Data Acquisition

Page 43: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

DAQ – DataAcquisition

Page 44: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Hardware Connections

BNC-2120

SCB-68

SC-2075

Page 45: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Channel Connections

+

-

Differential

Measurement

Single-Ended

MeasurementGround

SignalMotor

Battery Signal 1

Signal 2

Page 46: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Analog Signals

1.659487387 volts 1010100111110ADC

Data Acquisition System

Page 47: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Digital Signals

Page 48: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Measurement & Automation Explorer

Page 49: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Channel Connections

• Single-Ended Mode: ACHx and AIGND used to connect signal to channel x

• Differential Mode: ACHx, ACHx+8 used to connect signal to channel x

Channel Connections

Page 50: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Section IV – Loops and Charts

• For Loop• While Loop• Charts• Graphs

Page 51: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Loops• While Loops

– Terminated by condition– Always Runs Once– Delay between iterations

may be added

• For Loops– Terminate after N iterations– N specified on block diagram

Page 52: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Loops (cont.)

While Loop

1. Select the loop

2. Enclose Code to Repeat

Page 53: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Charts and Graphs•Waveform Charts display a history of values over time

- Strip Chart (continuous scrolling)

- Scope Chart (repeatedly redraws over the same region)

- Sweep Chart (redraws curve to the right of the old curve)

•Waveform Graphs and X-Y Graphs

- Wavefrom Graphs plot Y for regular increments of X

- X-Y Graphs plot Y vs. X for any X-Y sets (non-regular)

Page 54: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

ChartsWaveform chart – special numeric indicator

that can display a history of valuesControls >> Graphs >> Waveform Chart

Page 55: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Wiring Data into Charts

Single Plot Charts Multiplot Charts

Page 56: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Combining data onto one graph

Page 57: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

File I/O Using The LVM Express Function

Page 58: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

File I/O Using Traditional Functions

•Read/write to spreadsheet file

•Read/write characters to file (ASCII)

•Read lines from file

•Read/write binary file

Easy File Easy File I/O VIsI/O VIs

Page 59: LabVIEW in 3 Hours. What is Test & Measurement? Keypad Functionality Keypad Functionality LCD Testing LCD Testing Sound Quality Sound Quality Acoustic

Conclusion

• See www.ni.com for more help, examples