+ All Categories
Home > Documents > LabVIEWIntroduction-SixHour

LabVIEWIntroduction-SixHour

Date post: 07-Apr-2018
Category:
Upload: arindam2712
View: 217 times
Download: 0 times
Share this document with a friend
90
Virtual Instrumentation With LabVIEW 
Transcript
Page 1: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 1/90

Virtual Instrumentation With LabVIEW 

Page 2: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 2/90

C ourse Goals

� Understand the components of a Virtual Instrument 

� Introduce LabVIEW and common LabVIEW functions

� Build a simple data acquisition application

�C reate a subroutine in LabVIEW 

Page 3: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 3/90

S ection I 

� LabVIEW terms

�C omponents of a LabVIEW application

� LabVIEW programming tools

�C reating an application in LabVIEW 

Page 4: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 4/90

Front Panel

Controls = Inputs

Indicators = Outputs

Block Diagram

Accompanying ³program´

for front panel

Components ³wired´

together 

LabVIEW Programs Are C alled Virtual 

Instruments (VIs)

Page 5: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 5/90

BooleanC ontrol 

DoubleIndicator 

Waveform Graph

Panel Toolbar VI Front Panel 

Page 6: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 6/90

VI Block Diagram

Numeric C onstant 

Thermometer Terminal C all tosubVI 

While Loop

KnobTerminal 

S top ButtonTerminal 

S top LoopTerminal 

TemperatureGraph

Page 7: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 7/90

C ontrols and Functions Palettes

Graphical, floatingpalettes

Used to place controls &indicators on the front

panel, or to build theblock diagram

Controls Palette(Panel Window)

Functions Palette(Diagram Window)

Page 8: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 8/90

Operating Tool

Positioning/Resizing Tool

Labeling Tool

Wiring Tool

Shortcut Menu Tool

� Floating Palette� Used to operate and modify

front panel and block diagram

objects.

Scrolling Tool

Breakpoint Tool

Probe Tool

Color Copy Tool

Coloring Tool

Tools Palette

Automatic Selection Tool

Page 9: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 9/90

Run Button

Continuous Run Button

Abort Execution

Pause/Continue Button

Text Settings

Align Objects

Distribute Objects

Reorder 

Execution HighlightingButton

Step Into Button

Step Over Button

Step Out Button

Additional Buttons on theDiagram Toolbar 

S tatus Toolbar 

Page 10: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 10/90

Do Not Delete This SlideDo Not Delete This Slide

Page 11: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 11/90

Signal Generation

and Processing.vi

Help » Find Examples«

Browse According to: Task

» Analyzing and Processing Signals

» Signal Processing

» Signal Generation and Processing.vi

O pen and Run a Virtual Instrument 

Page 12: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 12/90

ControlTerminals

Block Diagram Window

Front Panel Window

Indicator Terminals

C reating a VI 

Page 13: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 13/90

C reating a VI ± Block Diagram

�After Creating Front Panel Controls and Indicators,

Switch to Block Diagram <Ctrl-E>

�Move Front Panel Objects to Desired Locations

Using the Position/Size/Select Tool�Place Functions On Diagram

�Wire Appropriate Terminals Together to Complete

the Diagram

Page 14: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 14/90

Wiring Tips ± Block Diagram

Wiring ³Hot Spot´

Click While Wiring To Tack Wires DownSpacebar Flips Wire Orientation

Click To Select Wires

Page 15: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 15/90

Do Not Delete This SlideDo Not Delete This Slide

Page 16: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 16/90

Dataflow Programming

� Block diagram does NOT execute left to right

� Node executes when data is available to ALLinput terminals

� Nodes supply data to all output terminals whendone

Page 17: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 17/90

H elp O ptions

Context Help� Online help

� Lock help� Simple/Complex Diagram help

� Ctrl + H

Online reference

� All menus online� Pop up on functions in diagram to access online info directly

Page 18: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 18/90

Do Not Delete This SlideDo Not Delete This Slide

Page 19: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 19/90

Exercise 1 - C onvert °C  to °F 

Page 20: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 20/90

Debugging Techniques

� Finding Errors

� Execution Highlighting

� Probe

Click on broken Run button

Window showing error appears

Click on Execution Highlighting button; dataflow is animated using bubbles. Values aredisplayed on wires.

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

 You can also select Probe tool from Toolspalette and click on wire

Page 21: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 21/90

S ection II ± S ubVIs

� What is a subVI?

� Making an icon and 

connector for a subVI � Using a VI as a subVI 

Page 22: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 22/90

S ubVIs

�A SubVI is a VI that can be used within

another VI

�Advantages ± Modular 

 ± Easier to debug

 ± Don¶t have to recreate code

 ± Require less memory

Page 23: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 23/90

Icon and C onnector 

� An icon represents a VI in other block diagrams

� A connector shows available terminals

for data transfer 

Icon

Connector 

Terminals

Page 24: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 24/90

S ubVIs

SubVIsSubVIs

Page 25: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 25/90

S teps to C reate a S ubVI 

�C reate the Icon

�C reate the C onnector 

� Assign Terminals

�S ave the VI 

� Insert the VI into a Top Level VI 

Page 26: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 26/90

C reate the Icon

�Right-click on the icon in thediagram or front panel

Page 27: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 27/90

C reate the C onnector 

Right click on the icon pane (front panel only)

Page 28: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 28/90

 Assign Terminals

Page 29: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 29/90

S ave The VI 

�Choose an Easy to Remember Location

�Organize by Functionality

 ± Save Similar VIs into one directory (e.g. Math Utilities)

�Organize by Application ± Save all VIs Used for a Specific Application into one

directory or library file (e.g. Lab 1 ± Frequency

Response)

� Library Files (.llbs) combine many VI¶s into a single file, ideal for 

transferring entire applications across computers

Page 30: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 30/90

Insert the S ubVI into a Top Level VI 

Accessing user-made subVIs

Functions >> Select a VI

Or 

Drag icon onto target diagram

Page 31: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 31/90

Tips for Working in LabVIEW 

�Keystroke Shortcuts ± <Ctrl-H> ± Activate/Deactivate Context Help Window

 ± <Ctrl-B> ± Remove Broken Wires From Block Diagram

 ± <Ctrl-E> ± Toggle Between Front Panel and Block

Diagram ± <Ctrl-Z> ± Undo (Also in Edit Menu)

�Tab Key ± Toggle Through Tools on Toolbar 

�Tools » Options« ± Set Preferences in LabVIEW

�VI Properties ± Configure VI Appearance,Documentation, etc.

Page 32: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 32/90

S ection III ± Data Acquisition

�Data acquisition (DAQ) basics

�Connecting Signals

�Simple DAQ application

Computer 

DAQ Device

Terminal Block

Cable

Sensors

Page 33: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 33/90

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 VIs

Functions>>Data Acquisition

Page 34: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 34/90

DAQ ± Data Acquisition

Simple Temperature Acquisition Example

Two parameters

�Device = 1�Channel = 0

Page 35: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 35/90

Data Acquisition Terminology 

� Resolution - Determines H ow Many Different VoltageC hanges C an Be Measured 

 ± Larger Resolution More Precise Representation of S ignal 

� Range - Minimum and Maximum Voltages ±S maller range More Precise Representation of S ignal 

� Gain - Amplifies or Attenuates S ignal for Best Fit in

Range

Page 36: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 36/90

Do Not Delete This SlideDo Not Delete This Slide

Page 37: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 37/90

H ardware C onnections

BNC-2120

SCB-68

SC-2075

Page 38: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 38/90

Exercise 2 ± S imple Data Acquisition

Complete Convert C to F.vi, then create Thermometer.vi.

Page 39: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 39/90

Do Not Delete This SlideDo Not Delete This Slide

Page 40: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 40/90

S ection IV ± Loops and C harts

�For Loop

�While Loop

�Charts

�Multiplots

Page 41: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 41/90

Loops

� While Loops ± Have Iteration Terminal

 ± Always Run Once

 ± Run According to Continue

Terminal

� For Loops

 ± Have Iteration Terminal

 ± Run According to input N

Page 42: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 42/90

Loops (cont.)

For Loop

1. Select the loop

2. Enclose Code to

Repeat

Page 43: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 43/90

C hartsWaveform chart ± special numeric indicator 

that can display a history of values

Controls >> Graphs >> Waveform Chart

Page 44: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 44/90

Wiring Data into C harts

Single Plot Charts Multiplot Charts

Page 45: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 45/90

Exercise 3 ± Monitoring Temperature

Students build TemperatureMonitor.vi.

Page 46: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 46/90

S ection V ± Arrays & File I/ O

�Build arrays manually�Have LabVIEW build arrays automatically

�Write to a spreadsheet file

�Read from a spreadsheet file

Page 47: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 47/90

 Adding an Array to the Front Panel 

From the Controls >> Array and Cluster subpalette, selectthe Array Shell

Drop it on the screen.

Page 48: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 48/90

 Adding an Array (cont.)

�Place data object into shell (e.g. digitalcontrol).

Page 49: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 49/90

C reating an Array with a Loop

� Loops accumulate arrays at their boundaries

Page 50: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 50/90

C reating 2D Arrays

Page 51: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 51/90

File I/ O

�Read/write to

spreadsheet file

�Read/write characters

to file (ASCII)

�Read lines from file

�Read/write binary file

Easy FileEasy File

I/O VIsI/O VIs

Page 52: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 52/90

Do Not Delete This SlideDo Not Delete This Slide

Page 53: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 53/90

File I/ O Example

Writing a 2D Array to File

Page 54: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 54/90

File I/ O Example

Reading a 2D Array from a File

Page 55: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 55/90

Exercise 4 ± Analyzing and Logging Data

Students build TemperatureLogger.vi

Page 56: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 56/90

S ection VI ± Array Functions & Graphs

�Basic Array Functions

�Use graphs

�Create multiplots with graphs

Page 57: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 57/90

 Array Functions ± Basics

Page 58: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 58/90

 Array Functions ± Build Array 

Page 59: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 59/90

Graphs

�Selected from the Graph palette of Controls menu

 ±Waveform Graph ± Plot

an array of numbers

against their indices

 ±XY Graph ± Plot onearray against another 

 ±Digital Waveform Graph

 ± Plot bits from binary

data

Page 60: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 60/90

Do Not Delete This SlideDo Not Delete This Slide

Page 61: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 61/90

Graphs

�Right-Click on the Graph to Customize

Page 62: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 62/90

Exercise 5 ± Using Waveform Graphs

Page 63: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 63/90

S ection VII ± S trings, C lusters, & Error H andling

Page 64: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 64/90

S trings

� A string is a sequence of displayable or nondisplayablecharacters (ASC II)

� Many uses ± displaying messages, instrument control, file

I/ O

� S tring control/indicator is in the C ontrols»S tring subpalette

Page 65: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 65/90

C lusters

�Data structure that groups data together 

�Data may be of different types

�Analogous to struct  in C

�Elements must be either all controls or all indicators

�Thought of as wires bundled into a cable

Page 66: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 66/90

Page 67: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 67/90

C luster Functions

� In the Cluster subpalette of the Functions palette

� Can also be accessed by right-clicking on the cluster terminal

Bundle

(Terminal labelsreflect data type)

Bundle By Name

Page 68: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 68/90

C luster Functions

Unbundle

Unbundle By Name

Unbundled cluster in the diagram

Page 69: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 69/90

Error C lusters

�Error cluster contains the following information: ±Boolean to report whether error occurred

 ±Integer to report a specific error code

 ±String to give information about the error 

Page 70: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 70/90

Error H andling Techniques

�Error information is passed from one subVI to thenext

� If an error occurs in one subVI, all subsequentsubVIs are not executed in the usual manner 

�Error Clusters contain all error conditions

error clusters

Page 71: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 71/90

S ection VIII - C ase & S equence S tructures,

Formula Nodes

Page 72: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 72/90

C ase S tructures

� In the Structures subpalette of Functions palette

�Enclose nodes or drag them inside the structure

�Stacked like a deck of cards, only one case visible

Page 73: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 73/90

Exercise 6 ± Error C lusters & H andling

Page 74: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 74/90

S equence S tructures� In the Structures subpalette of Functions palette

�Executes diagrams sequentially, Frame 0 (0..x),where x is the total number of frames

�Stacked like a deck of cards, only one frame visible

Page 75: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 75/90

S equence Locals�Pass data from one frame to future frames

�Created at the border of the Sequence structure

Sequence localcreated inFrame 1

Data notavailable

Dataavailable

Page 76: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 76/90

Formula Nodes� In the Structures subpalette

� Implement complicated equations�Variables created at border 

�Variable names are case sensitive

�Each statement must terminate with a semicolon (;)

�Context Help Window shows available functions

Note semicolon

Page 77: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 77/90

S ection IX ± Printing & Documentation

� Print From File Menu to Printer, H TML, Rich Text File� Programmatically Print Graphs or Front Panel Images

� Document VIs in VI Properties » Documentation Dialog

�Add C omments Using Free Labels on Front Panel &Block Diagram

Page 78: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 78/90

Printing

� File » Print« Gives Many Printing O ptions ±C hoose to Print Icon, Front Panel, Block Diagram, VI 

H ierarchy, Included S ubVIs, VI H istory 

� Print Panel.vi (Functions » Application C ontrol)Programmatically Prints a Front Panel 

� Generate & Print Reports (Functions » Report 

Generation)

 ±S earch in Find Examples for Report Generation

Page 79: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 79/90

Documenting VIs

� VI Properties » Documentation ± Provide a Description and H elp Information for a VI 

� VI Properties » Revision H istory 

 ± Track C hanges Between Versions of a VI � Individual C ontrols » Description and Tip«

 ± Right C lick to Provide Description and Tip S trip

� Use Labeling Tool to Document Front Panels & Block Diagrams

Page 80: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 80/90

S ection X ± Basic Programming Architecture

�S imple VI Architecture� General VI Architecture

�S tate Machine Architecture

Page 81: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 81/90

S imple VI Architecture

� Functional VI that produces results when run ±No ³start´ or ³stop´ options

 ±S uitable for lab tests, calculations

� Example:C 

onvert C 

to F.vi 

Page 82: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 82/90

General VI Architecture

� Three Main S teps ±S tartup

 ± Main Application

 ±S hutdown

Page 83: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 83/90

S tate Machine Architecture

� Advantages ± C an go from any state from any other  ± Easy to modify and debug

� Disadvantages ± C an lose events if two occur at the

same time

States:

0: Startup

1: Idle

2: Event 1

3: Event 2

4: Shutdown

Page 84: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 84/90

Exercise 7 ± S imple S tate Machine

Page 85: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 85/90

Do Not Delete This SlideDo Not Delete This Slide

Page 86: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 86/90

S ection XI ± Remote Front Panels

� View & C ontrol LabVIEW Front Panels from a WebBrowser 

� Requires no programming

� Remote clients see ³live´ front panel updates� Multiple clients can view the same panel 

simultaneously 

�Only one client can control the front panel at a time

Page 87: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 87/90

Remote Panel Web Publishing Tool 

�Tools » Web Publishing Tool«

�Click Save to Disk and

VI is Embedded into an

Html File

�After File is Saved, ItCan Be Reopened and

Customized in Any Html

Editor 

Page 88: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 88/90

Remote Front Panels - Resources

� NI Developer Zone(zone.ni.com)

 ± S earch for Remote Front 

Panel 

 ± Tutorials & Instructions Are Available for Download 

 ± Information on

Incorporating Web

C ameras into RemotePanel Applications

S i XII Addi i l T i

Page 89: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 89/90

S ection XII ± Additional Topics

� Property Nodes� Local Variables

� Global Variables

�DataS ocket 

� Binary File I/ O

Wh D I G F H ?

Page 90: LabVIEWIntroduction-SixHour

8/6/2019 LabVIEWIntroduction-SixHour

http://slidepdf.com/reader/full/labviewintroduction-sixhour 90/90

Where Do I Go From H ere?

� Example programs ( H elp» Find Examples«)� LabVIEW S tudent Edition (www.ni.com/labviewse)

� Web resources (ni.com)

 ± NI Developer Zone (zone.ni.com) ± Application Notes

 ± Info-labview newsgroup (www.info-labview.org/)

 ± Instrument Driver Library (www.ni.com/idnet)