0% found this document useful (0 votes)
53 views16 pages

Labview Workshop Labview Workshop P P Review Session Review Session

This document provides an overview of LabVIEW and how to create virtual instruments (VIs) in LabVIEW. It discusses what LabVIEW is, how VIs are composed of a front panel and block diagram, and tools and palettes for controls, indicators, functions, and structures. Examples are provided on creating VIs to test input against a value, graph mathematical functions, and determine depth from a falling object or current-voltage characteristic from a resistor. The document is intended as a review for a LabVIEW workshop.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views16 pages

Labview Workshop Labview Workshop P P Review Session Review Session

This document provides an overview of LabVIEW and how to create virtual instruments (VIs) in LabVIEW. It discusses what LabVIEW is, how VIs are composed of a front panel and block diagram, and tools and palettes for controls, indicators, functions, and structures. Examples are provided on creating VIs to test input against a value, graph mathematical functions, and determine depth from a falling object or current-voltage characteristic from a resistor. The document is intended as a review for a LabVIEW workshop.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

5/16/2011

LabVIEWWorkshop p ReviewSession

Ayman Rabee|UAEU - ERU

Outline
What is LabVIEW LabVIEW VI and Toolboxes Palettes Co t o s a d d cato s Controls and Indicators Functions Graphing

Ayman Rabee|UAEU - ERU

5/16/2011

WhatisLabVIEW?
LabVIEW is Laboratory Virtual Instrument Engineering Workbench. Its Graphical Programming Language We will use LabVIEW for:
Simple programming tasks Data Displaying and Plotting Data Acquisition Control Systems

Ayman Rabee|UAEU - ERU

LabVIEWVI

Open NewVI

ALabVIEWprogram A LabVIEW program iscalledVirtual InstrumentorVI

Ayman Rabee|UAEU - ERU

5/16/2011

LabVIEWVI LabVIEWVI
Each VI is composed of front panel and block diagram. Front Panel: is the graphical user interface that contains controls and indicators. Block Diagram: is the actual coding. Here you have to construct the connection wiring between the controls, indicators and other icons that represent functions and control structures. Tip: to move back-and-forth from front panel to block diagram use the shortcut crtl+E

Ayman Rabee|UAEU - ERU

LabVIEWVI
RightClick FrontPanel RightClick BlockDiagram

Tip:usethesearchutilitytofindanycontrol,indicatororfunctionifyouareunable toallocatethem

Ayman Rabee|UAEU - ERU

Run Continuous Stop Pause Button RunButton Button Button

5/16/2011

ToolsPalette
The tools palette can be viewed from the view menu. The most common tools are indicated below.

Automatictoolselection Operatevaluetool Wiringtool ProbeDatatool

Arrowtool Edittexttool Getcolor G t l Setcolor

Ayman Rabee|UAEU - ERU

ControlsPalette FrontPanel ControlsPalette

Ayman Rabee|UAEU - ERU

InsertcontrolsandindicatorsintotheFront Paneltocontrolyourinputandoutputdata

5/16/2011

FunctionsPalette BlockDiagram FunctionsPalette

Ayman Rabee|UAEU - ERU

ControlsandIndicators
Numerical Controls/indicators: if you are working numerical data

Ayman Rabee|UAEU - ERU

10

5/16/2011

ControlsandIndicators
Boolean Controls/Indicators: if you are working with logical data

Ayman Rabee|UAEU - ERU

11

Numerical&MathConstants

Ayman Rabee|UAEU - ERU

12

5/16/2011

BooleanConstants
Boolean constants

Ayman Rabee|UAEU - ERU

13

WiringColors
Wiresarecolorcodedtocorresponddatatypes.Belowaresomeofthe mostcommondatatypesalongwiththecorrespondingcolor

Integernumeric(single) Integernumeric(array) Floatnumeric(single) ( y) Floatnumeric(array) Boolean

Ayman Rabee|UAEU - ERU

14

5/16/2011

Inputvs.Output Numericalvs.Numerical

Ayman Rabee|UAEU - ERU

15

ControlStructures
For Loop While Loop Case structure st uctu e Sequence Structure

Ayman Rabee|UAEU - ERU

16

5/16/2011

ForLoop
Theforlooprepeatstheexecutionofitssubdiagramafixednumber oftimes.Numberofrepetitions(iterations)dependsontheinput terminalN.

N:numberofiterations(input) Itisconnectedtoaconstantor acontrol

i=0,1,2,3,...,N1 Itspecifiesthecurrentloop iterationnumber


Ayman Rabee|UAEU - ERU

17

ForLoop

Sizeofarrayisequalto numberofiterationN. Thisisthecaseonlyifthe autoindexingisenabled.

Thisiscalledtunnel :ifautoindexingisenabledthentunnel containseveryvaluetheVIwillgenerate. Bydefault,autoindexingisenabledinforloops. Autoindexingmeans:howtheloopwillpassthevalue(s)tothe outside.Itcanbeusedtobuilduparraysifenabled.


Ayman Rabee|UAEU - ERU

18

5/16/2011

WhileLoop
The while loop repeats the sub diagram inside it until loop condition receives a particular Boolean value value. It can be stopped by: Boolean Button Condition
Currentiterationnumber

Loopcondition Loop condition Continueiftrue

Bydefault,autoindexingisdisabled inwhileloops.

Loopcondition Stopiftrue

Ayman Rabee|UAEU - ERU

19

WhileLoopExamples

Ayman Rabee|UAEU - ERU

20

10

5/16/2011

CaseandSequenceStructures
Case structure: It is by default has two states, true and false. The value wired to the selector input terminal determines which case sub-diagram is going to be executed. Remember that one case is executed at a time, and the whole case structure is executed once. Unlike Looping structure which can be executed as many times as required. Sequence Structure: Consists of one or more sub-diagram or frames, which are executed sequentially.

Ayman Rabee|UAEU - ERU

21

FormulaNode
Perform math operations based on a numerical input. You have to identify the inputs and outputs of the equation programmed in Variable names are case sensitive You can use built in functions such as: abs, exp, sqrt Each statement must be terminated with a semicolon (;)

Ayman Rabee|UAEU - ERU

22

11

5/16/2011

SelectorFunctions
It its called selector because it returns at the output either: The input t if s is TRUE. The input f if s is FALSE. p

The inputs t and f should be of the same type. Both should be numerical or both should be Boolean.

Ayman Rabee|UAEU - ERU

23

Example1
Write a VI that tests an input number against 5. If it is greater than 5 a green LED will light, otherwise a red LED will light (Use one LED).

Ayman Rabee|UAEU - ERU

24

12

5/16/2011

Graphicalindicators
Chart - can be used to plot single values or arrays. Also used y to view history of the data Graph - Plot an array of numbers g against their indices XY Graph - Plot an array of numbers against another
Ayman Rabee|UAEU - ERU

25

Example2:Drawsin(t),0 t 10withstepof0.1 Example2:Drawsin( 10withstepof0.1

Ayman Rabee|UAEU - ERU

26

13

5/16/2011

Example3:Drawsin(t/)vs.cos(t/),0t 100 Example3:Drawsin(t/)vs.cos(t/),0t

Ayman Rabee|UAEU - ERU

27

Example4
A stone is dropped into a deep well and is heard to hit the water 3.41 s after being dropped. Write a LabVIEW to determine the depth of the well. Solution: From Newtons law of Motion H= V0 t + at2 Given : V0 = 0 m/s Gi / t = 3.41 s a = g = 9.8 m/s2
28

14

5/16/2011

29

Example4
Write a LabVIEW VI to automatically determine the currentvoltage characteristic for a Resistor. The current-voltage characteristic of the Resistor is to be determined from 0 to 12 Volts. For quick analysis, the currentvoltage characteristic is plotted on an XY graph with no less than 24 samples. Also, note that a 500ms time delay is often required between the setting of the power supply and reading the measurement of the DMM.

Ayman Rabee|UAEU - ERU

30

15

5/16/2011

Ayman Rabee|UAEU - ERU

31

Ayman Rabee|UAEU - ERU

32

16

You might also like